Skip to content

Instantly share code, notes, and snippets.

@dlgombert
Last active March 14, 2022 16:25
Show Gist options
  • Select an option

  • Save dlgombert/675aa7fb8d0830935261c4b678878682 to your computer and use it in GitHub Desktop.

Select an option

Save dlgombert/675aa7fb8d0830935261c4b678878682 to your computer and use it in GitHub Desktop.
[MSSQL helper functions] `sp` command shortcuts built into SQL Server #tsql #sql

sp_columns

Returns column information for the specified objects that can be queried in the current environment. [1]

syntax

sp_columns [ @table_name = ] object  
     [ , [ @table_owner = ] owner ]   
     [ , [ @table_qualifier = ] qualifier ]   
     [ , [ @column_name = ] column ]   
     [ , [ @ODBCVer = ] ODBCVer ]  

example

exec sp_columns MyTable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment