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

Script to Return a Transposed Data Row

By click-fund, 2005/11/10

I often do the following when administering databases "select * from Table where PrimaryKey=value" and find the output in Query Analyzer is inconvenient to view when the table has many wide columns (which is often the case). This script returns a single entry from a table but "transposed" so that the data flows down the page not accross it. I know this sounds trivial, but it's convenient, so I thought I'd share it.

(Note: T-SQL doesn't support arrays, as far as I'm aware, so the code is a little ugly.)

Total article views: 204 | Views in the last 30 days: 2
 
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