A script that is written to view the structure of the MS SQL Server table (originally intended to be used for plagiarism)

Source: Internet
Author: User
<%
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open "ODBC name", "username", "password"
Sql1= "SELECT * from dbo.sysobjects where type is 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 as not rscc.eof
sql = "SELECT * from" &AMP;RSCC ("name")

Rs.Open sql,conn,1,2
Response.Write "If "1" = "1" Then
For i=0 to Rs. Fields.count-1
Response.Write "Field Name:" &rs.fields (i). Name & "<br>"
Response.Write "Type:"
If Rs.fields (i) type= "3" Then
Response.Write "Int"
If Rs.fields (i). Attributes= "Then" Response.Write "AutoNumber field"
If Rs.fields (i). Attributes= "Then" Response.Write "Allow null"
If Rs.fields (i). Attributes= "then" Response.Write "Not allowed empty"
ElseIf Rs.fields (i) type= "129" Then
Response.Write "Char"
Response.Write "Size" &rs.fields (i). DefinedSize
If Rs.fields (i). Attributes= "Then" Response.Write "Allow null"
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.