April 2008 Blog Posts
Ocassionally, I see a question in the MSDN Forums where someone wants to know how to retrieve a list of column information for a table using only T-SQL.
Although there are several ways in which to approach this, I like the following method.
SELECT ORDINAL_POSITION ,COLUMN_NAME ,DATA_TYPE ,CHARACTER_MAXIMUM_LENGTH ,IS_NULLABLE ,COLUMN_DEFAULTFROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Product' ORDER BY ORDINAL_POSITION ASC;
Do you have a different way of doing this that you'd like to share? If so, feel free to leave a comment,...
I hope that everyone that works with Microsoft SQL Server is aware of the MSDN SQL Server Forums. If not, you should really go check them out. They're a great resource when you're staring at a tough SQL Server-related problem.
Now, some of the Moderators, Answerers, and MVPs have gotten together to create a new resource to supplement the Forums; it's called SQLExamples. We just started it a few weeks ago so it's still very much in its infancy and somewhat sparsely populated. But it's growing quickly. I think it'll be a boon for SQL Server professionals the world over...
The most common way to create a SQL Server Notification Services instance is to craft a valid and well-formed XML document for the Instance Configuration File and the Application Definition File. These two files are know as the ICF and ADF respectively and they essentially form the source code for the notification instance and application. As such, you should store them securely in the versioning repository of your choice - Visual Source Safe, Subversion, what have you.
If however, you find that you've lost the XML source files, or perhaps you've altered them without first making a backup copy to...
At the 2007 PASS Community Summit in Denver, a keynote speaker made a passing comment about how there has not been a security bulletin released for SQL Server in over three years! I forget which speaker made the statement, but I found it utterly amazing. Not a single security bulletin released in over three years! Could this be true?
If you've worked with SQL Server for a while, you'll undoubtedly remember SQL Slammer, the worm that hit thousands of SQL Servers around the world in 2003. It's effects were nothing short of devastating for many companies.
I made a mental...
Thanks to all 60+ people who braved the flood warnings in Nashville to attend the SQL Server User Group meeting earlier today. I hope you found it to be worth your while. Some of your questions and comments at the end gave some some great ideas for future presentations. Thanks!
And thanks to Quest and RHT for sponsoring our meeting meeting today. If your in the Nashville areas, I'd encourage you to come on out for our next meeting, most likely sometime in May.
As promised, here's a link to the presentation materials, both the PowerPoint presentation and the demonstration code.
Cheers!...
If you've used SQL Server for a while, you're probably familiar with the @@version function. Selecting the function in a query window produces the following results on my system.
From this, you can quickly determine that I'm running SQL Server 2005 Developer Edition version 9.00.3054.00 on an Intel X86 processor. It may also appear that I've installed SQL Server SP2, however that is rather misleading. The "Service Pack 2" text in the above image refers to the operating system, not the SQL Server system.
To determine SQL Server's service pack level, use the built-in SERVERPROPERTY function with appropriate parameters -...