Viewing 15 posts - 286 through 300 (of 748 total)
Self-join just means you are joining a table to itself rather than a different table. It works just like any other join. Just as you would in joining different tables,...
September 8, 2022 at 2:57 pm
In order to get the values on the same row, rather than unioning, you probably need to self-join on the key columns for the three cases.
Are all three always populated?...
September 8, 2022 at 1:52 pm
I use this as the last step in multi-step jobs (with job steps set to go to next step on failure).
Note: I did not write this, and have lost track...
September 8, 2022 at 1:26 pm
Recommend storing atomic values rather than denormalized lists. STRING_AGG() function makes it easy to return it to the client as a list if that's really required.
e.g., if you're trying to...
September 6, 2022 at 7:25 pm
Yes, sorry -- right. Licenses are just licenses for a given edition.
As you suggested, I was focused on Std. vs. Enterprise. -- saw the word "Standard" and went on a...
September 2, 2022 at 5:42 pm
basically the database security audit team ran guardium scan and found a finding that say fixed db roles such as datawriter, datareader, etc must not be assigned directly to user...
September 2, 2022 at 1:46 pm
4. Do both versions perform the exact same and have the same features?
* YES, no difference what so ever!
Not true. The gap has narrowed considerably since 2016 SP2, but there...
September 2, 2022 at 1:39 pm
You can run a scheduled job to look for it w/ something like the following:
declare @recipientCSV varchar(8000)='recipients@yourcompany.com';
declare @subject varchar(1000)='ALERT - Trigger Missing or Disabled';
declare @text varchar(max)='Trigger ALERT...
September 2, 2022 at 1:30 pm
Yes you can execute bcp via TSQL using xp_cmdshell. -- e.g., https://www.sqlservercentral.com/forums/topic/bcp-using-xp_cmdshell
You can also create Operating System (CmdExec) job steps.
August 30, 2022 at 7:42 pm
You have datetime columns - don't use between!
where businessdate between '2022-08-01' and '2022-08-31'
means return everything through '2022-08-31 00:00:00.000 (excludes that entire last day of the month except...
August 25, 2022 at 10:17 pm
On top of echoing Jeff's concerns about deleting book details as sounding wrong/dangerous, I'd also question why are you trying to delete book details?
If it's about performance, then make sure...
August 24, 2022 at 7:31 pm
RedGate knows: https://www.red-gate.com/products/sql-development/sql-prompt/pricing
($179 for 1 license)
August 24, 2022 at 6:57 pm
DECLARE @batchCount INT = 4000;
DECLARE @deleteCount INT = 4000;
WHILE @deleteCount = @batchCount
BEGIN
...
August 24, 2022 at 6:53 pm
Install & use SSMS locally.
Don't run SSMS on the server. You don't want the overhead or security risks of remote desktop, let alone SSMS, on the server if you can...
August 24, 2022 at 4:35 pm
Just get the two dates and use them in your where clause with IN()...
DECLARE @today DATE = (SELECT GETDATE());
DECLARE @firstOfMonth DATE = DATEADD(day, 1, EOMONTH(@today, -1))
WHERE Date...
August 24, 2022 at 3:09 pm
Viewing 15 posts - 286 through 300 (of 748 total)