Viewing 15 posts - 7,591 through 7,605 (of 7,608 total)
The method below creates and loads a table data type to hold the desired datetime ranges. The defaults are as you specified -- from 17:00 the previous day to 17:00...
June 28, 2006 at 12:32 pm
If you want to check the identity column specifically, you can use the reserved name IDENTITYCOL, which will always refer to the identity column of any table:
SELECT * FROM tableName
WHERE...
June 28, 2006 at 12:06 pm
What about the overhead of the comments themselves? This if often overlooked. It's my understanding that SQL does load comments (even full-line/multi-line comments) into the proc cache. So lots of...
June 13, 2006 at 10:26 am
One of my concerns with a sequence table, aside from the additional I/O and other overhead, is that you cannot then easily insert multiple invoices in one statement.
If, for example,...
May 17, 2006 at 10:21 am
>> "SET IDENTITY_INSERT ON" would be needed for prior year, with logic similar to above, but hopefully that would be relatively rare. <<
In fact, in most systems, especially dealing with...
May 17, 2006 at 8:59 am
Yes. Or possibly even a single identity column that was re-seeded each year to yy00000[0]; the "-" could be added prior to display just for the "visual effect" for the user. ...
May 17, 2006 at 8:21 am
Don't see any need for the "IF" at the start of the function. I wrote an almost identical function for this purpose but with just the WHILE.
February 6, 2006 at 4:00 pm
To check for existence of a column, don't think you need to do a system table query at all, just use a built-in SQL function:
IF COL_LENGTH ('tableName', 'columnName') IS NULL
--column...
December 21, 2005 at 8:50 am
DECLARE @v-2 VARCHAR(200)
SET @v-2 = 'http://www.google.com/intl/en/images/logo.gif'
SELECT SUBSTRING(@v, CHARINDEX('//', @v-2) + 2, CHARINDEX('/', @v-2, CHARINDEX('//', @v-2) + 2) - (CHARINDEX('//', @v-2) + 2))
--That will work for *any* string prior to the...
December 21, 2005 at 8:44 am
Something like this should perform *much* better ![]()
SELECT a.procid, b.[ClientName] AS CName, b.[CompanyName], b.[CustRefNum] AS CRef,
b.[JobNumber] AS JNumber, --...,
b.[County] AS RCounty
FROM ...
June 17, 2005 at 8:12 am
When you run code #1, it actually does seem to work, although I'm not exactly sure why it would. Since punctuation falls within that range, it really shouldn't. You can run...
June 2, 2005 at 9:29 am
I agree with Tim 100%. The code suggested would not necessarily work and presumably would be less efficient than a not check. Very frequently when the qod is a T-SQL...
June 2, 2005 at 8:10 am
I assumed that too and got it right, but why not make the question match the answer:
Bill needs to show the day of the week for today's date on a...
June 4, 2004 at 8:14 am
Silly premise for the question, since it would require that the highest sales always occur on the current day. Just don't try rerunning the report
June 4, 2004 at 8:03 am
I think you can remove leading tab(s) directly within a SELECT, without any CASE or loop, for example:
DECLARE @tabPattern VARCHAR(8)
SET @tabPattern = '%[^' + CHAR(9) + ']%'
DECLARE @tabRemove VARCHAR(200)
SET @tabremove...
May 7, 2004 at 12:55 pm
Viewing 15 posts - 7,591 through 7,605 (of 7,608 total)