Twitter

Follow SQLQuill on Twitter

Subscribe

MN Pass

A script to create missing default bindings

Today five people showed up in my cube at 5:15 saying that the new development databases are missing defaults.  I did some checking and the default objects were there, the columns with default constraints were there, but the columns with bindings to the default objects were missing the bindings.  I created a script to run on the source database.  The output of this script will be a script to run on the destination database to get things in sync.

Hopefully you won’t need it, with new tools like VS2010 and Redgate’s SQL Compare, but here it is if you do:

Select
     'EXECUTE sp_bindefault ''dbo.' + SO.Name + ''', N''dbo.' + OBJECT_NAME(SC.object_id) + '.' + SC.name + ''''
from sys.columns SC
Join sys.objects SO on SO.object_id = SC.default_object_id and type = 'D' and parent_object_id = 0
Order by SO.Name

Link Round Up – January 2012 Edition

Here’s the links I’ve tweeted in the last month – hope it is useful/entertaining/etc.  (I’ve been trying out ifttt and sending all my tweeted links to instapaper.com, then exporting exporting it from there)

SQL

Tools

News

Entertainment

Humor

Sports

Running/Workouts

January PASSMN Meeting – Writing Better Queries

Meeting Details

Please click here for meeting details and to RSVP

Writing Better Queries

Joe Webb (B/T), WebbTech Solutions

Transact-SQL is not a very difficult language to learn. As long as the syntax is correct, it can be quite forgiving. However to truly get the best performance from your SQL Server, careful consideration should be given to the structure and logic of the queries. In this session, we’ll discuss some Transact-SQL tips and tricks that can be employed to help you write better queries, allowing your server to perform better.

Since its inception, Joe Webb has served as Chief Operating Manager for WebbTech Solutions, a Nashville-based consulting company. He has over 15 years of industry experience and has consulted extensively with companies in the areas of business process analysis and improvements, database design and architecture, software development, and technical training.

In addition to helping his consulting clients, Joe enjoys writing and speaking at technical conferences. He has spoken at conferences in Europe and the North America and has authored or co-authored four books including “SQL Server MVP Deep Dives, Volume 2”,  “SQL Server MVP Deep Dives”, “The Rational Guide To: SQL Server Notification Services”, and  “The Rational Guide To: IT Consulting”.

Joe is an eight-time recipient of the prestigious Microsoft MVP Award for demonstrating a willingness to share his expertise with the SQL Server Community.