Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

Column_Gitter

By RickInMesa,

This little utility comes in handy if you do a lot of SQL coding. Given a table name, it'll return four results: The names of the columns, the names with their datatypes, the list of columns with each one set to an identically-named variable, and a list of variables with the same names as the columns.

If you run it as a script, just type in the name of the table on the second line. I prefer to make this a stored procedure, and pass the table name as a parameter. If you do this, then you can open a Query Analyzer window, type

Column_Gitter 'myTableName'

and hit F5, in less time than it takes to browse the table properties.

No more column-name typing! I hope this helps you.

Rick

Total article views: 188 | Views in the last 30 days: 1
 
Related Articles
FORUM

column size

column size

FORUM

Computed Column

Computed Column

FORUM

split columns

Split columns

FORUM

alter column

alter column

FORUM

add column between two column

add column between two column

Tags
miscellaneous    
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones