ASP.NET News from Blogger: Gregg Stark on SQL Server   Get the feed of: Gregg Stark on SQL Server

Total News: 20

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('produ...

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 ...

Arithabort Option Effects 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 ...

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 ...

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/arc...

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 ana...

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...

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 th...

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 ...

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 recent...

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 ...

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 tha...

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 ...

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 freq...

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 ...

SQL Server 2005 Templates

I have found the SQL Server 2005 templates to be extremely useful.  I have created custom templates for creating a new stored procedure, scalar functions, table-value functions and views.  T...

Sql Server Cursor Template

This is a template that I have been using in SQL server for when I do have to write cursors.  Notice that there is only one fetch statement in there which is much slicker than the typical method...

Enable CLR and Unsafe Assemblies SQL Server 2005

Since I can never remember this off the top of my head I figured I would post on my blog.  To enable the use of CLR on SQL Server run the following.... sp_configure 'show advanced options' , '...

Great Article on Dynamic Sql usage with Sql Server 2005

This is probably the best explanation around on the different dynamic Sql approaches and the performance and benefits of each of them.  If you are using Sql Server 2005 basically you sh...

Find Indexes that aren't Used in Sql Server 2005

One of the most important maintenance tasks for a database is making sure you have the right indexes.  Sql Server 2005 makes this a lot easier than in the past by the creation of the dynamic man...

View Other bloggers