Viewing 15 posts - 1,561 through 1,575 (of 7,608 total)
I've always liked the idea of assigning a unique standard alias for every table and always using it. You can add a 1, 2, etc., if you need to use...
May 17, 2021 at 10:47 pm
No, you can miss user(s) of the db that way. Instead, force the db offline; then bring it back online and immediately USE the db yourself and then set it...
May 17, 2021 at 6:32 pm
FROM
dbo.fnGet_NAME] (@processDate) -- This function is hitting a very big table and I do see some missing IDX hints, however, apart from IDX's I wanted to find out more...
May 17, 2021 at 6:26 pm
Hmm, interesting. For the nonclustered index(es)? For a clus index create, I could see delays as SQL would have to sort the entire contents of the table.
What is the 'cost...
May 17, 2021 at 3:00 pm
1. The source is another table in another database and I am using a dataflow task to move it from one table to another. The source is a Stored procedure
There...
May 17, 2021 at 2:51 pm
Best would be a CHECK constraint if that is possible. You wouldn't have to write the code and SQL would guarantee that it gets run and works without error (given,...
May 15, 2021 at 3:32 am
I guess you have to fall back on querying the msdb.dbo.restorehistory table every nn minutes and looking up the details on all newly restored dbs, since the last check nn...
May 14, 2021 at 6:46 pm
Rats! Apparently RESTORE does not trigger a CREATE DATABASE event and there is no RESTORE DATABASE event, at least from what I've found so far.
May 14, 2021 at 6:38 pm
If a RESTORE DATABASE triggers a "CREATE DATABASE" event, and I'm not sure about that although it seems logical, then you could use a DDL trigger to check for the...
May 14, 2021 at 2:58 pm
SELECT t1.ID, t1.Amount, t2.Amount_VLOOKUP
FROM table1 t1
CROSS APPLY (
SELECT CASE
WHEN t1.Amount < t2.col1 THEN 0
...
May 14, 2021 at 2:47 pm
UPDATE yt
SET name = LTRIM(RTRIM(name3))
FROM your_table yt
CROSS APPLY (
SELECT CASE WHEN yt.name LIKE 'ZZZZ%' THEN STUFF(yt.name, 1, 4, '') ELSE yt.name END AS...
May 14, 2021 at 2:45 pm
If the delete of the added user is an actual delete from a table, then use an after delete trigger to remove added users from the main row at the...
May 13, 2021 at 8:55 pm
For my databases, I've adopted the "If it moves, shoot it" philosophy for statistics updpates. In other words, if the RowModCntr is not zero and the stats haven't been...
May 12, 2021 at 8:49 pm
Hi
Thanks for your reply.
Does that mean that I need to run below grant execute SP SQL Script for each SP for user?
GRANT create procedure ON DATABASE::[db name] TO...
May 11, 2021 at 2:53 pm
Is there a way in the same SELECT statement to show different columns without using dynamic SQL?
No.
May 11, 2021 at 2:48 pm
Viewing 15 posts - 1,561 through 1,575 (of 7,608 total)