Viewing 15 posts - 406 through 420 (of 7,613 total)
@dennis Jensen:
I never presume to know the requirements of the task better than the person requesting the code.
"If the first Monday of the month is a holiday, than I 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".
August 4, 2023 at 3:23 pm
I'd strongly urge you not to mess with the DATEFIRST setting. You don't need to, and it could throw off other code which might need a different setting (if 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".
August 3, 2023 at 8:45 pm
I don't believe you can do this directly. However, you could have the first step of the job determine if it is a holiday, and if so, to schedule 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".
August 3, 2023 at 5:39 pm
Your ordering is not guaranteed to be in the OUT ITEM order, since you don't sort by it.
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".
July 31, 2023 at 4:05 pm
If you have a lot of rows, you'd likely get better performance putting the results (from the cte) into an indexed temp table, but for now, just see if this...
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".
July 31, 2023 at 2:14 pm
An alternative that allows a previous open paren(s) in the input data:
DROP TABLE IF EXISTS #test2;
CREATE TABLE #test2 ( tran_log_writes nvarchar(4000) NULL );
INSERT #test2 ( tran_log_writes )...
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".
July 25, 2023 at 2:20 pm
Personally for something this involved / complex, I'd use a custom function that parsed with pre-determination. That is, the code doesn't look only for specific names (tags) in the data,...
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".
July 24, 2023 at 5:44 pm
You specify either a partition or a filegroup, not both (if partition, the partitioning will determine the filegroup(s) used).
create index IX_Service_Start_Date ON ivc_cds.CDS_Claim_Header (Service_Start_Date )
WITH (FILLFACTOR = 98, SORT_IN_TEMPDB =...
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".
July 20, 2023 at 3:02 pm
Try this:
SELECT DISTINCT Lotr.LabOrderUnique,
STUFF( (SELECT DISTINCT CAST('^' AS varchar(max)) + CAST(lotr1.TestName AS varchar(max))
FROM dbo.Ncs_conv_IntergyMM_Labordertestresult 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".
July 17, 2023 at 8:44 pm
You very likely already have a clustered index on the table, on ( ClaimHeaderID, ClaimLineID ). (That's a vastly better clus key than an identity column, btw.)
You can only have one...
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".
July 13, 2023 at 9:52 pm
But you're going to have to include the date in the clustering key to do partitioning anyway, you might as well change the clustering first. And that will be less...
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".
July 13, 2023 at 9:47 pm
By far the best performance payoff for this is creating the best clustered index on the table, as coded below. You would likely not even need to partition then.
Based 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".
July 13, 2023 at 7:34 pm
Clustering by the date will solve the performance issues. Partitioning will aid performance only if you need to rebuild the table, in which case you would only need to rebuild...
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".
July 13, 2023 at 3:06 pm
That should be fairly easy using tally tables.
The trickier part would be excluding certain letter combinations, meaning of course you have to determine which ones to omit. For example: 'ASS',...
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".
July 12, 2023 at 7:40 pm
This should give you some idea. With that partitioning, you can no longer have ClaimLineID as a pk (or even a stand-alone unique index/constraint).
If you can use data compression, you...
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".
July 12, 2023 at 7:37 pm
Viewing 15 posts - 406 through 420 (of 7,613 total)