Viewing 15 posts - 526 through 540 (of 1,347 total)
>>Is WHERE EXISTS(...) more efficient than this?
Depends on indexing and cardinality of the data.
What is an INNER JOIN going to do in this context if there are 2 or more...
February 28, 2006 at 1:46 pm
If you have the name of a SQL object represented as data in another SQL table, then you have no choice but to use dynamic SQL to use that object...
February 28, 2006 at 1:16 pm
Typo on my part, I typed a column name instead of the tablename:
DELETE FROM tblARData As ar
WHERE EXISTS (
SELECT *
FROM tblARDataTemp As t
WHERE t.Site = ar.Site
)
EXISTS will...
February 28, 2006 at 12:55 pm
Why do you need a UDF for this ?
To incorporate a table/view's record count in another query, just CROSS JOIN to the 'SELECT COUNT(*) ...' as a derived table.
February 28, 2006 at 12:06 pm
If your intention is to make the views "temporary", that exist only for the duration of the process, then use derived tables instead of views.
The issue is that SQL batches are parsed,...
February 28, 2006 at 11:33 am
Sorry, let me rephrase that:
>>While @mySortorder = @nOrder and @@Fetch_Status =0
You have an outer loop based on @@Fetch_Status =0 but your Fetch is inside another conditional statement.
What happens if @mySortorder...
February 27, 2006 at 2:01 pm
>>While @@Fetch_Status =0 /* keep fetching rows until their aren't anymore to fetch */
You aren't doing anything inside the loop to change @@Fetch_Status. Therefore infinite loop. Need a Fetch within...
February 27, 2006 at 12:43 pm
LEFT OUTER JOIN
February 23, 2006 at 12:27 pm
Note, this was undocumented behaviour in SQL2000 and shouldn't have been relied on. It has been broken in SQL2005. See the last sections of this link on SQL2005 view behaviour...
February 23, 2006 at 11:37 am
>>Why would we use SELECT TOP 100 PERCENT in a SQL Server 2000 query
The most common use I've seen for this is to implement an unsupported relational DB...
February 23, 2006 at 11:31 am
Use CASE ... WHEN to translate a zero divisor to a zero output ...
CASE
WHEN IsNull(CountEnqByUser,0) = 0 THEN 0
ELSE
CAST(IsNull(MonthlyBookings,0) AS DECIMAL(18,2))
/
CAST(IsNull(CountEnqByUser,0) AS DECIMAL(18,2))
END
February 23, 2006 at 11:20 am
CASE WHEN fieldname3 IS NULL THEN 'False' ELSE 'True' END As fieldvalue
February 23, 2006 at 9:59 am
Use of TOP 100 PERCENT in conjunction with ORDER BY is and always was a hack to try and implement ordering in a view. A view is a virtual table, with no...
February 23, 2006 at 9:34 am
You need dynamic SQL for that. But that isn't the real problem.
Do you have control over the design of this table ? If yes, you should consider normalizing it and...
February 22, 2006 at 4:18 pm
>>How can I ensure all records are retrieved even where the results are a row of zeroes
Use LEFT JOIN instead of INNER JOIN. Since LEFT JOIN will return a...
February 22, 2006 at 4:09 pm
Viewing 15 posts - 526 through 540 (of 1,347 total)