Viewing 15 posts - 2,656 through 2,670 (of 7,614 total)
Maybe this will give you what you want:
--** Data set up ***************************************************************
CREATE TABLE dbo.questions (
question_id int PRIMARY KEY,
question varchar(1000)...
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".
SSIS is a good (enough) tool, for what it does. It is actually very good at moving data around, to/from SQL Server and other platforms as well.
SSIS also has another...
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".
case
when columnA <> 0
then columnB = 1
else columnB
end
The main thing to understand about CASE is that every result from a CASE must be a single value. The expression leading 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".
Certain errors by default won't fail the entire transaction/batch. Before the transaction, use:
SET XACT_ABORT ON
to make SQL fail the entire transaction if an error like that occurs.
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".
I think we may have interpreted the q differently. I took "statistics i/o" to mean the results from:
SET STATISTICS IO ON;
The logical i/o results are directly comparable, aren't they?
I think maybe...
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".
Really it's best to use them in combination.
High I/O numbers tell you to look for better ways to do related part(s) of a query. The execution plan shows you what...
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".
Something along these lines:
ALTER TRIGGER [dbo].[trig_UpdatePlacementCount]
ON [dbo].[DebtorHistory]
AFTER INSERT, UPDATE
AS
BEGIN
SET NOCOUNT ON;
UPDATE DI
SET placement_count = dh.file_no_count
FROM dbo.DebtorInfo DI
INNER JOIN inserted i ON i.file_no = DI.file_no
INNER JOIN (
...
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".
Viewing 15 posts - 2,656 through 2,670 (of 7,614 total)