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….
Happy Birthday to Me!
It’s another birthday for me. I’m going to take the day off, and catch up on some video games. Hang out with my friends. Grab a nice meal… I’m thinking sushi! And mostly just slack off. See you guys later!
SQL Session – Introducing Resource Governor
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….
INSTEAD OF Triggers
OK, so we’re all familiar with triggers now, right? You have seen that using a trigger you can log a change to a table in a special log file, or we can create a related record in another table. But all of these events happen after the action that triggers the trigger has completed. What…
Variables And Parameters
Transact SQL (T-SQL) has two main wait of passing data, variables, and parameters. A variable is an object in T-SQL batches and scripts that can old a value. After you define a variable, you can SET the variable or get the value from a variable at any point after the declaration. Useless trivia: You can…
Flow Control
When you want to build more intelligent or more flexible T-SQL scripts, you’re going to need to know how to control the flow of the program. You’ll need the code to be able to make simple decisions on what to do next. Here are the commands you’re going to learn: IF…ELSE BEGIN…END BREAK CONTINUE WHILE…
The Error Severity
Errors can have different levels of severity. Based on this severity, you may wish to handle the error in different ways (see my articles on TRY..CATCH). In order to determine the severity of an error, Microsoft SQL has provided the ERROR_SEVERITY() function. This function takes no argument and returns an integer. Check out this example:…
Triggers Overview
OK, What do you know about triggers? Did you know you can use them to run a bit of T-SQL on data changes? Those would be called Data Manipulation Language (DML) Triggers. You can set those up for tables so that a certain action occurs with each INSERT, UPDATE, or DELETE. You can build as…
Reindex All Tables in a Database
I just wanted to share a quick script that I used to help re-index all the tables in my database. If you have any questions about it, please let me know! USE GO DECLARE @TableName varchar(255) DECLARE TableCursor CURSOR FOR SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ‘base table’ OPEN TableCursor FETCH NEXT FROM TableCursor…
SQL Session – Introducing SQL Server 2008 Performance Data Collector
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….