Tag Archives: Scripting

Recursive Directory Scripting

Inside source control, I have scripts arranged as follows: Drive:/Base/Database/ Drive:/Base/Database/Functions Drive:/Base/Database/Proc Drive:/Base/Database/Tables Etc.. Each script stored can be run multiple times with no ill effect. For example, a table generation script first checks to see that it exists before … Continue reading

Posted in SQL Server Development, SQL Toolbox | Tagged , , | Leave a comment

Moving Database Logins

Recently we had a database issue, that necessitated us moving logins. Here’s an article I used from Microsoft to help script the logins. The KB is specifically for 2005 -> 2008, but it will also get you login’s out of … Continue reading

Posted in SQL Toolbox | Tagged , , , | Leave a comment

INSERT INTO & Temp Table Creation

At my previous employer, my old boss and I would debate the merits of using “INSERT INTO” to create temp tables. He was against it in all cases, where I would use it when I was exploring a problem, or … Continue reading

Posted in SQL Server Development | Tagged , , , | 2 Comments

Database Mail – HTML Formatting

I received a request that a user wanted to be notified when Unusual_Event_01 occurred. The information request was beyond the scope of a simple text e-mail, but didn’t require an excel file to be created and dropped. I came up … Continue reading

Posted in SQL Server Development | Tagged , , , | Leave a comment

Temporary Table Scripting

New version: here A new job on our servers started failing with an odd message. Essentially, the problems boiled down to an INSERT INTO causing more problems than it was worth. The temp table in question that was being created … Continue reading

Posted in SQL Server Development | Tagged , , , | Leave a comment