最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
当写的一个用来查看MS sql server表结构的一个脚本(本来打算用来剽窃的)
时间:2022-06-30 10:34:19 编辑:袖梨 来源:一聚教程网
<%
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
do while not rscc.eof
sql ="select * from "&RSCC("name")
rs.open sql,conn,1,2
response.write "
表名"&RSCC("name")&"
"
if "1"="1" then
for i=0 to rs.Fields.Count-1
response.write "字段名:"&rs.fields(i).name &"
"
response.write "类型:"
if rs.fields(i).type="3" then
response.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" then
response.write "char"
response.write "大小"&rs.fields(i).DefinedSize
if rs.fields(i).Attributes="120" then response.write " 允许空"
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
do while not rscc.eof
sql ="select * from "&RSCC("name")
rs.open sql,conn,1,2
response.write "
表名"&RSCC("name")&"
"
if "1"="1" then
for i=0 to rs.Fields.Count-1
response.write "字段名:"&rs.fields(i).name &"
"
response.write "类型:"
if rs.fields(i).type="3" then
response.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" then
response.write "char"
response.write "大小"&rs.fields(i).DefinedSize
if rs.fields(i).Attributes="120" then response.write " 允许空"
相关文章
- 江南百景图听风塔怎么样 11-22
- 原神恰斯卡圣遗物怎么搭配 11-22
- 2024年霸王茶姬11月22日口令是什么 2024.11.22霸王茶姬口令介绍 11-22
- 光遇11.21季节蜡烛在哪里 光遇11月21日季节蜡烛位置攻略 11-22
- 光遇11.21大蜡烛在哪里 光遇11月21日大蜡烛位置攻略 11-22
- 光遇11.21免费魔法有什么 光遇11月21日免费魔法收集攻略 11-22