THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

Allen White

T-SQL Tuesday #025 - Invitation to Share Your Tricks

T-SQL TuesdayIt doesn't seem that long ago that having cool little tidbits of information about SQL Server made a huge difference in how effective you could be. Well, that's still true, but let me give you an example.

SELECT name FROM sysobjects WHERE sysstat & 4 > 0

In the early days of SQL Server, this was the way to pull a list of the names of all the stored procedures in your database. The 4 bit in the sysstat column represented stored procedures. (1 represented user tables and 2 represented view, as I recall, so changing the WHERE clause to read WHERE sysstat & 7 > 0 returned all tables, views and stored procedures.)

As SQL Server has evolved, Microsoft has made it easier to query the metadata to determine what objects existed, adding columns that helped (like 'Type' in this case), catalog views, Dynamic Management Objects, etc.

So, the challenge for this month's T-SQL Tuesday is: What T-SQL tricks do you use today to make your job easier? (Notice I didn't say PowerShell - I have a bunch of those now, but this is T-SQL Tuesday, not PowerShell Tuesday.)

Here are the rules:

  1. Your post must go live between 00:00:00 GMT on Tuesday December 13 and 00:00:00 GMT on Wednesday December 14.
  2. Your post must link back to this post, and the link must be anchored from the logo (found above) which must also appear at the top of your post.
  3. Leave a comment or a trackback here on this blog regarding your post.
  4. 'T-SQL Tuesday #025' should be included in the title of the post.
  5. If you're on Twitter, tweet about your post using the hash tag #TSQL2sDay

I'm looking forward to reading what goodies you're all going to share. After the event closes I'll post a summary of all your contributions.

Allen

Published Monday, December 05, 2011 10:52 AM by AllenMWhite
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

T-SQL Tuesday #025 ??? Tips and Tricks « Musings of an Accidental DBA said:

December 5, 2011 3:27 PM
 

Rob Farley said:

T-SQL Tuesday again and this month is on T-SQL Tips (thanks Allen !). In some ways it’s a tough topic,

December 12, 2011 7:46 PM
 

Greg M Lucas said:

Here's my contribution - thanks for hosting Allen.

December 12, 2011 7:54 PM
 

T-SQL Tuesday #025 Tips and Tricks said:

December 12, 2011 7:54 PM
 

SQL SERVER – A Quick Look at Performance – A Quick Look at Configuration « SQL Server Journey with SQLAuthority said:

December 12, 2011 8:30 PM
 

Tracy McKibben (RealSQLGuy) said:

December 12, 2011 9:02 PM
 

Mala said:

December 12, 2011 9:40 PM
 

T-SQL Tuesday #025 – Tips and Tricks « Sam Vanga's said:

December 12, 2011 11:01 PM
 

Read Your Error Log???s T-SQL Tuesday #025 « Chris Shaw’s Weblog said:

December 13, 2011 1:23 AM
 

Chris Shaw said:

I think I am a little sooner than I should be, but got to work a double in 5 hours and I need to head to bed.  Great topic.  Thanks for hosting.

December 13, 2011 1:25 AM
 

Kent Chenery said:

Not sure this is a "trick"...but here's potentially a new idea for some people.  I've called it selective aggregates: http://blog.sqlconcepts.co.nz/2011/12/t-sql-tuesday-25-t-sql-tricks-selective.html

December 13, 2011 4:08 AM
 

T-SQL Tuesday #025 – Truques | Blog do Leka said:

December 13, 2011 7:17 AM
 

T-SQL Tuesday #025 – Truques | Blog do Leka said:

December 13, 2011 7:19 AM
 

T-SQL Tuesday 25: Easy Integrity | Matt Velic said:

December 13, 2011 7:21 AM
 

Jason Strate said:

December 13, 2011 8:29 AM
 

Jes Schultz Borland said:

Thank you for hosting Allen! My contribution is "T-SQL Tuesday #25: T-SQL Tricks - Checking Transaction Log Space Used" - http://blogs.lessthandot.com/index.php/DataMgmt/DBAdmin/MSSQLServerAdmin/t-sql-tuesday-25-t.

December 13, 2011 8:30 AM
 

T-SQL Tuesday #025: Trick or …? | Bob Pusateri - The Outer Join said:

December 13, 2011 8:46 AM
 

What's queries are currently running? | JohnSterrett.com said:

December 13, 2011 8:51 AM
 

T-SQL Tuesday #025 – Monitoring table growth | SQL Servings said:

December 13, 2011 9:14 AM
 

T-SQL Tuesday #25 – Tips and Tricks | Dev Nambi - Turn Data Into Meaning said:

December 13, 2011 9:19 AM
 

T-SQL Tuesday #025 – My Favorite Little Trick « Just A Bunch Of Gogorichie said:

December 13, 2011 9:34 AM
 

Colleen Morrow said:

December 13, 2011 10:29 AM
 

TOP Tricks (T-SQL Tuesday #25) | Dave's SQL Blog said:

December 13, 2011 10:29 AM
 

T_SQL Tuesday #25: Sharing Tricks » said:

December 13, 2011 11:11 AM
 

T-SQL Tuesday #25 ??? SQL Server Tips & Tricks | sqlity.net said:

December 13, 2011 11:39 AM
 

T-SQL Tuesday #025 – Share Your Tricks #TSQL2sDay | Strate SQL said:

December 13, 2011 12:03 PM
 

Nic Cain said:

December 13, 2011 12:06 PM
 

Steve said:

December 13, 2011 12:14 PM
 

SQL Holiday Gifts | SQL RNNR said:

December 13, 2011 12:54 PM
 

Aaron Bertrand said:

This month's T-SQL Tuesday is being hosted by Allen White ( @SQLRunr ) and is about sharing your T-SQL

December 13, 2011 1:54 PM
 

Rob Volk said:

December 13, 2011 2:28 PM
 

T-SQL Tuesday #25 ??? The Best Tool You’ve Never Used | tenbulls.co.uk said:

December 13, 2011 5:01 PM
 

Mark Broadbent said:

December 13, 2011 5:02 PM
 

Steve Smith said:

December 13, 2011 5:39 PM
 

Nigel Sammy said:

December 13, 2011 11:02 PM
 

Steve Jones said:

Weird, i before e except after c. Mine didn't appear. Here it is: http://voiceofthedba.wordpress.com/2011/12/13/t-sql-tuesday-25-t-sql-tricks/

December 14, 2011 12:00 PM
 

T-SQL Tuesday #25 – T-SQL Tricks « Voice of the DBA said:

December 14, 2011 12:17 PM
 

TSQL Tuesday #026 – Second Chances | Dave's SQL Blog said:

January 3, 2012 9:12 AM
 

Rob Farley said:

In my last post, I showed a technique for dealing with working columns when writing T-SQL. The idea was

January 9, 2012 7:06 PM
 

Robert Pearl's Blog said:

Everybody deserves a second chance in love, life, and in TSQL as well! Now that it's the beginning

January 16, 2012 6:14 AM
 

T-SQL Tuesday #026 – The Wrap Up | Dave's SQL Blog said:

January 18, 2012 9:58 AM
 

T-SQL Tuesday Topics – Febuary 2012 « Voice of the DBA said:

February 7, 2012 11:44 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About AllenMWhite

Allen White is a consultant and mentor for Upsearch Technology Services in Northeast Ohio. He has worked as a Database Administrator, Architect and Developer for over 30 years, supporting both the Sybase and Microsoft SQL Server platforms over that period.
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement