Viewing 15 posts - 7,141 through 7,155 (of 7,619 total)
jarid.lawson (10/8/2012)
ScottPletcher (10/8/2012)
SELECT lastname
FROM HR.Employees
WHERE
lastname LIKE '%[/]%' AND
lastname NOT LIKE '%[/]%[/]%'
Still have to add the line that removes / in the first...
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 8, 2012 at 2:47 pm
SQL Server muss immer the log gescrieben.
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 8, 2012 at 10:48 am
SELECT lastname
FROM HR.Employees
WHERE
lastname LIKE '%[/]%' AND
lastname NOT LIKE '%[/]%[/]%'
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 8, 2012 at 10:26 am
Michael T2 (10/5/2012)
actually that wont work, if shipweight2 and shipweight3 are both null it will update them both. I dont want that
No, if both are NULL, only shipweight2 will UPDATE,...
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 8, 2012 at 7:58 am
Yeah, 217 is basically awful. Typically you want to see ~(20-)30ms, although the "base" time will vary depending on your specific disk configuration, of course.
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 5, 2012 at 4:33 pm
Very close. I would make some slight adjustments as follows:
UPDATE dbo.weights
SET
shipweight2 = CASE WHEN shipweight2 IS NULL THEN @weight ELSE shipweight2 END,
...
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 5, 2012 at 4:12 pm
Eugene Elutin (10/4/2012)
ScottPletcher (10/4/2012)
I don't think such extremely simplistic rules always work well in tables, large or small.
Choosing the best indexes takes a lot of careful consideration of your data...
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 4, 2012 at 12:50 pm
Jeff Moden (10/3/2012)
sqlserver12345 (10/2/2012)
Ex:350 days = 50 0/7 weeks
351 days = 50 1/7 weeks
352...
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 4, 2012 at 8:40 am
Jeff Moden (10/3/2012)
ScottPletcher (10/3/2012)
Customer ids are usually unique and ever-increasing; narrowness is sometimes...
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 4, 2012 at 8:36 am
Jeff Moden (10/3/2012)
Use the clustered index for a more appropriate column
For large tables, the "appropriate column" is usually unique, narrow, and ever-increasing. "Customer Code" columns almost never meet 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".
October 3, 2012 at 4:57 pm
--
--
SELECT
col1, col2, days,
CAST(days / 7 AS varchar(5)) + ' ' + CAST(days % 7 AS varchar(1)) + '/7' AS weekdays
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".
October 3, 2012 at 4:22 pm
Backup and restore requests.
I've done away with a lot of the "requests" -- just provide 'em a stored proc that can be run to do the backup. The stored...
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, 2012 at 4:11 pm
Eugene Elutin (10/3/2012)
ScottPletcher (10/3/2012)
...
Why would the relative position of the column make the slightest bit of difference at all?
It may effect page splits and re-writes.
?? How is that??
Fixed-length columns...
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, 2012 at 3:56 pm
An uncontrolled MIN() could fail as other Statuses appear in the table.
I suggest directly coding for the specific condition you are looking for:
SELECT
Product,
...
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, 2012 at 12:29 pm
In this case ;-), I think a simple CASE will do exactly the same thing:
SELECT TOP 1
CASE WHEN Col1 IS NULL THEN 1 WHEN...
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, 2012 at 12:17 pm
Viewing 15 posts - 7,141 through 7,155 (of 7,619 total)