Viewing 15 posts - 5,491 through 5,505 (of 7,619 total)
SELECT
DD1.[Incident_x0020_Date] AS [Incident Date],
1 AS [Order],
DD1.[Int_x002f_Dom] AS [Location],
DD1.[ACTION] AS [Action],
DD1.[Channel] AS [Channel Type],
SUM(CASE WHEN DD1.[DLP_x0020_VIOLATION] = 'Bribery & Corruption' THEN 1 ELSE 0 END)...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 8, 2015 at 4:41 pm
Note that you can also create non-temp tables in the tempdb database. That way the table will be there even if the connection that created it "gets broken" or...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 8, 2015 at 4:33 pm
The index is empty, i.e., there are no rows in that index.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 8, 2015 at 4:30 pm
SELECT sm.*, tv_lookup.Amount AS tv_Amount, tv_lookup.PercRate AS tv_PercRate, tv_lookup.Code AS tv_Code
FROM #SM sm
OUTER APPLY (
SELECT TOP (1) *
FROM #TestValues tv
...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 8, 2015 at 3:54 pm
Jeff Moden (1/8/2015)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 8, 2015 at 1:54 pm
I'm almost certain the optimizer is sophisticated enough to implicitly convert the literal value rather than a variable value or a column.
If you're still concerned about it, you could do...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 7, 2015 at 1:01 pm
If you primarily use columns "Company" and "Form_Name" to do lookups and/or joins on table "COLUMN_NEXT_ID_RECENT_ITEMS", make sure the table is clustered on those columns. [It might, instead, be...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 7, 2015 at 12:13 pm
If the query otherwise works the way you want it to, just remove the unneeded column from the subquery:
...,
(SELECT C1.containerCode as containerCode --,SE.createdOn
FROM Containers C1
LEFT JOIN StoringsEvents SE ON C1.containerIncId...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 7, 2015 at 12:09 pm
I don't like the extra overhead of generating hundreds of rows every time when you only need a dozen or two.
A "standard" sequential-numbers tally table can easily handle those types...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 7, 2015 at 9:31 am
Grant Fritchey (1/6/2015)One other point, I'm not sure what industry you're working in, but many, especially healthcare, now have criminal penalties if you expose personal data to people without permission...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 6, 2015 at 5:17 pm
First thought for first task:
Compare one customer's pattern to the concatenated pattern of another customer(s). This should alleviate the off-by-n issue. Naturally you could also reduce the repeating...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 6, 2015 at 4:42 pm
Eirikur Eiriksson (1/6/2015)
ScottPletcher (1/6/2015)
Eirikur Eiriksson (1/6/2015)
ScottPletcher (1/6/2015)
Jeff Moden (1/4/2015)
asita (1/3/2015)
Nolock is ignore the locks (please ignore it)
Trust me Dhani, we know what it does and folks in-the-know can't just ignore...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 6, 2015 at 3:59 pm
Great, glad it helped. It was a fun exercise :). And thanks so much for posting the final solution so I could see it! Yeah, I thought...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 6, 2015 at 3:51 pm
DECLARE @CopyParams TABLE (
CopyFromVIEGuid uniqueidentifier,
CopyToVIEGuid uniqueidentifier
)
UPDATE [dbo].XdsInboundSecurity
SET ClientCertificateThumbprint = (
Select...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 6, 2015 at 3:40 pm
Keep in mind that a proc exists in that view as long as it is still in the procedure cache. As long as the proc is in the cache,...
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
January 6, 2015 at 3:19 pm
Viewing 15 posts - 5,491 through 5,505 (of 7,619 total)