Viewing 15 posts - 3,931 through 3,945 (of 7,613 total)
I don't believe we're saying you need to correct everything wrong with the table right now (I suspect that would be a truly big task). But this change seems pretty...
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".
March 3, 2017 at 8:30 am
1) Yes, doing that does violate normalization, including 1NF. The text "discontinued effective 1/1/2011" has a date embedded in text. That alone is a clear violation of 1NF.
2) It's...
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".
March 3, 2017 at 8:16 am
For best overall performance, first review index stats to make sure you have the best clustering index on every table. (Hint: The majority of time, this is not an identity...
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".
March 2, 2017 at 11:34 am
I believe that to index the column, it must be persisted. If it's not persisted already, SQL will persist it when you add the index on it.
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".
March 2, 2017 at 11:30 am
You could instead just change the "ON DELETE" option on the FK. For example, to "tell" SQL to automatically set the referencing key to NULL (of course the referencing column(s)...
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".
March 2, 2017 at 10:15 am
Again, I can imagine very few scenarios where a nonclustered index on a temp table would make real sense, typically that just wastes disk space. Just cluster the table that...
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".
March 1, 2017 at 9:20 am
Yeah, straight forward join, for a relatively small temp table, I'd probably go ahead and recluster it:
CREATE CLUSTERED INDEX CL_HIT_RANGE ON #HIT_RANGE
(
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".
February 28, 2017 at 2:37 pm
For the first part, use a clustered index not a nonclustered index.
Presumably you'd want to changce to cluster on RangeLow, RangeHigh for the part of that code that...
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".
February 28, 2017 at 1:48 pm
1 table : 21 000 000 rows
Which table specifically has 21M rows: tblDE_A10 or tblDE?
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".
February 28, 2017 at 9:58 am
Do you use ArcServe backup? [Or its equivalent, if it's now been bought out by another company.] Somewhere in the mists of my mind I believe some backup package created...
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".
February 27, 2017 at 11:17 am
That is my understanding as well. If the job owner has sysadmin-level authority, then the job runs under the Agent's account.
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".
February 27, 2017 at 9:49 am
I use view:
sys.dm_db_index_operational_stats
for that type of analysis / review on a given table/index.
Be aware, though, of the potential volatility of this data, based on the quote...
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".
February 24, 2017 at 9:32 am
The "best method" depends on how you want to do it. Assuming you want to do it via T-SQL, then maybe something like below (I've omitted any error/missing object checking):
DECLARE...
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".
February 23, 2017 at 11:31 am
In short, yes, ignore "query cost relative to batch". There's no question that the new code is vastly more efficient.
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".
February 23, 2017 at 11:24 am
My best guess is that the value is a pseudo-"Julian" date (as IBM called it), i.e., that the last 3 digits are the relative day number of the year. 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".
February 23, 2017 at 11:22 am
Viewing 15 posts - 3,931 through 3,945 (of 7,613 total)