Using the DATEDIFF function to select rows
I keep seeing people using CONVERT to convert a date to a varchar in order to do comparison or search queries. I haven't seen a situation yet where DATEDIFF can't be used.
2002-08-29
1,239 reads
I keep seeing people using CONVERT to convert a date to a varchar in order to do comparison or search queries. I haven't seen a situation yet where DATEDIFF can't be used.
2002-08-29
1,239 reads
Big transactions cause the Tlog to grow.When you do a clean of a large table, the delete statement can cause a very long transactionSometimes it's necessary to prevent this.So we divide one big delete into several little ones.A table with call centre data gets +/- 1-mlj records a day. Every day we run a script […]
2002-08-27
827 reads
Assuming we have the following table (that stores hierarchical data) :CREATE TABLE [staff] ( [employee] [int] NOT NULL , [employee_name] [varchar] (10) NULL , [supervisor] [int] NULL , PRIMARY KEY CLUSTERED ( [employee] ) ON [PRIMARY] , FOREIGN KEY ( [supervisor] ) REFERENCES [staff] ( [employee] ))I ‘ll built a […]
2002-08-23
845 reads
This article shows you how to design the storage for email addresses, how to validate email addresses, how to retrieve demographic information from email addresses efficiently, using computed columns and indexes. It also covers the security aspect of dealing with email addresses.
2002-08-01
1,340 reads
2002-07-19
580 reads
a Basic example of how to manipulate an IDENTITY COLUMN AN HOW TO STOP the automatic counting using SET IDETNTITY_INSERT
2002-07-18
711 reads
procedure is an extended xp called xp_getNetName to get the computer network identifcation name
2002-07-18
775 reads
THERE is an extended sp called xp_fileexists given a full path to a file Name information is a 3 Bit vector 0/1 if a file doesn't/does exist0/1 is given name is a directory0/1 if the parent directory exists
2002-07-18
1,088 reads
this procedure gets a tableName,X axis column, Y axis column and a Value and draw a Pivot table from the Original Table Script also include an How to Use section
2002-07-15
1,360 reads
This SELECT will give you a summarized report for the options selected for ALL the databases on your SQL Server. It's compatible with versions 7 and 2000.
2002-07-11
656 reads
By Steve Jones
For a number of years, we’ve produced the State of the Database Landscape report,...
By Steve Jones
I coach volleyball and I do a lot of stat stuff on paper. I...
By Steve Jones
dolorblindness – n. the frustration that you’ll never be able to understand another person’s...
Hi! I've been banging my head against the wall for 2 days now trying...
Comments posted to this topic are about the item The Power of Data and...
Comments posted to this topic are about the item What's the Date?
In SQL Server 2025, there is a new function that returns the current date without the time. What is it?
See possible answers