Viewing 15 posts - 2,941 through 2,955 (of 3,606 total)
If it is your application that is submitting the SQL then why not have a simple If statement in your code so that when category is not zero then the...
November 26, 2004 at 4:12 am
It won't work in Enterprise Manager but it will in SQL Query Analyser.
November 26, 2004 at 3:46 am
If you are doing it within a stored procedure then it is easy, however if you want to do it as a simple query then try
SELECT *
FROM dbo.Categories
WHERE CategoryId =...
November 26, 2004 at 2:25 am
SELECT SUM(CASE table1.ID1 WHEN NULL THEN 1 ELSE 0 END) AS counter, table2.ID2, table2.ID3 FROM
table2 LEFT JOIN table1
ON
table2.ID2 = table1.ID2
AND
table2.ID3 = table1.ID3
GROUP BY table2.ID2, table2.ID3
November 25, 2004 at 10:09 am
Is it possible that the subquery is doing a dirty read?
There are no indices on SysProcesses and therefore there is nothing in particular to prevent there being multiple entires within...
November 25, 2004 at 10:01 am
If you can do it using a single query then why bother with a cursor?
SQL Server is optimised for set based operations. I tend to view cursors as an option...
November 25, 2004 at 9:52 am
A situation where I use dynamic SQL is in an "advanced search" type query where there are a large number of optional parameters.
Even then I use a stored procedure to...
November 22, 2004 at 5:02 am
Point 1
If you are a one man band working on small projects then the VB/Access route can be the fastest way to go.
If you are working in teams on larger...
November 19, 2004 at 9:12 am
Nancy,
You are really doing research as a script writer for Dilbert column aren't you
November 19, 2004 at 1:31 am
So the archive always contains a log of the changes that have been made to a record?
The trigger method does mean that the archiving is done at the database level...
November 18, 2004 at 7:28 am
In general I would keep SQL within stored procedures for umpteen billion reasons that have been discussed on this site.
November 18, 2004 at 7:22 am
Without testing this I cannot say if my code below will be bug free but the first three queries simply don't need a cursor.
Your cursor simply selects all users for...
November 18, 2004 at 2:05 am
I've found that using string functions in WHERE clauses has a higher performance penalty than using LIKE with wildcards.
November 12, 2004 at 1:49 am
I'm not sure that I agree with non-maths numbers stored in text.
I would say that the rule of thumb would be that if a numerical value has to be displayed,...
November 10, 2004 at 5:55 am
The other thing to watch out for is the way in which SQL stores dates.
For example, the default SQL Server install gives you dates in US format Month/Day/Year.
In Britain we...
November 10, 2004 at 2:51 am
Viewing 15 posts - 2,941 through 2,955 (of 3,606 total)