Viewing 15 posts - 181 through 195 (of 921 total)
> It will also do this if you change the query to NOT EXISTS.
use pubs
select *
from authors
where state not in
(select state
from publishers)
select *
from authors...
January 23, 2004 at 1:06 pm
Use multiple output variables, each with a piece of the query being built, and then concatenate those variables in the EXEC() in the calling proc.
January 23, 2004 at 12:38 pm
It wouldn't be too difficult to use DMO to script out the procedures (ORing SQLDMOScript_Drops), use your language to replace the column names, and then drop and recreate the relevant...
January 23, 2004 at 11:46 am
From BOL:
Use the string concatenation operator (+) to create large strings for dynamic execution. Each string expression can be a mixture of Unicode and non-Unicode data types.
Although each [N] 'tsql_string'...
January 23, 2004 at 10:43 am
Read-ahead is used when the pages should be contiguous (e.g. indexes and scans). Pages not in the read-ahead range will not be cached, even if they're in the read extents. ...
January 23, 2004 at 9:12 am
If the YYYYMMDD value is a string, it will be implicitly converted to a date type. If you instead use it as an integer, first convert the integer to a...
January 23, 2004 at 8:56 am
Use 64K for the file system cluster size. That helps performance even with OLTP as, even though disk I/O granularity is indeed 8K blocks, read-aheads use 64K extents.
January 23, 2004 at 8:50 am
If you mean a connection is timing out, that's set on the client side, not the server side.
January 23, 2004 at 8:11 am
It's not a bug, it's what SQL is supposed to do. Remember that NULL means "unknown". This is a major reason to avoid using NOT IN with subqueries. There was...
January 23, 2004 at 8:03 am
To get two values from one UDF, return a table:
CREATE FUNCTION dbo.u_DaysAndPayDate(@fromdate datetime)
RETURNS @t TABLE(Days tinyint, PayDate datetime) BEGIN
DECLARE @d tinyint
SET @d = 14 - DATEDIFF(d,'20031227',@fromdate) % 14
SET @d =...
January 23, 2004 at 7:55 am
> So there may be a need to check input and update for that column (maybe trigger or other scheduled process).
How about just...
January 23, 2004 at 6:53 am
Not entirely clear on what you want; perhaps:
SELECT a, SUM(CASE b WHEN 14 THEN 1 ELSE 0 END) b14s, SUM(CASE b WHEN 5 THEN 1 ELSE 0 END) b5s
FROM Table
WHERE...
January 23, 2004 at 5:30 am
If there is a non-zero (i.e. non-midnight) time component to the date values, then your query will not find them. Try something like:
WHERE InsertDate >= '20040122' AND InsertDate < '20040123'
January 22, 2004 at 3:28 pm
Viewing 15 posts - 181 through 195 (of 921 total)