web analytics
Call sp_columns to list column definition for the specified table in SQL Server Options
codeling
Posted: Sunday, December 13, 2015 11:30:42 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 931
Points: 3909

In SQL Server, the system-defined stored procedure sp_columns returns column information for the specified objects that can be queried in the database.

sp_columns syntax

sp_columns [ @table_name = 'Object name.' ] ,
[ @table_owner = 'The database user who created the table.' ] ,
[ @table_qualifier = 'Database name.' ] ,
[ @column_name = 'Column name.' ] ,
[ @ODBCVer = 'ODBC Version 2 or 3.' ] ;

Example

USE model;
GO
EXEC sp_columns
@table_name = 'students',
@table_owner = 'dbo'; 

Sponsor
Posted: Sunday, December 13, 2015 11:30:42 AM
 
Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2018 Digcode.com. All rights reserved.