Viewing 15 posts - 511 through 525 (of 748 total)
If it's truly just (and always) 2020 that is/will be missing then just hard code a union all with 2020
If there are multiple years and/or some dynamic logic that determines...
February 21, 2022 at 2:13 pm
2 years!
DBCC ShrinkFile is pretty straightforward command, not sure how to make it more efficient.
That's the point -- it's not great and we can't make it better.
Why do you want...
February 16, 2022 at 8:57 pm
sp_tableoption [ @TableNamePattern = ] 'table' , [ @OptionName = ] 'large value types out of row' ,[ @OptionValue =] '1'
will force large data out of row.
February 15, 2022 at 2:18 pm
Create another job that runs every N minutes to monitor it, and execute msdb.dbo.sp_stop_job it if it's been running longer than the desired time.
The msdb.dbo.agent_datetime(run_date,run_time) function can be used to...
February 10, 2022 at 2:53 pm
Thank you for including DDL, but please use the insert/edit code sample so that your code is readable.
Not knowing the data, just guessing based on names &...
February 10, 2022 at 2:35 pm
Not an expert, but it looks like you might want to use Modern_Spanish_CI_AS collation (case insensitive, but accent sensitive -- so a = A but à <> a).
e.g., for a...
February 8, 2022 at 10:24 pm
You have Json nested at least 9-levels deep with something like 31 different objects/attributes.
What do you want to return and how? Do you want the data flattened (in which case...
February 3, 2022 at 2:33 pm
In order, you have a lot of columns that appear to be costs (or possibly quantities) that are defined as nvarchar rather than numeric/decimal.
If this is a vendor database or...
February 2, 2022 at 2:22 pm
It looks like the WITH syntax may be ANSI SQL-99 standard.
Joe Celko may be able to confirm/clarify.
February 1, 2022 at 9:14 pm
This seems like a non-normalized design. Is there a relationship between categoryc & categoryx in the same row? What is it?
If not (and probably even if there is), use a...
February 1, 2022 at 3:25 pm
"OR" is good choice in this scenario, & conveys intent clearly. You could try unioning two separate selects, w/ test_ID in the where clause of one, & oldsome_cust_ID in the...
January 31, 2022 at 11:34 pm
Yes, OUTPUT is the way you would handle multiple rows.
But that procedure, as written, will never insert more than one row. It is using individual parameters correlating to columns, not...
January 31, 2022 at 11:08 pm
Since sp_InsertCasesintoCallLog is only inserting one row at a time, you can just use SCOPE_IDENTITY() to get the inserted RecID, and then use that in the where clause for the...
January 31, 2022 at 10:51 pm
text datatype is deprecated -- don't use it.
Cast as varchar(11) instead (11 is maximum # of characters in a negative int).
January 28, 2022 at 5:56 pm
Viewing 15 posts - 511 through 525 (of 748 total)