I’ve discussed SSIS on this site before, but I’ve heard the feedback, you want real world examples. So, I decided to use the business case I address most often using SSIS, and that’s Exchange Transformation and Load. Let’s dive right in to this problem. You receive a file via FTP from a vendor every day. …
Author: slowder
SQL 301 – Views
At this point I’m sure you know how to CREATE and ALTER a VIEW. But today I’d like to go into a little more detail on views. I’d like to cover updatable views, and some additional options you can add to your CREATE or ALTER VIEW statements. Updatable Views You can write insert s, updates,…
Merry Christmas!
I’d like to wish each and every one of you a very merry Christmas! We may not celebrate it the same way. We may not even think of the same things today. But the one thing I hope we can agree on is Peace on Earth. It’s the gift we all should want every year. …
Things Do Not Change; We Change.
It’s a quote from Henry David Thoreau. Well, It’s been about two weeks since I left my last job. And even in that period of time lots has happened. I believe my divorce is now final. I had to go through arbitration to settle the division of assets and debts. Turns out I’ll have to…
Find Tables Containing a Certain Column
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!…
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…
DDL Triggers
Introduction OK, we all know that when we create objects in a database, we’re using Data Definition Language (DDL) commands. Every time we create an object, we’re firing an event. Since we’re firing an event, we can also do some action… That means we can create a TRIGGER to handle this action. A DDL trigger…