SQL uses SP

zhaozj2021-02-16  56

Source: http://www.winmag.com.cn/forum/itemdisplay.asp? BoardId = 11 & id = 446212

System Process SP_COLUMNS_ROWSET is a non-document process that returns detail information about a column of a table and table This process is output and the output of the information_schema.columns system has three output parameters: @ Table_name- use system data type, system name. @ Table_schema-Table Planning Series. @ Column_name-The name of the table column. The following code uses sp_columns_rowset and an anti-query NFORMATION_SCHEMA system view,. USE NORTHWINDGOEXEC sp_columns_rowset @table_name = N'Orders', @table_schema = N'dbo'EXEC sp_columns_rowset @table_name = N'Orders', @table_schema = N'dbo ', @column_name = N'Freight'GOSELECT * FROM INFORMATION_SCHEMA.COLUMNSWHERE TABLE_NAME = N'Orders'GO Here is the output of headers from sp_columns_rowset: TABLE_CATALOG TABLE_SCHEMA TABLE_NAME -COLUMN_NAME -COLUMN_GUID -COLUMN_PROPID ORDINAL_POSITION -COLUMN_HASDEFAULT COLUMN_DEFAULT -COLUMN_FLAGS IS_NULLABLE DATA_TYPE -TYPE_GUID CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION (nUMERIC_PRECISION_RADIX) NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_CATALOG CHARACTER_SET_SCHEMA CHARACTER_SET_NAME COLLATION_CATALOG COLLATION_SCHEMA COLLATION_NAME DOMAIN_CATALOG DOMAIN_SCHEMA DOMAIN_NAME -DESCRIPTION -COLUMN_LCID -COLUMN_COMPFLAGS -COLUMN_SORTID -COLUMN_TDSCOLLATION -IS_COMPUTED by the sp_columns_rowset output is the user's details and information, when the output from the output of the process and content of INFORMATION_SCHEMA.COLUMNS very similar, there will be a lot of extra information bar .

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

New Post(0)