Site: http://sqlblog.com/blogs/andrew_kelly/default.aspx Link: http://sqlblog.com/blogs/andrew_kelly/rss.aspx
by Andrew Kelly via Andrew Kelly on 6/26/2009 4:07:00 PM
I just had a situation in which we are automating the comparing of databases and I came across a bunch of Defaults that were never explicitly named. This causes them to get a new name each time you create them and makes it much more difficult to write...(read more) ...
[ read more ]
by Andrew Kelly via Andrew Kelly on 6/5/2009 11:53:15 PM
I find that many people don’t realize since SQL Server 2005 that you have the ability to execute SQLCMD commands or scripts directly in the Query Editor but it can come in handy at times. Even I don’t use it that as much as I should and I am aware of it:). One of the things I find it most useful for is during demos at presentations when I want to invoke an OS level command without having to use xp_cmdshell or opening a DOS window. For instance once you have enabled SQLCMD mode in the ...
by Andrew Kelly via Andrew Kelly on 4/14/2009 11:19:02 PM
I will be the 1st to admit that I am no Itzik Ben-Gan when it comes to writing complex SQL statements and I wonder at times how people come up with some of the Selects that I see. Sometimes they are so complex or convoluted that I simply have a hard time figuring out the intent or the logic behind them. But as a performance consultant I pretty much find myself looking at these on a regular basis when they end up scanning very large tables or indexes. I find that many developers have a hard ...
by Andrew Kelly via Andrew Kelly on 4/10/2009 11:08:11 PM
As a SQL Server consultant I get to see a lot of different sets of code written by all sorts of database developers from all over the world. And I have to say that one thing that is clear is most developers make abundant use of the NOLOCK query hint or the READ UNCOMMITTED isolation level. Now don’t get me wrong, I am NOT trying to say this is bad and people should not do that. There is a place and time for all the features and hints SQL Server has to offer and these can be quite handy indeed. T ...
by Andrew Kelly via Andrew Kelly on 12/20/2008 1:12:43 PM
The way in which SQL Server has treated Time has been a very misunderstood subject for as long as I can remember. The largest part of that was the fact that SQL Server was only accurate to 3.33ms. I would like to point you to an excellent article on this and other details surrounding Datetime in SQL Server by Tibor Karaszi found here: http://www.karaszi.com/SQLServer/info_datetime.asp Well now with the release of SP3 for SQL Server 2005 (and of course SQL 2008 as well) SQL Server no ...
by Andrew Kelly via Andrew Kelly on 11/13/2008 11:08:11 PM
The RML utilities from PSS have just been updated to include support for SQL Server 2008 along with various enhancement and bug fixes. If you don't know what the RML utilities are I suggest you have a look at this link and take a few minutes to download them and play around some. http://blogs.msdn.com/psssql/archive/2008/11/12/cumulative-update-1-to-the-rml-utilities-for-microsoft-sql-server-released.aspx Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | li ...
by Andrew Kelly via Andrew Kelly on 3/1/2008 4:19:19 PM
In my last blog post: http://sqlblog.com/blogs/andrew_kelly/archive/2008/02/27/when-getdate-is-not-a-constant.aspx I mentioned that I ran across a situation in which GETDATE() used in a SELECT statement occasionally returned more than 1 value for the result set. That sparked quite a debate amongst SQL Server programmers who belonged to one of two camps in how they believed this really should behave. For instance if you run the following SQL statement: ...
by Andrew Kelly via Andrew Kelly on 2/27/2008 3:53:00 PM
A short while ago I was collecting wait stat information at a client and ran across a very peculiar situation that I would like to share. Let me start by saying that for years I have coded with the understanding that when you include a system function in the SELECT list of a TSQL statement the function was evaluated once at the beginning and that same value was used for each row returned. I am talking about a statement such as this: &nb ...
by Andrew Kelly via Andrew Kelly on 1/13/2008 3:25:13 PM
One of the most common trends that I see related to performance & scalability with SQL Server is a poorly configured or implemented storage subsystem. There is a ton of information out there on this subject but in my opinion that is part of the problem. Too much data is not always a good thing and there is a lot of misinformation out there as well. I also see a lot of systems that were configured based on the advice someone gave them or they read about ...
by Andrew Kelly via Andrew Kelly on 12/16/2007 1:27:26 AM
I am still amazed at how many of the database applications written today still disregard some basic rules of thumb when it comes to accessing the data. One in particular is the use of COUNT(*) to check to see if there are any rows that match some criteria. The technique of using EXISTS over COUNT(*) has been widely publicized and is in pretty much every best practices document I have come across. So why are database developers still using COUNT(*) instead of EXISTS all over th ...
by Andrew Kelly via Andrew Kelly on 12/15/2007 2:48:06 AM
A short while back I had to buy a new laptop and one of the choices I had to make was whether to run Vista or XP. While that is the subject for a whole different blog post the short answer is I decided to go with Vista Ultimate. I knew a lot of things changed between XP and Vista but it never dawned on me that Perfmon got such a makeover. I don’t mean the real time counter monitoring aspect or what we call the Performance or System Monitor, I am talking about the Counter Logs mode. ...
by Andrew Kelly via Andrew Kelly on 10/29/2007 5:09:00 PM
How many times have you asked for a way to turn off the behavior in SQL Server that logs successful backup messages to the SQL Server Logs and to the Windows Application Event Logs? If you are like most DBA’s probably a lot. I have been asking for this feature for ages. I have sent email to SQLWish, filed on LadyBug and most recently on Connect with never any positive feedback. Well the other day I happened to be on campus in Redmond and was talking to Kevin Farlee (Thanks Kevin) who is a PM on ...
by Andrew Kelly via Andrew Kelly on 9/25/2007 8:25:00 PM
I recently was bitten by some not so obvious behavior with DBCC OPENTRAN() that I would like to share. Basically this command is supposed to show you the oldest open transaction within the specified database or the current one if none is specified. If you run the example below you can see the expected behavior. USE Tempdb ;GOCREATE TABLE [dbo].[T1]([Col1] int NOT NULL, [Col2] char(3) ) ;GOINSERT INTO [dbo].[T1] ([Col1], [Col2]) VALUES (101, 'abc');GOBEGIN TRAN ; UPDATE [ ...
by Andrew Kelly via Andrew Kelly on 9/6/2007 3:22:00 PM
I heard someone state that LINQ (see http://www.sqlmag.com/Article/ArticleID/48759/sql_server_48759.html for details on LINQ) was going to rescue developers from having to know TSQL. Well if that's true then who will rescue us from LINQ? LINQ like so many other technologies that have come about makes certain things easier by abstracting the underlying objects or code and providing a "simpler" interface. That sounds great but as we have learned over and over again this comes at a price ...
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.