Viewing 15 posts - 6,256 through 6,270 (of 7,613 total)
TheGreenShepherd (4/12/2012)
AddressParseStatus is nchar(1) and is used to indicate the value returned by our USPS validation software. It has pretty low cardinality, only 9 possible values. There are roughly 1B...
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 22, 2014 at 11:31 am
Actually the SELECT ... INTO is more efficient if the statement can be minimally logged.
I did a search in Books Online for something to verify that:
"
With minimal logging, using the...
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 21, 2014 at 11:58 am
No worries.
Mine is more convoluted, I know, but for a large table could potentially perform much better.
As long as you got a solution you could use 🙂
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 16, 2014 at 4:38 pm
Gillian_Pappas2002 (1/16/2014)
If all of the customer's records have an QS class, those do not have to be updated at all. Only the same customer order records that have at...
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 16, 2014 at 4:02 pm
Would it be better to do this with a Do While or a cursor?
No to both. Best is to use a set-based method, possibly like this one:
UPDATE tn
SET order_class...
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 16, 2014 at 2:55 pm
Here is a sample CROSS APPLY for your situation.
SELECT Part#, CustomerID, ca1.Wk_Num, ca1.Qty
FROM (
SELECT 'A' AS Part#, 1 AS CustomerID, 10 AS Wk1, 20 AS Wk2,...
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 15, 2014 at 1:45 pm
Yeah, sorry, in too big a hurry, left something out of the code:
SELECT
/* @IdCompany = */ e.IdTCompany,
/* @IdClient = */...
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 13, 2014 at 1:45 pm
Did you look at the code I wrote??
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 13, 2014 at 1:11 pm
SELECT
/* @IdCompany = */ e.IdTCompany,
/* @IdClient = */ e.IdClient,
/* @address = */ COALESCE(a1.address, a2.address)
FROM emp e
LEFT...
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 13, 2014 at 12:44 pm
My guess would be that somehow task schedule is using a batch size of 1 row (or some very small number of rows). See if you can change the...
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, 2014 at 4:03 pm
I'm not sure what you mean about procs and CDC.
CDC uses the SQL log to get changes, so it shouldn't require use of procs, or even know how any change...
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, 2014 at 3:54 pm
Jeff Moden (1/6/2014)
ScottPletcher (1/6/2014)
Depending on your specific data, future inserts could be sequential anyway. Even if not,...
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, 2014 at 8:08 am
Actually, it is a terrible idea to add an identity to this table.
Depending on your specific data, future inserts could be sequential anyway. Even if not, rows are inserted...
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, 2014 at 10:25 pm
Identity is a terrible idea on that table. Use the existing columns, in whichever order best matches your use of the table: either ( Item, ItemNumber ) 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 6, 2014 at 3:36 pm
Jeff Moden (1/1/2014)
fahey.jonathan (12/12/2013)
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 2, 2014 at 3:59 pm
Viewing 15 posts - 6,256 through 6,270 (of 7,613 total)