SQLStudies
Archives: March 2013
How do I move a SQL login from one server to another without the password?
This is an uncommon task but one that does turn up every once in awhile. A SQL login has to be moved from a development server to a test server, test to prod etc. Or maybe a lateral move to a new server. And frequently the DBA doesn’t and/or shouldn’t… Read more
6 comments, 2,083 reads
Posted in SQLStudies on 25 March 2013
Using Templates
Templates are one of those really handy tools that most DBAs I know of have either never heard of or just don’t use much. I have to admit I fall into the second category myself. I will break out templates occasionally when I’m working with something I don’t do much.… Read more
0 comments, 199 reads
Posted in SQLStudies on 18 March 2013
The STUFF function
While I was at the 2011 Pass Summit I was given the following piece of code to create a comma delimited list.
SELECT files.database_id, db.name AS DatabaseName,
STUFF((SELECT ', ' + names.name
FROM sys.master_files names
WHERE names.database_id = files.database_id
FOR XML PATH(''),TYPE).value('.','VARCHAR(MAX)')
, 1, 2, '') AS NameList
FROM sys.master_files…
0 comments, 179 reads
Posted in SQLStudies on 14 March 2013
What is mssqlsystemresource?
If you are lucky you’ve never seen an error along the lines of:
The SELECT permission was denied on the object 'sysobjects', database 'mssqlsystemresource', schema 'sys'.
But let’s face it, luck runs out. So you may want to know what on earth this mysterious fifth system database is. As of… Read more
1 comments, 189 reads
Posted in SQLStudies on 4 March 2013
Script to clean up “Windows” logins no longer in AD
I was scanning http://dba.stackexchange.com and ran across the following question:
Basically the OP wanted to know how to get rid of “Windows” or AD logins. Mike Fal answered with a very cool script I just had to blog about. Basically it scan’s through the Windows logins in sys.server_principals and… Read more
7 comments, 1,735 reads
Posted in SQLStudies on 1 March 2013



Subscribe to this blog