Viewing 15 posts - 2,821 through 2,835 (of 7,613 total)
A clustered index is the table itself. The PK may or may not be clustered.
So, technically speaking, "index space" in your context would mean non-clustered indexes, which may or may...
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 14, 2019 at 9:18 pm
Oops. I didn't subtract from the final result:
(case when [Duration]<'00:52' then '00:00' else DATEADD(SECOND, -52, [Duration]) 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".
May 14, 2019 at 5:03 pm
30 days was a placeholder as much as anything else. The logic can be as simple or as complex as needed to properly translate the Duration text. The main idea...
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 14, 2019 at 2:24 pm
You should add a column to contain the duration in days. Compute the value once when a row is inserted or deleted (using a trigger). You don't want to have...
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 13, 2019 at 9:45 pm
If I understand the desired logic correctly, then this:
alter table [DMPCRU].[dbo].[VaspianCalls] add [Hold_Time] as (iif(Duration < '00:52', '00:00', Duration))
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 13, 2019 at 6:20 pm
Look at the query plan. Is SQL able to do seeks to find the 1000 rows or does it have to scan the whole table 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".
May 10, 2019 at 5:58 pm
I thought there were settings for source and destination schema. It defaults to dbo, but afaik, the two schemas do not have to be the same.
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 10, 2019 at 2:52 pm
MS has a built-in standard report for Top 10 Avg or Total CPU queries, but that is a point-and-click, and I don't know of any way to store the results.
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 9, 2019 at 8:54 pm
If you don't genuinely need RowNum and TotalRowNum, drop them.
If you do, you can pre-compute RowNum in the X1 table, and compute the TotalRowNum based on the pre-computed RowNums in...
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 9, 2019 at 6:12 pm
There's really not a better way. You'll need to repeat the column list for both the inserted and deleted tables for any method you use.
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 9, 2019 at 5:08 pm
I'd use CROSS APPLYs to assign alias names to make the main SELECT statement and conditions easier to read and maintain. For example:
--...prior code same as before...
DELETE...
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 7, 2019 at 2:18 pm
I'd use a function. You don't have to put in every db, you can call a function from another db. Let's say you created a "Shared_Functions" db to store 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 2, 2019 at 5:39 pm
Interesting. It seems as if there is no variable data at all on a row, the entire "variable data" section of the row header is left out. But when 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 30, 2019 at 7:50 pm
The 2 bytes for varchar len are always present, even if the column is NULL.
NULL itself is set as one bit per column, i.e., a "NULL bitmap". Every column will...
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 30, 2019 at 3:28 pm
Maybe try CASTing to an explicit length?:
,CASE
WHEN T.[PD_ID] in (@Part)
THEN CAST('PD_ID_Match' AS varchar(30))
WHEN T.[Flat_PD_ID] in (@Part)
THEN CAST('FLAT_PD_ID_Match' AS varchar(30))
WHEN T.[Like_PD_ID] in (@Part)
THEN CAST('Like_PD_ID_Match' AS varchar(30))
WHEN T.[Flat_Like_PD_ID]...
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 29, 2019 at 5:53 pm
Viewing 15 posts - 2,821 through 2,835 (of 7,613 total)