Viewing 15 posts - 1,336 through 1,350 (of 7,614 total)
CLR functions for performing Regular Expression searches aren't SQL either, but they're useful. Where do you draw the line?
IIF is part of T-SQL and is more succinct than CASE,...
August 18, 2021 at 3:07 pm
I don't see the need for all that, this is much simpler:
SET @ytdfrDate = DATEFROMPARTS(YEAR(@frdate) -
CASE WHEN MONTH(@frdate) < 4...
August 18, 2021 at 12:54 pm
Invoice line items can have a ship date
Only with a bad data model. Parts from the same invoice line could be shipped on different dates. You don't split...
August 18, 2021 at 5:03 am
I don't see the need for all that, this is much simpler:
SET @ytdfrDate = DATEFROMPARTS(YEAR(@frdate) -
CASE WHEN MONTH(@frdate) < 4 THEN 1...
August 18, 2021 at 4:59 am
Bruin wrote:With the same Line,subline?
Look at the PK you've chosen. IMHO, only the first 3 columns of InvoiceNbr, Line, and SubLine should make up the PK.
I'm more confused than...
August 18, 2021 at 4:49 am
CONVERT works on a single value at a time. Thus, the query should be more like:
and a.myDate BETWEEN CONVERT(date, '20201108') AND CONVERT(date, '20201116')
The strings will have to be converted to...
August 18, 2021 at 4:41 am
Either one can do the install. The DBA will need to provide some settings for the Windows team, but that team should be able to do an install as well.
August 17, 2021 at 3:50 pm
No.
If it's doing a lookup only (not modifying data, just reading it), you could also use WITH (NOLOCK) on the table to reduce overhead of the lookups. I would argue...
August 17, 2021 at 1:53 am
View sys.change_tracking_databases returns the db names of all dbs that have change tracking enabled.
Thus, the db name will not be in the view if change tracking is off.
August 17, 2021 at 1:51 am
You could do some major clean up on your existing code:
1. Don't use nvarchar unless you absolutely must have it, use varchar instead.
2. Don't use (MAX) unless you absolutely must...
August 16, 2021 at 3:47 pm
There are only two processes involved in the deadlock.
Make sure you have an index on
dvd ( bed_id, wns_id, dvb_id )
Actually, all these tables should almost certainly be clustered first on bed_id,...
August 16, 2021 at 2:40 pm
...
N'<th>Count of Records Successfully Uploaded Today: </th></tr>' +
-- Below is the query of which the results are passed into the rectangle
CAST((SELECT COUNT(*) FROM .[dbo].[Stage_SMSLog]
with (NOLOCK) WHERE datestamp = CONVERT(nvarchar(10), GetDate(),120))...
August 12, 2021 at 6:03 pm
You need format 120 rather than 20: 20 will leave off the century, so you'd get 21 for yy instead of 2021, therefore it won't match.
August 12, 2021 at 4:58 pm
A trigger would be more consistent than using a proc, unless you only want to do this for certain, specific INSERTs:
USE tempdb;
IF OBJECT_ID('dbo.FirstTable') IS NOT NULL
...
August 11, 2021 at 7:41 pm
AT TIME ZONE clause.
August 11, 2021 at 5:19 pm
Viewing 15 posts - 1,336 through 1,350 (of 7,614 total)