Viewing 15 posts - 2,626 through 2,640 (of 7,613 total)
You're also better off just inserting the 'No Comments Provided' when you create the record instead of going back and updating the record later.
Drew
True, but even better would be...
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".
November 11, 2019 at 5:10 pm
True, but that table only has 75K rows. Create an index with only CommodityID and CommodityName and, yes, SQL will still have to do an index scan, but the overall query...
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".
November 11, 2019 at 4:39 pm
To help resolve this problem across the board, for all your queries, you really need to re-cluster the CommoditySupplier table. This is a classic case of the "default clustering by...
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".
November 11, 2019 at 4:12 pm
WHERE DS.IsActive = 4 AND Std.DepartmentId IS NULL
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".
November 8, 2019 at 9:56 pm
Estimating the space requirement for database restores from the backup size can be really misleading. One of the largest problems in this area is that free space in 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".
November 8, 2019 at 4:32 pm
Be aware, too, that an int column could require up to 10 bytes to store its value. It's not safe to limit your result from this column to just 8...
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".
November 8, 2019 at 4:18 pm
Now, multiple online articles suggest to use only when data is huge and not for small amount of data
To put it simply, that's just wrong. If you need to create...
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".
November 8, 2019 at 4:17 pm
I'd suggest always using SET XACT_ABORT ON.
(1) Otherwise, you can't be sure which part(s) of a transaction completed and which didn't. Sometimes the entire transaction will be failed even with...
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".
November 7, 2019 at 7:27 pm
Oops.
You still don't need a temp table. Instead:
INSERT INTO ...
SELECT ...
UNION
SELECT ...
UNION
SELECT ...
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".
November 6, 2019 at 10:32 pm
Insert into dbo.StdActiveTable
(StudentName ,
StdId ,
Stdgrade )
select std.Name
,std.StdID
,dp.stdgrade
from dbo.student std
join dbo.department dp
on std.stdid = dp.id
where (dp.isactive = 1) or
(dp.isactive = 2 and sdt.isactive =...
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".
November 6, 2019 at 10:00 pm
Sure, easy to list only those two columns. I was just mirroring what your original query had, since I wasn't sure exactly what you needed.
Personally I'd also make the job...
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".
November 5, 2019 at 8:57 pm
You need a few mods to your code, in particular to limit the results to only those with the current msdb session_id. As a starting point for you, this code...
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".
November 5, 2019 at 6:41 pm
Should this be replaced with a table that has 17 computed columns ?
Yes, if a computed column would work, then that is what you should use rather than a function.
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".
November 5, 2019 at 6:35 pm
I guess I don't understand why anyone would write software based on the knowledge of novices. If it's important for a novice to be able to maintain something...
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".
November 4, 2019 at 9:11 pm
Nothing to do with full-blown "novices". I would expect people with reasonable experience in SQL Server to know what 0 is, it's the default "base date" in SQL Server. If...
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".
November 1, 2019 at 8:21 pm
Viewing 15 posts - 2,626 through 2,640 (of 7,613 total)