Today I had to find all the tables that contained a certain column. I was going to rename the column, so it made more sense when you see it in my tables. In order to make the change, I had to know all the tables that had the column. Then, I get to use sp_rename!…
Month: November 2008
SQL Session – Tips and Tricks for Writing Better Queries
If you’re not already a member of the Charlotte SQL Server User Group, go now and sign up. This group is a great resource of knowledge and connections to the SQL Server community in Charlotte, NC. Their plan is to get together once a month and discuss a new and interesting topic on SQL Server….
Good News Everyone!
It’s been a while since I’ve been on here, but I have good reasons. I’ve been working at my current employer for three and a half years. I no longer see this place in a positive light. So I’ve worked hard to find a better job. After a fairly short search I found a new…
sp_executesql
I’m pretty sure this is the first time I’ve brought up dynamically generated SQL statements. But it’s time you learn about them. There are times where you’ll need to run the same statement against multiple tables. Or agains multiple databases. Sometimes, you may not know how many columns you’ll need to create or select during…
Nesting an Exception
Like just about every other technique in Microsoft SQL you can nest your exception handling. The basic template is: BEGIN TRY BEGIN TRY — Nested try block END TRY BEGIN CATCH — Nested catch block END CATCH END TRY BEGIN CATCH –catch block END CATCH You can do this as many levels deep as you…