Viewing 15 posts - 2,866 through 2,880 (of 7,613 total)
You need more clear examples.
For example, if line 1 was the starting line, which of these lines would be included:
0 200 0 0 501 --line 5
200 0 0 0 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".
April 5, 2019 at 8:57 pm
That's a very interesting idea. It sounds very complex to implement, but quite nice once you get it working.
The trigger is actually rather easy to write and can 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".
April 5, 2019 at 5:12 pm
Bit data type is numeric in SQL: naturally 1 means Yes, 0 means No.
So:
CREATE TABLE dbo.table_name ( bit_column bit DEFAULT 1 );
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".
April 5, 2019 at 1:25 pm
But you also made the blanket statement that:
Indexes are for reducing the rows read, they have no value at all when you don’t have a where clause filtering the rows.
And...
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".
April 4, 2019 at 6:19 pm
Not necessarily true. Indexes can also allow SQL to avoid a sort (and sorts are expensive operations).
For example:
Add a clustered index on id to the table.
Then this query should...
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".
April 4, 2019 at 3:22 pm
You'd have to use an INSERT trigger. It could be an INSTEAD OF INSERT or an AFTER INSERT trigger.
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".
April 3, 2019 at 6:39 pm
Yep. Save the system variables (@@) into local variables (@) after the relevant statement(s), then test the local variables instead of the system vars. Note that you need...
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".
April 3, 2019 at 4:35 pm
I didn't, and wouldn't, look at the links. But thanks for the heads-up on this poster.
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".
April 2, 2019 at 3:12 pm
You can have the db name in an ALTER, just not the server name (note the message says two prefixes, i.e., a total of 3 levels of object 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".
April 1, 2019 at 9:21 pm
You must add an ORDER BY clause to the query to get the rows to be in a specific order. But, the ORDER BY must also be in 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".
April 1, 2019 at 8:25 pm
For clarification, a SQL column does not have to be all the same type: SQL has a type of sql_variant that is designed to handle different data types 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".
April 1, 2019 at 8:13 pm
You can only put columns in the OUTPUT clause from the INSERTED and DELETED table(s), if/when each is present.
Sadly, you can't use any column from any input in the 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".
April 1, 2019 at 5:17 pm
;WITH
cteCalcBaseDates AS (
SELECT DATEADD(MONTH, 7 - CASE WHEN MONTH(GETDATE()) < 8 THEN 12 ELSE 0 END,
DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()), 0)) AS Aug01,
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".
March 29, 2019 at 11:26 am
The GROUP BY Entry Num should be enough:
SELECT H.Customs_Entry_Num,
MAX(h.Total_MPF) AS Total_MPF,
SUM(L.MPF) AS Line_Sum
FROM ADHOC.ATS_ESH H
INNER JOIN ADHOC.ATS_ESL...
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".
March 28, 2019 at 11:12 am
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".
March 28, 2019 at 8:13 am
Viewing 15 posts - 2,866 through 2,880 (of 7,613 total)