Tim, it was definitely of interest to me, as although I've heard of a couple of these, I've not seen listed exactly what they are/what they do, and as with anything else, wouldn't know to Google it (Bing it?) unless I knew what I was looking for.

-- Make sure login name is existingif (@loginame is not null) begin if not exists (select 1 from master.dbo.syslogins with (nolock) where name = @loginame) begin raiserror(15007, -1, -1, @loginame) return (1) end end

-- check if database is existingif (@dbname is not null) begin if not exists (select name from master.dbo.sysdatabases with (nolock) where name = @dbname) begin raiserror (15010, -1, -1, @dbname) return (1) end end

Boo Birds are out for the posters bashing the author's article being to simplistic. We have to remember as SQL keeps stealing marketshare there are thousands of new DBA's every year who this is very valuable for. Just think of a the new DBA reading for the first time that MS can just yank away code without warning. That was a lesson for me 10 years ago. An article like this would have been a life saver.