SQL Feeds - All your SQL feeds in one place.

Sponsors

Feed: Gregg Stark on SQL Server

Site: http://sqladvice.com/blogs/gstark/default.aspx Link: http://feeds.feedburner.com/GreggStarkOnSqlServer

Wednesday, February 13, 2008

Determine SQL Server Version

by gstark via Gregg Stark on SQL Server on 2/13/2008 1:43:18 PM

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('productlevel')) + ' - ' + CONVERT(varchar(100),SERVERPROPERTY('edition')) Share this post: email it! | bookmark it! | digg it! | reddit! | ...

[ read more ]

Determine SQL Server Version

by gstark via Gregg Stark on SQL Server on 2/13/2008 1:43:18 PM

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('productlevel')) + ' - ' + CONVERT(varchar(100),SERVERPROPERTY('edition')) Share this post: email it! | bookmark it! | digg it! | reddit! | ...

[ read more ]

Determine SQL Server Version

by gstark via Gregg Stark on SQL Server on 2/13/2008 1:43:18 PM

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('productlevel')) + ' - ' + CONVERT(varchar(100),SERVERPROPERTY('edition')) Share this post: email it! | bookmark it! | digg it! | reddit! | ...

[ read more ]

Tuesday, February 12, 2008

Arithabort Option Affects Stored Procedure Performance

by gstark via Gregg Stark on SQL Server on 2/12/2008 9:34:50 PM

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 it come back in a second.  So I try again from the application, and it takes well over a minute.  After hunting around and pulling out my hair as to why this would be I discovered that the connection from the application has the A ...

[ read more ]

Arithabort Option Affects Stored Procedure Performance

by gstark via Gregg Stark on SQL Server on 2/12/2008 9:34:50 PM

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 it come back in a second.  So I try again from the application, and it takes well over a minute.  After hunting around and pulling out my hair as to why this would be I discovered that the connection from the application has the A ...

[ read more ]

Arithabort Option Affects Stored Procedure Performance

by gstark via Gregg Stark on SQL Server on 2/12/2008 9:34:50 PM

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 it come back in a second.  So I try again from the application, and it takes well over a minute.  After hunting around and pulling out my hair as to why this would be I discovered that the connection from the application has the A ...

[ read more ]

Monday, November 19, 2007

SQL Server 2008 November CTP Released

by gstark via Gregg Stark on SQL Server on 11/19/2007 5:45:46 PM

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 here.  For a list of all new features included in this CTP, you can go here. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it! ...

[ read more ]

Friday, November 16, 2007

Increase Animation Speed in SQL Server Management Studio

by gstark via Gregg Stark on SQL Server on 11/16/2007 2:34:51 PM

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 in knowing other configuration settings you can change in that file as well.  Let me know if you know of any others. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it! ...

[ read more ]

Increase Animation Speed in SQL Server Management Studio

by gstark via Gregg Stark on SQL Server on 11/16/2007 2:34:51 PM

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 in knowing other configuration settings you can change in that file as well.  Let me know if you know of any others. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it! ...

[ read more ]

Increase Animation Speed in SQL Server Management Studio

by gstark via Gregg Stark on SQL Server on 11/16/2007 2:34:51 PM

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 in knowing other configuration settings you can change in that file as well.  Let me know if you know of any others. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it! ...

[ read more ]

Tuesday, October 16, 2007

Change Login's Default Database in SQL Server

by gstark via Gregg Stark on SQL Server on 10/16/2007 12:18:33 PM

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 be able to do anything through the object explorer as it always defaults to your default database.  The sql below will solve your problems. alter login MyLogin with default_database = master If you need to alter a login that is using ...

[ read more ]

Change Login's Default Database in SQL Server

by gstark via Gregg Stark on SQL Server on 10/16/2007 12:18:33 PM

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 be able to do anything through the object explorer as it always defaults to your default database.  The sql below will solve your problems. alter login MyLogin with default_database = master If you need to alter a login that is using ...

[ read more ]

Wednesday, October 10, 2007

Retrieve Index Details and Columns in Sql Server 2005

by gstark via Gregg Stark on SQL Server on 10/10/2007 1:49:05 PM

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 and hit Alt-F1.  If you aren't familiar with keyboard shortcuts in SSMS see my post here.  While this does give you the indexes that are on the table and it will show you the equality and inequality columns on the index, it won't ...

[ read more ]

Retrieve Index Details and Columns in Sql Server 2005

by gstark via Gregg Stark on SQL Server on 10/10/2007 1:49:05 PM

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 and hit Alt-F1.  If you aren't familiar with keyboard shortcuts in SSMS see my post here.  While this does give you the indexes that are on the table and it will show you the equality and inequality columns on the index, it won't ...

[ read more ]

Retrieve Index Details and Columns in Sql Server 2005

by gstark via Gregg Stark on SQL Server on 10/10/2007 1:49:05 PM

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 and hit Alt-F1.  If you aren't familiar with keyboard shortcuts in SSMS see my post here.  While this does give you the indexes that are on the table and it will show you the equality and inequality columns on the index, it won't ...

[ read more ]

Thursday, September 27, 2007

Archive and Compress Data from SQL Server

by gstark via Gregg Stark on SQL Server on 9/27/2007 12:11:43 PM

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 want to put the data into another table so I decided it might be nice to dump the data to a file and then zip it up into a zip file per day.  This way if I ever need the data again I can easily bcp the data back into the original ...

[ read more ]

Archive and Compress Data from SQL Server

by gstark via Gregg Stark on SQL Server on 9/27/2007 12:11:43 PM

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 want to put the data into another table so I decided it might be nice to dump the data to a file and then zip it up into a zip file per day.  This way if I ever need the data again I can easily bcp the data back into the original ...

[ read more ]

Archive and Compress Data from SQL Server

by gstark via Gregg Stark on SQL Server on 9/27/2007 12:11:43 PM

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 want to put the data into another table so I decided it might be nice to dump the data to a file and then zip it up into a zip file per day.  This way if I ever need the data again I can easily bcp the data back into the original ...

[ read more ]

Enable XP_CMDSHELL in SQL Server 2005

by gstark via Gregg Stark on SQL Server on 9/27/2007 11:54:36 AM

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 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'xp_cmdshell', '1' RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'show advanced options', 0 RECONFIGURE WITH OVERRIDE GO Share this po ...

[ read more ]

Enable XP_CMDSHELL in SQL Server 2005

by gstark via Gregg Stark on SQL Server on 9/27/2007 11:54:36 AM

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 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'xp_cmdshell', '1' RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'show advanced options', 0 RECONFIGURE WITH OVERRIDE GO Share this po ...

[ read more ]

Enable XP_CMDSHELL in SQL Server 2005

by gstark via Gregg Stark on SQL Server on 9/27/2007 11:54:36 AM

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 'show advanced options', 1 RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'xp_cmdshell', '1' RECONFIGURE WITH OVERRIDE GO EXECUTE sp_configure 'show advanced options', 0 RECONFIGURE WITH OVERRIDE GO Share this po ...

[ read more ]

Wednesday, September 19, 2007

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

by gstark via Gregg Stark on SQL Server on 9/19/2007 1:40:30 PM

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 an easy way to do this using a cursor and a numbers table and he told me to blog it.  This is an excellent use of a numbers table which if you don't have one of these in your database, you should create ...

[ read more ]

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

by gstark via Gregg Stark on SQL Server on 9/19/2007 1:40:30 PM

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 an easy way to do this using a cursor and a numbers table and he told me to blog it.  This is an excellent use of a numbers table which if you don't have one of these in your database, you should create ...

[ read more ]

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

by gstark via Gregg Stark on SQL Server on 9/19/2007 1:40:30 PM

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 an easy way to do this using a cursor and a numbers table and he told me to blog it.  This is an excellent use of a numbers table which if you don't have one of these in your database, you should create ...

[ read more ]

Friday, September 14, 2007

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

by gstark via Gregg Stark on SQL Server on 9/14/2007 2:01:01 PM

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.  However if you get a ton of Sql emailed to you it can be quite annoying.  I finally found a way to quickly get rid of them.  Simply bring up the find and replace window and change the find to use Regular Expressions.& ...

[ read more ]

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

by gstark via Gregg Stark on SQL Server on 9/14/2007 2:01:01 PM

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.  However if you get a ton of Sql emailed to you it can be quite annoying.  I finally found a way to quickly get rid of them.  Simply bring up the find and replace window and change the find to use Regular Expressions.& ...

[ read more ]

Thursday, September 06, 2007

Retrieve File Contents using SQL Server 2005 SQL CLR

by gstark via Gregg Stark on SQL Server on 9/6/2007 6:25:59 PM

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 directory.  I did have a database table that contained all the file names that were still valid.  I was wishing for a way to simply join from that table to the file system and load all those files.  I certainly could h ...

[ read more ]

Retrieve File Contents using SQL Server 2005 SQL CLR

by gstark via Gregg Stark on SQL Server on 9/6/2007 6:25:59 PM

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 directory.  I did have a database table that contained all the file names that were still valid.  I was wishing for a way to simply join from that table to the file system and load all those files.  I certainly could h ...

[ read more ]

Monday, August 20, 2007

Move TempDB Sql Server 2005

by gstark via Gregg Stark on SQL Server on 8/20/2007 9:19:14 PM

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 followed by an alter statement to point the database at the new location.  Well of course this didn't work because the tempdb files are in use.  After thinking about it I just decided to try to alter the master database and point ...

[ read more ]

Move TempDB Sql Server 2005

by gstark via Gregg Stark on SQL Server on 8/20/2007 9:19:14 PM

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 followed by an alter statement to point the database at the new location.  Well of course this didn't work because the tempdb files are in use.  After thinking about it I just decided to try to alter the master database and point ...

[ read more ]

Tuesday, August 07, 2007

Recover Suspect SQL Server Database

by gstark via Gregg Stark on SQL Server on 8/7/2007 2:37:57 PM

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 your first choice should be to restore a backup and the transaction logs since the last backup.  However if you don't have this (as I never do on my SQL Server Express instances) this is usually pretty simple to take care of by put ...

[ read more ]

Recover Suspect SQL Server Database

by gstark via Gregg Stark on SQL Server on 8/7/2007 2:37:57 PM

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 your first choice should be to restore a backup and the transaction logs since the last backup.  However if you don't have this (as I never do on my SQL Server Express instances) this is usually pretty simple to take care of by put ...

[ read more ]

Recover Suspect SQL Server Database

by gstark via Gregg Stark on SQL Server on 8/7/2007 2:37:57 PM

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 your first choice should be to restore a backup and the transaction logs since the last backup.  However if you don't have this (as I never do on my SQL Server Express instances) this is usually pretty simple to take care of by put ...

[ read more ]

Friday, August 03, 2007

SQL Server Management Studio Query Shortcuts

by gstark via Gregg Stark on SQL Server on 8/3/2007 6:32:58 PM

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 playing around with them I really didn't realize what all was possible.  Basically you just highlight some text in query analyzer and then hit the hotkey and it passes the highlighted text into whatever the code is behdind the ...

[ read more ]

SQL Server Management Studio Query Shortcuts

by gstark via Gregg Stark on SQL Server on 8/3/2007 6:32:58 PM

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 playing around with them I really didn't realize what all was possible.  Basically you just highlight some text in query analyzer and then hit the hotkey and it passes the highlighted text into whatever the code is behdind the ...

[ read more ]

SQL Server Management Studio Query Shortcuts

by gstark via Gregg Stark on SQL Server on 8/3/2007 6:32:58 PM

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 playing around with them I really didn't realize what all was possible.  Basically you just highlight some text in query analyzer and then hit the hotkey and it passes the highlighted text into whatever the code is behdind the ...

[ read more ]

Legal Note

The content of the postings is owned by the respective author. SQL Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on SQL Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us