大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> ASP专区 -> 当写的一个用来查看MS sql server表结构的一个脚本(本来打算用来剽窃的)

当写的一个用来查看MS sql server表结构的一个脚本(本来打算用来剽窃的)

时间: 2021-07-31 作者:daque

<%set conn = server.createobject("adodb.connection")conn.open "odbc名","用户名","暗号"sql1="select * from dbo.sysobjects where type not in('s','d','k')"sql1="select * from dbo.sysobjects where type ='u'"set rscc = server.createobject("adodb.recordset")set rs = server.createobject("adodb.recordset")rscc.open sql1,conn,1,2 dowhile not rscc.eof sql ="select* from "&rscc("name")  rs.open sql,conn,1,2 response.write "<hr>表名"&rscc("name")&"<br>" if "1"="1" thenfor i=0 to rs.fields.count-1response.write "字段名:"&rs.fields(i).name &"<br>"response.write "典型:"if rs.fields(i).type="3" thenresponse.write "int"if rs.fields(i).attributes="16" then response.write "机动编号字段"if rs.fields(i).attributes="120" then response.write "承诺空"if rs.fields(i).attributes="24" then response.write "不承诺空"elseif rs.fields(i).type="129" thenresponse.write "char"response.write "巨细"&rs.fields(i).definedsize if rs.fields(i).attributes="120" then response.write "承诺空"if rs.fields(i).attributes="24" then response.write "不承诺空"elseif rs.fields(i).type="201" thenresponse.write "text"if rs.fields(i).attributes="234" then response.write "承诺空"if rs.fields(i).attributes="138" then response.write "不承诺空"elseif rs.fields(i).type="202" thenresponse.write "nvarchar"response.write "巨细"&rs.fields(i).definedsize if rs.fields(i).attributes="8" then response.write "! 不承诺空"if rs.fields(i).attributes="104" then response.write "! 承诺空"elseif rs.fields(i).type="131" thenresponse.write "numeric"if rs.fields(i).attributes="120" then response.write "承诺空"if rs.fields(i).attributes="24" then response.write "不承诺空"elseif rs.fields(i).type="2" thenresponse.write "smallint"if rs.fields(i).attributes="120" then response.write "! 承诺空"if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="11" then response.write "bit" if rs.fields(i).attributes="120" then response.write "! 承诺空" if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="135" then response.write "smalldatetime" if rs.fields(i).attributes="120" then response.write "! 承诺空" if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="203" then response.write "ntext" if rs.fields(i).attributes="234" then response.write "! 承诺空" if rs.fields(i).attributes="138" then response.write "! 不承诺空"elseif rs.fields(i).type="6" then response.write "money" if rs.fields(i).attributes="120" then response.write "! 承诺空" if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="130" then response.write "nchar" if rs.fields(i).attributes="120" then response.write "! 承诺空" if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="4" then response.write "real"if rs.fields(i).attributes="120" then response.write "! 承诺空"if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="5" thenresponse.write "flat"if rs.fields(i).attributes="120" then response.write "! 承诺空"if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseif rs.fields(i).type="128" thenresponse.write "binary"if rs.fields(i).attributes="120" then response.write "! 承诺空"if rs.fields(i).attributes="24" then response.write "! 不承诺空"elseresponse.write "未知"&rs.fields(i).typeend ifresponse.write " 属性:"&rs.fields(i).attributesresponse.write "-------------<br>"next end ifrs.close'------------------------------------- rscc.movenextloopset rs=nothingset rscc=nothingset conn=nothing%>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.