Welcome to SqlAdvice Sign in | Join | Help

Browse by Tags

Determine SQL Server Version

If you need to know the version you are currently running of SQL Server you can easily get it by running the following query. SELECT ' SQL Server ' + CONVERT ( varchar ( 100 ),SERVERPROPERTY( ' productversion ' )) + ' - ' + CONVERT ( varchar ( 100 ),SERVERPROPERTY(
Posted by gstark | 0 Comments

Arithabort Option Affects Stored Procedure Performance

I have noticed that at times I will have a stored procedure start to take an unusual amount of time to complete. In trying to debug this I grab the SQL that is being called from the application and paste it into SQL Server Management Studio only to have
Posted by gstark | 7 Comments

Off Topic: Strange VMWare Contest Rules

This has to go down as one of the strangest requirements for a contest ever. Check out the official rules for VMWare's contest to win an iPhone. In section 4 "Selection of Winner" it states "Canadian residents, if selected as a winner, must correctly
Posted by gstark | 3 Comments

SQL Server 2008 November CTP Released

Microsoft has released the latest SQL Server 2008 CTP. This release has tons of new features including Intellisense for SSMS. This one also includes the spatial datatypes which I know a lot of people have been waiting for. You can go get the newest CTP
Posted by gstark | 2 Comments

Increase Animation Speed in SQL Server Management Studio

I set all my tool bars to be fly outs and it is fairly annoying how slow the animation is. I found this link and decided to try it out and it works great! http://blogs.msdn.com/euanga/archive/2007/10/01/ssms-window-animation-speed.aspx I would be interested

Change Login's Default Database in SQL Server

If you have ever dropped a database and found yourself not able to login because your default database no longer exists you know it can be quite annoying. You can still connect through query analyzer by connecting to a different database, but you won't
Posted by gstark | 1 Comments

Retrieve Index Details and Columns in Sql Server 2005

I frequently need to look at what indexes are on a table and I am really not a fan of using object explorer in SSMS as I like to stay in the query window. Typically if I want information about a table I simply highlight the table name in the query window
Posted by gstark | 1 Comments

Archive and Compress Data from SQL Server

I recently blogged about deleting off data from a table by looping through one day at a time. Strangely enough I had a similar need pop up a few days later although this time I wanted to keep the data around just in case I need it later. I really didn't
Posted by gstark | 0 Comments

Enable XP_CMDSHELL in SQL Server 2005

I needed to use xp_cmdshell recently and discovered that it isn't on by default on SQL Server 2005. I had to dig a bit to find out how to enable it. The code is very simple. Figured I would blog it here so I can easily find it next time. EXECUTE sp_configure
Posted by gstark | 1 Comments

Iterate Over a List of Dates using a Numbers table in SQL

Recently I was helping Steve archive off a bunch of data from one of his tables. Unfortunately he didn't have a ton of diskspace to use some of the techniques I normally would. Steve recently posted a solution using powershell to do this. I told him about
Posted by gstark | 5 Comments

Remove Extra Spaces when Pasting from Outlook to Sql Server Management Studio

I seem to have this problem that when I paste sql code from my email into Sql Server Management Studio that it doubles all the line breaks and I have to go and remove them all. Most of the time this isn't a big deal because the Sql is only a couple lines.
Posted by gstark | 1 Comments

Retrieve File Contents using SQL Server 2005 SQL CLR

I recently had a need to load a bunch of pdf files into my database. The problem was that the directory the files were in contained a bunch of other pdf files that I didn't want or that were no longer needed so I couldn't just upload every PDF in the

Move TempDB Sql Server 2005

I recently needed to move the TempDB on my Sql Server so I looked in Books Online and my initial thought based on what it said was that there is no way that will work. Basically it says to find where the files are, and then move them to the new location
Posted by gstark | 3 Comments

Recover Suspect SQL Server Database

Where I work we have about 160 instances of SQL Server Express running on laptops and as you can imagine these database instances tend to become corrupted from time to time. One of the most frequent issues is that a database becomes suspect. Obviously
Posted by gstark | 0 Comments

SQL Server Management Studio Query Shortcuts

I have always hated typing and using the mouse so I always try to find shortcuts and hotkeys for every development environment I am in. Having said that I thought that I would share what I have custom setup for SQL Server Management Studio. Until I started
Posted by gstark | 9 Comments
More Posts Next page »