Viewing 15 posts - 6,541 through 6,555 (of 7,613 total)
You could implement some type of SNAPSHOT isolation level. That will prevent the types of errors you get with (NOLOCK) and prevent readers from being blocked by writers.
See Books...
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".
June 21, 2013 at 2:59 pm
Lynn Pettis (6/12/2013)
mmartin1 (6/12/2013)
gmac 41947 (3/1/2013)
Hi,I use
DATEPART(month, myDate)or
MONTH(myDate)the resut is: 2 (if myDate is 2013.02.03). I would like return: 02
Do you have any solution for this?
Thans!
try this
declare @MyDate datetime
set...
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".
June 12, 2013 at 2:41 pm
WHERE
',' + column + ',' LIKE '%[^a-z0-9]LC[^a-z0-9]%'
Add other char(s) if/as needed; for example, if you prefer that underscore, such as in "LC_AXIS", not be a "word"...
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".
June 12, 2013 at 1:57 pm
Evil Kraig F (6/6/2013)
ScottPletcher (6/6/2013)
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".
June 7, 2013 at 9:26 am
Evil Kraig F (6/6/2013)
ScottPletcher (6/6/2013)
Evil Kraig F (6/6/2013)
ScottPletcher (6/6/2013)
Dird (6/6/2013)
Sean Lange (6/6/2013)
MID?
Yeah, the Q as a whole is a bit meh. I assume he means AVG (to go with 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".
June 6, 2013 at 3:54 pm
Evil Kraig F (6/6/2013)
ScottPletcher (6/6/2013)
Dird (6/6/2013)
Sean Lange (6/6/2013)
MID?
Yeah, the Q as a whole is a bit meh. I assume he means AVG (to go with the MIN/MAX functions) which I...
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".
June 6, 2013 at 3:43 pm
Dird (6/6/2013)
Sean Lange (6/6/2013)
MID?
Yeah, the Q as a whole is a bit meh. I assume he means AVG (to go with the MIN/MAX functions) which I don't see 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".
June 6, 2013 at 3:33 pm
Sean Lange (6/6/2013)
ScottPletcher (6/6/2013)
Given table1 with columns "id" and "value", where each id has 1 to 3 values/rows in the table:
Describe the essentials of a single query (no subquery,...
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".
June 6, 2013 at 3:29 pm
Ask them::
Given table1 with columns "id" and "value", where each id has 1 to 3 values/rows in the table:
Describe the essentials of a single query (no subquery, CTE, etc.) to...
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".
June 6, 2013 at 3:01 pm
Keep in mind that float is an imprecise data type, and the value actually stored in the table may not be exactly the same as the value that was 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".
May 30, 2013 at 3:49 pm
GilaMonster (5/22/2013)
ScottPletcher (5/22/2013)
It wasn't "out of context" -- you made an absolute statement, which thus applies to any context.
An absolute statement that you chose to ignore parts of.
I said shrink...
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".
May 22, 2013 at 2:30 pm
GilaMonster (5/22/2013)
ScottPletcher (5/22/2013)
GilaMonster (5/21/2013)
Shrink alone can't speed up a query.Isn't that an overly broad assertion?
Only when you quote me out of context.
If, for the sake of argument, some/all of 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".
May 22, 2013 at 2:15 pm
Purely fyi, I personally think a cross apply that names the value being used makes the code much easier to follow and easier to change later. For example:
Select
*
from...
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".
May 22, 2013 at 12:57 pm
GilaMonster (5/21/2013)
Shrink alone can't speed up a query.
Isn't that an overly broad assertion? If, for the sake of argument, some/all of the disk extents added were scattered all over...
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".
May 22, 2013 at 12:37 pm
This should "turn off" the identity property:
SELECT *
INTO dbo.newtable
FROM dbo.table
UNION ALL
SELECT TOP 1 (*)
FROM dbo.table
WHERE 1 = 0
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".
May 21, 2013 at 3:15 pm
Viewing 15 posts - 6,541 through 6,555 (of 7,613 total)