Viewing 15 posts - 2,251 through 2,265 (of 7,614 total)
I believe all you need to do is specify the proper PARTITION BY clause in the code (new code is below). The code originally comes from Itzik Ben-Gan (I believe),...
October 11, 2020 at 7:13 am
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...
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...
October 11, 2020 at 1:04 am
CREATE UNIQUE INDEX UK_IDX_TLOG ON TLOG_TB ( TXN_AUTH_ID ) WHERE MSG_TYPE = '200';
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...
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...
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...
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 (
...
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...
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
...
October 2, 2020 at 1:51 am
I think this will do it:
SELECT REPLACE(string, '000', '')
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,...
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...
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
...
October 1, 2020 at 4:21 pm
OOPS, yeah, I forgot about the cross-db reference. I should not have put SCHEMABINDING in there.
October 1, 2020 at 4:11 pm
Viewing 15 posts - 2,251 through 2,265 (of 7,614 total)