Viewing 15 posts - 691 through 705 (of 2,648 total)
Instead of using LAG you can use OUTER APPLY. I've used both in this query so you can see the difference.
CREATE OR ALTER VIEW TestView AS
...
August 4, 2022 at 5:27 pm
Well, if you call this fnTally with a start value of zero (0), you get two zeros (0). You can eliminate:
SELECT N = 0 WHERE @StartN = 0 UNION...
July 30, 2022 at 9:15 pm
With a minor change to the function you could increase the functionality so that instead of specifying a bit for Zero or One for the starting value you could specify...
July 30, 2022 at 3:14 pm
Heh... lordy. That's a snoot full of code. Thanks, Jonathan.
Yes, lots of code and it's not my style of writing code so I haven't done much with it.
July 28, 2022 at 12:59 am
Yep... if they can make stuff like that clickable, why can't they make it codeable? The answer is, they can but haven't,
Yes, that would be a good enhancement to...
July 27, 2022 at 7:42 pm
If you right click the table in SSMS you can "Script Table as..." to generate a CREATE TABLE script.
Then if you right click the table you can generate an INSERT...
July 27, 2022 at 6:52 pm
I stand to be corrected, but the pattern appears to be as follows
July 25, 2022 at 3:01 pm
I work on sql server 2019 i face issue i need to give unique number to every group of numbers without using string aggreagte or stuff
original table as below...
July 25, 2022 at 10:56 am
Can you just create a linked server in SSMS, then just do an "insert into select * from" command in SSMS?
If you cannot create a linked server then, if it...
July 15, 2022 at 2:14 pm
I'm not sure what you are trying to do but if you install this function: https://www.sqlservercentral.com/scripts/a-daterange-table-valued-function
Then this code might do the job:
Declare @StartDate Datetime
Declare @EndDate Datetime
Select @StartDate...
July 14, 2022 at 10:35 pm
You could try this script: https://www.sqlservercentral.com/scripts/get-file-sizes-of-database-files-and-free-space-on-disk
July 13, 2022 at 7:49 pm
I'm not really sure what you want to do. Do you want to group rows by "Time"?
SELECT ss.StoreCode,
ss.ProductCode,
...
July 13, 2022 at 7:46 pm
I would just shrink the files. If your are on a SAN disk you might not even notice any performance degradation. If you do you might just need to rebuild...
July 10, 2022 at 7:29 pm
Can you provide a sample of how you are calling the procedure and what is going into the parameters?
July 10, 2022 at 7:08 pm
Viewing 15 posts - 691 through 705 (of 2,648 total)