Pages

Saturday, September 27, 2008

Columns in SQL Server

In next couple of posts i will explain about some very usefull stored procedures in SQL Server.

SP_COLUMNS: SP_COLUMNS OBJECT, [OWNER_NAME], [TABLE_QUALIFIER], [COLUMN_NAME], [ODBCVER]

The sp_columns stored procedure is used to display information about table columns or view columns. The procedure accepts the table or view name as a parameter.

OBJECT: This is nothing but table or view.
OWNER_NAME: Is nothing but owner of object. This is optional Parameter.
TABLE_QUALIFIER: parameter refers to the database name in which the table or view exists. This is optional Parameter.
COLUMN_NAME: parameter specifies the name of a column that you pass as a parameter whose information is to be displayed.
ODBCVER: Parameter specifies the ODBC version used.

USE Pubs
GO
EXEC sp_columns @table_name = N'Employee', @table_owner = N'HR';

No comments: