Viewing 15 posts - 196 through 210 (of 7,602 total)
Just use a method that works under any/all DATEFIRST settings, much simpler and safer:
/* calc immediately previous Sunday; day 0 = Monday, so day 6 = Sunday...
April 15, 2024 at 1:22 pm
With 20 name columns, how do you verify that all the names are unique across all rows? And, if they're not unique, how do you know which id to assign...
April 11, 2024 at 2:33 pm
The CHECKPOINT is one of the steps required before SQL can mark the existing log space as reusable. Since you're in SIMPLE recovery model, the only thing that could prevent...
April 8, 2024 at 5:26 pm
Also, you should issue an explicit CHECKPOINT on the db when you want logs to clear. Part of the requirement for freeing log space, SIMPLE recovery, is that a CHECKPOINT...
April 8, 2024 at 1:47 pm
Scott, How do I add the tablename to this query? So it displays the tablename with the result of the max().
SET @sql_template = N'SELECT...
April 5, 2024 at 6:00 pm
I would make it truly more generic (might as well). Definitely avoid the use of INFORMATION_SCHEMA views, since they are not 100% reliable and often seem very slow. I, too,...
April 5, 2024 at 3:23 pm
SELECT ca.*
FROM dbo.history h2
CROSS APPLY (
SELECT h1.*
FROM dbo.history h1
WHERE h1.hist_id = h2.hist_id - 1
UNION ALL
SELECT h2.*
) AS...
April 2, 2024 at 4:17 pm
You're welcome! I had to make one correction to the query above, btw.
March 29, 2024 at 6:23 pm
Something like this:
FROM
...
dbo.Locations L ON AL.LocationID = L.LocationID OUTER APPLY (
SELECT TOP (1) D.*
FROM dbo.Applicant_Disposition D
...
March 29, 2024 at 5:23 pm
View sys.database_principals will have the sid of the login (but not the login name itself). View sys.server_principals also has a sid.
If the login has been dropped, the sid may still...
March 27, 2024 at 9:26 pm
Naturally you can't use the current file names, since they're already in use for the original db. Use "WITH MOVE" to "tell" SQL the new file names
RESTORE DATABASE ACME_DEV FROM DISK...
March 26, 2024 at 9:16 pm
> So the format of the file reference for Branch A would be, A500/2024 and for branch B, B200/2024, etc. <<
That sorta violates 1NF, right? Personally I'd suggest not doing...
March 26, 2024 at 7:57 pm
Some things are somewhat unclear.
I don't see "district" at all in the ERD, although you reference it extensively in your discussion.
"Entries" is a rather vague Entity. And it looks as...
March 25, 2024 at 7:06 pm
It should be more efficient to do that using a trigger rather than doing a separate UPDATE after the load. The trigger would also allow for indirect notification (you wouldn't...
March 25, 2024 at 6:32 pm
I would think one UPDATE -- with the IN condition added -- would be much better than 3 separate UPDATEs, since the main table will then only have to be...
March 20, 2024 at 9:15 pm
Viewing 15 posts - 196 through 210 (of 7,602 total)