Viewing 15 posts - 5,416 through 5,430 (of 7,613 total)
This should give you more accurate totals, although it will list every combination of ProductionLine and Category, which may not be what you want.
SELECT D.Line AS Line, D.ProductionLine AS ProductionLine,...
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 3:42 pm
Dell Dude (1/29/2015)
ScottPletcher (1/29/2015)
sp_help elmah gives this for indexes
So I guess the table name is "elmah"?! It's somewhat confusing with all the different "table names" given.
DROP INDEX PK_ELMAH_Error ON...
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 2:22 pm
David Burrows (1/29/2015)
dwain.c (1/28/2015)
David - that's a very clever alternative!Thank you :blush:
It is very annoying that you can use ALTER COLUMN to do everything except add or remove IDENTITY 🙁
True,...
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 1:03 pm
sp_help elmah gives this for indexes
So I guess the table name is "elmah"?! It's somewhat confusing with all the different "table names" given.
DROP INDEX PK_ELMAH_Error ON elmah
DROP INDEX idx_ELMAH_TimeUtc...
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 12:39 pm
Btw, be sure to script out the existing indexes before you delete them so you can recreate them easily ;-).
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 12:32 pm
Dell Dude (1/29/2015)
ScottPletcher (1/29/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 12:31 pm
You could try a nonclustered index on a that contains id,
and a nonclustered index on b that contains id.
That may or may not help, depending on the total sizes of...
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 11:45 am
Drop all the indexes, starting with the nonclustered, then recreate them, starting with clustered. Unless the table itself is damaged, that's likely your best chance to clean this up.
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 11:42 am
I believe CROSS APPLY would be more appropriate to the original requirement ... but I just see that may be a moot point now :-D.
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 29, 2015 at 10:24 am
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
Viewing 15 posts - 5,416 through 5,430 (of 7,613 total)