Get the structure, column name, column type, and length of individual tables

xiaoxiao2021-03-06  75

Create Procedure DBO.TRANS_GETTABECOLUMNSINFO

@TableName Varchar (50)

/ *

According to the incoming table name, obtain the information, column name, column data type, and data type length of the column of the corresponding table.

* /

AS

Select syscolumns.name, systypes.name, syscolumns.length

From syscolumns join sysobjects on syscolumns.id = sysobjects.id join systempes on systems.xtype = syscolumns.XTYPE

WHERE

sysobjects.name=@tablename

Go

转载请注明原文地址:https://www.9cbs.com/read-91816.html

New Post(0)