Viewing 15 posts - 2,941 through 2,955 (of 7,614 total)
February 22, 2019 at 10:39 am
As in your original method, you don't need to calc everyone's age, just check the correct date range. Like this:
WHERE Birthdate >= DATEADD(DAY, 1, DATEADD(YEAR,...
February 22, 2019 at 9:03 am
Second process uses read committed, thus uses an S-Lock on all the read records, and releases it when having finished the statement.
No. Actually, in RC level, the...
February 22, 2019 at 8:22 am
You can, but you shouldn't. If you're creating only one index on a temp table, make it a clustered index not a non-clus index; the key columns don't have to...
February 21, 2019 at 10:55 am
Don't sort the query, sort the result table instead, which is more useful anyway. Even if sort the query, you will still have to sort again when reading from the...
February 21, 2019 at 10:47 am
You should cluster the staging table on the DM_KEY_HASH also, assuming you can compute the hash key as the row is being INSERTed into the staging table. SQL is having to...
February 20, 2019 at 12:42 pm
When you create a FK constraint, you can specify whether the key can be NULL or not. If the creating code says it can't be set to NULL -- either...
February 20, 2019 at 12:00 pm
If @value is a single value -- and it seems like it would have to be only a single value -- then wouldn't it be simpler and more efficient to...
February 20, 2019 at 11:21 am
February 18, 2019 at 1:52 pm
February 18, 2019 at 10:31 am
February 18, 2019 at 8:18 am
Pass the RAND value in. And, for efficiency, get rid of the local variables in the function.
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
GO
CREATE function...
February 18, 2019 at 8:12 am
You might want to test for lower case chars before doing the UPDATE, using any case-sensitive collation:
UPDATE CONTACT
SET COUNTRY = UPPER(COUNTRY)
WHERE COUNTRY...
February 15, 2019 at 9:04 am
You can also get that if you don't include the schema name when referencing tables. For example:
SELECT ...
FROM table1
SQL will often generate a separate plan...
February 14, 2019 at 1:43 pm
Viewing 15 posts - 2,941 through 2,955 (of 7,614 total)