Viewing 15 posts - 586 through 600 (of 7,608 total)
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
Liked Rune's comment.
And that is why you should always explicitly specify NOT / NOT NULL when creating a table. From the context of the q, I could work out that...
October 21, 2022 at 4:31 pm
Shrink only the file(s) that are part of the PRIMARY filegroup:
DBCC SHRINKFILE(1, 512)
DBCC SHRINKFILE(?, 512) --if you have additional file(s) in the PRIMARY fg
October 21, 2022 at 4:27 pm
SELECT CAST(SUM(OrigWeight/2000.0) AS decimal(10,2)) Tons
October 20, 2022 at 7:02 pm
SELECT OBJECT_NAME(object_id) AS object_name
SUBSTRING(definition, CHARINDEX('##', definition) - 20, 200) AS definition_first_match,
definition
FROM sys.sql_modules
WHERE definition LIKE N'%##%'
ORDER BY 1
Edit: Sorry, I...
October 20, 2022 at 6:53 pm
Viewing 15 posts - 586 through 600 (of 7,608 total)