Viewing 15 posts - 4,486 through 4,500 (of 7,613 total)
For only 50 rows from each, you'll very likely be OK regardless. Still, before loading the intermediate tables, cluster them on the join key(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".
January 13, 2016 at 12:37 pm
Is the "base length" of the columns at least the same? That is, when you say the value is the same except chars are added, is the initial value...
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, 2016 at 10:39 am
Hugo Kornelis (1/13/2016)
ScottPletcher (1/13/2016)
In particular, don't just slap an identity on the tableand assume that's automatically the best clustering key.Fixed that for you. 😉
Not at all :-D. Slapping...
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, 2016 at 9:42 am
Jeff Moden (1/12/2016)
ScottPletcher (1/12/2016)
never use a default clustered index on a table
I've got to say that I totally disagree with that. The clustered index is frequently used for...
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, 2016 at 9:20 am
SELECT CAST(size / 128.0 AS decimal(9, 2)) AS size_mb
FROM sys.database_files
WHERE type = 1
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 12, 2016 at 4:05 pm
;WITH cte_days AS (
Select 1 AS day#, 'Mon' AS day UNION ALL
Select 2, 'Tue' UNION ALL
Select 3, 'Wed'...
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 12, 2016 at 1:49 pm
Steve Jones - SSC Editor (1/12/2016)
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 12, 2016 at 12:53 pm
If you need a procedure to run in the context of multiple databases, create it in the master db, start the proc name with "sp_", and, after you create 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".
January 12, 2016 at 10:24 am
Steve Jones - SSC Editor (1/11/2016)
Alexander Suprun (1/11/2016)
You can easily rebuild a heap table starting from SQL Server 2008.
ALTER TABLE [TableName] REBUILDThis is bad. Don't do it.
http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2930-fixing-heap-fragmentation/
It's not necessarily bad....
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 12, 2016 at 10:16 am
Some third-party vendors offer such tools. Naturally all -- or at least most -- of them cost money.
MS provides the tablediff utility, which is free. It's command-line only,...
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 12, 2016 at 10:12 am
SQLisAwE5OmE (1/11/2016)
ScottPletcher (1/11/2016)
Note: I assumed from the context that you need to match only the *child's* birthday, even though you said "all...
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 11, 2016 at 3:14 pm
It seems you want to see a tester that has never performed a check on a given part id, not just for the first/last check.
If so, I think you could...
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 11, 2016 at 10:30 am
I would think it would be something like below.
Note: I assumed from the context that you need to match only the *child's* birthday, even though you said "all members". ...
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 11, 2016 at 10:14 am
You could also, of course, instead simply insert the values from the tvp into a properly clustered temp table, and then process using the temp table.
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 11, 2016 at 10:01 am
azawan (1/8/2016)
@scot-2Dear Scot same results
When I run the exact code I posted above, I get these results:
start_dateFuture1_Datefuture2_datefuture3_datefuture4_date
2016-01-012016-02-052016-03-032016-04-272016-05-16
2016-01-102016-02-142016-03-102016-05-042016-05-23
2016-02-202016-03-262016-04-212016-06-152016-07-04
2016-03-132016-04-172016-05-122016-07-062016-08-01
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, 2016 at 11:08 am
Viewing 15 posts - 4,486 through 4,500 (of 7,613 total)