Viewing 15 posts - 2,251 through 2,265 (of 7,613 total)
Recompile forces SQL to recreate the query plan, even if one is already available in memory.
That process may require updating stats if one of the tables in the query has...
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 11, 2020 at 1:08 am
... The other thing is, all the other tables have clustered indexes on the GUID PKs ...
That alone might have made me skip buying the product!
Fillfactor also depends on...
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 11, 2020 at 1:04 am
CREATE UNIQUE INDEX UK_IDX_TLOG ON TLOG_TB ( TXN_AUTH_ID ) WHERE MSG_TYPE = '200';
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 9, 2020 at 7:27 am
It can not use the run length as a parameter, because the window specification requires a literal value.
But for every given run length a solution exists using only six...
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, 2020 at 2:44 am
>> I want to find runs of at least three 1s, and return the result below. The 0s would be any test_values that are not 1. <<
Since SQL does...
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 2, 2020 at 7:22 pm
As Phil noted, I can't actually test the code, since you didn't provide any directly usable data:
SELECT up.class, up.model, ca1.type
FROM dbo.u_parts up
CROSS APPLY ( VALUES([W20-13]),([W20-14]),([WorkLog]) ) AS...
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 2, 2020 at 7:08 pm
Glad it helped, thanks for the feedback!
If you need to split out the final string, you can use a tally table for that:
;WITH
cte_tally10 AS (
...
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 2, 2020 at 2:57 pm
Yet another version.
Non-serious note to Jeff Moden: See, I actually am willing to use an identity as the clustering key.
DECLARE @min_vals_in_sequence int
SET @min_vals_in_sequence = 3
DROP TABLE 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".
October 2, 2020 at 8:28 am
If you need both extracted values in the same row:
SELECT s.StuffId, ds2.email_name_1, ds2.email_name_2
FROM #Stuff s
CROSS APPLY (
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".
October 2, 2020 at 1:51 am
I think this will do it:
SELECT REPLACE(string, '000', '')
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 2, 2020 at 1:40 am
This code does include the date swap if they pass in a DateFrom that is greater than the DateTo.
if i need it to does not include date swap,...
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 1, 2020 at 4:50 pm
Do you use secondary filegroups? If you do, I'd create a new filegroup and files and do the data compression into that new filegroup. Then you can shrink the original...
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 1, 2020 at 4:23 pm
...
sum(CAST(size AS bigint))/128.0 AS File_Size_MB,
sum(CAST(FILEPROPERTY(name, ''SpaceUsed'') AS bigint))/128.0 as Space_Used_MB,
SUM(CAST(size AS bigint))/128.0 - sum(CAST(FILEPROPERTY(name,''SpaceUsed'') AS bigint))/128.0 AS Free_Space_MB
...
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 1, 2020 at 4:21 pm
OOPS, yeah, I forgot about the cross-db reference. I should not have put SCHEMABINDING in there.
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 1, 2020 at 4:11 pm
Here's how to calc the new selling price for any new net margin. (I always did love algebra.)
Edit: I didn't see Des's until after I had posted mine.
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 1, 2020 at 4:07 pm
Viewing 15 posts - 2,251 through 2,265 (of 7,613 total)