Viewing 15 posts - 5,731 through 5,745 (of 7,613 total)
New Born DBA (10/7/2014)
ScottPletcher (10/7/2014)
New Born DBA (10/7/2014)
ScottPletcher (10/7/2014)
New Born DBA (10/7/2014)
ScottPletcher (10/7/2014)
USE [DBName]
GO
CREATE CLUSTERED INDEX [Company_FormName] ON [dbo].[COLUMN_NEXT_ID]
(
[Company], [Form_Name]
)WITH ( FILLFACTOR = 100 ) ON [PRIMARY]
Now this is 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".
October 7, 2014 at 11:37 am
New Born DBA (10/7/2014)
ScottPletcher (10/7/2014)
New Born DBA (10/7/2014)
ScottPletcher (10/7/2014)
USE [DBName]
GO
CREATE CLUSTERED INDEX [Company_FormName] ON [dbo].[COLUMN_NEXT_ID]
(
[Company], [Form_Name]
)WITH ( FILLFACTOR = 100 ) ON [PRIMARY]
Now this is the warning I am getting:
Warning!...
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".
October 7, 2014 at 11:14 am
New Born DBA (10/7/2014)
ScottPletcher (10/7/2014)
USE [DBName]
GO
CREATE CLUSTERED INDEX [Company_FormName] ON [dbo].[COLUMN_NEXT_ID]
(
[Company], [Form_Name]
)WITH ( FILLFACTOR = 100 ) ON [PRIMARY]
Now this is the warning I am getting:
Warning! The maximum key length...
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".
October 7, 2014 at 11:05 am
For consistency, I'd stick with just explicitly CASTing the second value to an int:
SELECT CAST(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0) AS int)
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".
October 7, 2014 at 11:01 am
USE [DBName]
GO
CREATE CLUSTERED INDEX [Company_FormName] ON [dbo].[COLUMN_NEXT_ID]
(
[Company], [Form_Name]
)WITH ( FILLFACTOR = 100 ) ON [PRIMARY]
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".
October 7, 2014 at 10:57 am
The db must be SQL 2000, or in SQL 2000 compatibility mode (80).
Yikes and gadzooks! You need to move it forward to at least 2005 as fast you can,...
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".
October 7, 2014 at 10:55 am
New Born DBA (10/7/2014)
ScottPletcher (10/6/2014)
The index I suggested was on Company and Form_Name.
Do you think I should test it out in Dev and QA first before I add a clustered...
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".
October 7, 2014 at 10:37 am
New Born DBA (10/6/2014)
ScottPletcher (10/6/2014)
New Born DBA (10/6/2014)
ScottPletcher (10/6/2014)
Add a clustered index to the "COLUMN_NEXT_ID" table on "Company" and "Form_Name".And how creating an index will help?:-D
It will avoid a full...
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".
October 6, 2014 at 4:29 pm
New Born DBA (10/6/2014)
ScottPletcher (10/6/2014)
Add a clustered index to the "COLUMN_NEXT_ID" table on "Company" and "Form_Name".And how creating an index will help?:-D
It will avoid a full table scan, locking as...
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".
October 6, 2014 at 4:06 pm
Suggested query below. If you're willing to add a nonclustered index, you can try the affect of adding the index below before running the query. I can't tell...
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".
October 6, 2014 at 4:02 pm
Add a clustered index to the "COLUMN_NEXT_ID" table on "Company" and "Form_Name".
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".
October 6, 2014 at 3:17 pm
Code below appears to confirm that. Although I did notice that if you added "TOP (100)", it became a KEYSET cursor, even w/o you explicitly indicating that.
DECLARE csr1 CURSOR...
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".
October 3, 2014 at 10:28 am
Yes, because the cursor is DYNAMIC, at least based on my reading of BOL:
"
DECLARE CURSOR
...
FORWARD_ONLY
...If FORWARD_ONLY is specified without the STATIC, KEYSET, or DYNAMIC keywords, the cursor operates as a...
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".
October 3, 2014 at 10:05 am
Agreed. I think sys.dm_db_index_operational_stats would be more useful to capture overall I/O, although it still doesn't link it to a specific query, unless you can do that yourself just...
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".
October 3, 2014 at 9:08 am
Did you try -1 as the length? Just a guess, but that's how SQL represents "MAX" internally in its system tables.
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".
October 2, 2014 at 2:48 pm
Viewing 15 posts - 5,731 through 5,745 (of 7,613 total)