Viewing 15 posts - 5,431 through 5,445 (of 7,619 total)
Phil Parkin (1/23/2015)
ScottPletcher (1/22/2015)
--But, ProductId seems right to me if you're going to camel case.
--
Camel case would be productId. ProductId is Pascal case 🙂
I believe either ProductId or productId are...
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 29, 2015 at 10:07 am
Steve Jones - SSC Editor (1/29/2015)
Eric M Russell (1/27/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 29, 2015 at 9:59 am
Based solely on the existing query -- having not yet reviewed index missing stats and index usage stats for this table -- you could add a clustered index on:
si.ShippingKey
Nonclustered...
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 29, 2015 at 9:53 am
TomThomson (1/28/2015)
Eric M Russell (1/27/2015)
andrew gothard (1/27/2015)
Eric M Russell (1/21/2015)
However, I would take issue with ID...
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 29, 2015 at 7:57 am
Something like this:
SELECT
SUM(CASE WHEN ht.asAtDate >= DATEADD(DAY, -7, today_midnight)
THEN ht.[numLow] + ht.[numMedium]...
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 27, 2015 at 3:58 pm
Is ProdId a guaranteed unique value in ProductsL1? The error message indicates that the trigger might be trying to UPDATE more than one row.
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 27, 2015 at 10:00 am
I'd stick with the AFTER trigger. Your initial trigger was pretty much spot on.
In case you create other AFTER triggers later, you might want to explicitly designate that trigger...
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 27, 2015 at 9:57 am
Jeff Moden (1/26/2015)
ScottPletcher (1/26/2015)
dwain.c (1/25/2015)
coalesce(a.processStatus, 0) = 0
is not SARGable, so that could be improved on by making the processStatus column NOT NULL.
It's much better to code it as:
(a.processStatus...
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 27, 2015 at 9:09 am
dwain.c (1/25/2015)
coalesce(a.processStatus, 0) = 0
is not SARGable, so that could be improved on by making the processStatus column NOT NULL.
It's much better to code it as:
(a.processStatus is null 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 26, 2015 at 1:56 pm
g.britton (1/26/2015)
Jeff Moden (1/24/2015)
RonKyle (1/24/2015)
What are the issues with DATETIME2 and DATEDIFF?
Simple. Given a single row that contains StartDate and EndDate columns as DATETIME2 columns, write the code to...
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 26, 2015 at 1:42 pm
TomThomson (1/23/2015)
ScottPletcher (1/23/2015)
TomThomson (1/23/2015)
Sean Lange (1/23/2015)
Eric M Russell (1/23/2015)
Date/Time: datetime, offset, varchar?There is only one option here. Datetime.
I suppose if your dBMS is anccient enough that's excusable. But...
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 23, 2015 at 1:25 pm
TomThomson (1/23/2015)
Sean Lange (1/23/2015)
Eric M Russell (1/23/2015)
Date/Time: datetime, offset, varchar?There is only one option here. Datetime.
I suppose if your dBMS is anccient enough that's excusable. But it probably...
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 23, 2015 at 12:50 pm
MMartin1 (1/23/2015)
EXEC SP_HELPTEXT 'schema.viewName';This formats the output across multiple lines rather than just one. I find it way handier when copying long definitions to the SSMS window.
True; it's easier to...
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 23, 2015 at 11:43 am
I'm stunned Celko hasn't weighed in and told us how to name things properly rather than relying on punched cards and tape naming!
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 23, 2015 at 9:44 am
Phil Parkin (1/23/2015)
ScottPletcher (1/23/2015)
Phil Parkin (1/23/2015)
Steve Jones - SSC Editor (1/23/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 23, 2015 at 9:43 am
Viewing 15 posts - 5,431 through 5,445 (of 7,619 total)