Viewing 15 posts - 451 through 465 (of 727 total)
This should do the trick for you, if you want things in id order, which it appears you do:
DECLARE
@FirstDate datetime
SET
@FirstDate = (SELECT Min(dtDate) FROM DateTest)
SELECT
dtDate = curr.dtDate
,AccumulativeTime = Datediff(day, @FirstDate, curr.dtDate)
,DailyTime = Datediff(day, IsNull(prev.dtDate,...
May 9, 2007 at 11:46 am
May 9, 2007 at 9:53 am
Have you checked what SQLGetDiagRec (or SQLGetDiagField with SQL_DIAG_SS_SEVERITY) returns for you?
May 9, 2007 at 9:49 am
I used to put my commas at the end of the line, but there are enough benefits for me, however small, that it was worth it for me to force...
May 8, 2007 at 12:39 pm
David, it also works great in the ORDER BY clause, where you can handle some offbeat requirements. For instance, using the same Northwind table from above, let's say you want...
April 20, 2007 at 12:57 pm
Prakash, Isnumeric (the T-SQL version) has always been wonky, and many of us have written customized routines to deal with our specific issues because of that. You'll likely find a...
April 20, 2007 at 12:50 pm
Actually, you can, just not in the manner that the original poster did it in. For an example (using Northwind):
SELECT
*
FROM
Customers
WHERE
City = Case Country WHEN 'Germany' THEN 'Berlin' ELSE 'London' END
In...
April 20, 2007 at 11:26 am
It seems that "\" has some strange (and undocumented) characteristic in 2005. It seems to turn it into a float or numeric.
Try:
SELECT 1
and
SELECT \1
in a query window, and you'll see what...
April 20, 2007 at 11:01 am
Timothy, Christi straightened out the syntax, but the thing to remember is that SQL Server doesn't have an "IF/THEN/ELSE", it's just "IF/ELSE". While not absolutely necessary when only a single...
April 19, 2007 at 2:17 pm
There used to be a problem where ADO would take Null parameters from the code and turn them into empty strings. I have no clue if it still is the...
April 19, 2007 at 12:23 pm
Schedule a job and let SQL Server Agent do the work for you. The account that Agent runs under will need to be able to see the folder.
April 19, 2007 at 12:19 pm
This shows several different ways to check for the existence of a file. Note that the last one (xp_fileexists) is undocumented, and therefore unsupported. That's not to say that we don't...
April 19, 2007 at 12:15 pm
Denby, to put apostrophes in strings, you "escape" them by doubling them up.
Try:
in ('St. Ann''s')
April 19, 2007 at 11:45 am
Can you give us more information, such as where the proc is used, its name (sometimes helpful), the rest of the proc, what the purpose of jc_xxxxonline is, etc?
I can...
April 19, 2007 at 8:57 am
No clue if this is your only problem, but one thing at a time. You have the statement "EXEC @SQL1" in at least one place in that code, without parentheses...
April 19, 2007 at 5:21 am
Viewing 15 posts - 451 through 465 (of 727 total)