Viewing 15 posts - 571 through 585 (of 7,597 total)
Yes, it would. I took:
i want to select from 00:00:00 - 06:00:00
to mean a contiguous range from 00 to 06, but I likely should have used 00 and 05, if...
December 13, 2022 at 7:24 pm
To keep the query on the remote server "sargable", you shouldn't use any function on its columns in the WHERE, so something more like this (I may not have the...
December 13, 2022 at 7:19 pm
Glad it helped! Here's the 2nd version I mentioned: if you don't have more than 2 total dups, this might be easier to use.
--(2)
SELECT ID,
...
December 12, 2022 at 7:06 pm
WHERE DATEPART(HOUR, datetime_column) BETWEEN 0 AND 6
December 12, 2022 at 7:03 pm
If you want the details too, you can either:
(1) join back to the main table to list all rows <or>
(2) list the min, max and count
--(1)
SELECT t1.*
FROM...
December 12, 2022 at 4:06 pm
SELECT ID
FROM #tst
GROUP BY ID
HAVING
MIN(FNAME) <> MAX(FNAME) OR
MIN(LNAME) <> MAX(LNAME) OR
MIN(DOB) <> MAX(DOB)
December 12, 2022 at 4:04 pm
Each location can't be completely separate if email addresses must be unique. You need to replicate the email addresses across all tables, or have a "master" email table that contains...
December 12, 2022 at 3:02 pm
You could also explicitly define ("format") the column as "Text" data type in Excel.
December 8, 2022 at 3:51 pm
Here's a quick way:
DECLARE @JobDomain int
SET @JobDomain = 1
;WITH cte_Type_B AS (
SELECT *
FROM dbo.TestTable
WHERE JobDomain...
December 8, 2022 at 1:09 am
Is the clustered index on the table on BaseID?
December 6, 2022 at 4:01 pm
You can also use:
'20211130 00:00:00.000'
The only special chars you need are in the time, no - no T.
October 25, 2022 at 10:27 pm
I've never heard of anything like that in SQL Server.
October 25, 2022 at 10:23 pm
Part of the QotD is knowing defaults. This was left off, as many people do this and the default is to allow NULLs.
As a good practice, however, I...
October 25, 2022 at 10:19 pm
(1) Not guaranteed, but you could try looking at sys.dm_exec_input_buffer.event_info (SQL 2016+ only, I think). I would issue this command immediately upon entering the trigger, to have the best chance...
October 25, 2022 at 10:11 pm
It may fragment some indexes and not others. You certainly don't want to automatically rebuild every index. Also, rebuild from smallest to largest of the indexes that do need rebuilt.
October 21, 2022 at 5:53 pm
Viewing 15 posts - 571 through 585 (of 7,597 total)