To view the detailed information of SQL tables, we will share with you an SQL statement (statements come from dynamic softwares) for viewing the detailed information of tables in the SQL Server database. Although there is no complicated technology, however, in the sqlserver database, you can easily view the detailed structure of the table. The result is shown in the figure below: I wrote it as a stored procedure. when calling the stored procedure, the parameter is the table name.
To view the detailed information of SQL tables, we will share with you an SQL statement (statements come from dynamic softwares) for viewing the detailed information of tables in the SQL Server database. Although there is no complicated technology, however, in the sqlserver database, you can easily view the detailed structure of the table. The result is shown in the figure below: I wrote it as a stored procedure. when calling the stored procedure, the parameter is the table name.
View SQL table details
I would like to share with you an SQL statement for viewing detailed information about tables in the sqlserver database (the statement comes from dynamic softwares). Although there is no complicated technology, however, the detailed structure of the table can be easily viewed in the sqlserver database. The results are as follows:
I wrote it as a stored procedure. when calling the stored procedure, the U.S. space, the U.S. space, the parameter is the table name, and the U.S. space. This will help us in development.
Description: This method is used with the SQL2000 database.
Create proc getTable @ tabName varchar (50) = nullasSELECT table name = case. colorder when 1 then d. name else ''end, serial number =. colorder, column name =. name, type = B. name, length = case when B. name = THEN. length/THEN. length/2 ELSE. length END, precision = COLUMNPROPERTY (. id,. name,), decimal point = isnull (COLUMNPROPERTY (. id,. name,), 0), id =) = end, primary key = and name end, allow null = end, default value = isnull (e. text, ''), column description = isnull (g. [value], '') FROM syscolumns a left join policypes B on. xusertype = B. xusertype inner join sysobjects d on. id = d. id and (d. xtype = or d. xtype =) and d. name <> left join syscomments e on. cdefault = e. id left join sysproperties g on. id = g. id and. colid = g. smallid where d. name = @ tabName or @ tabName is nullorder by d. name,. colorder
I believe everyone will use it.
The addresses that support sql2005 and sql2008 are also attached:
Posted on