Viewing 15 posts - 241 through 255 (of 751 total)
Is your data really so bad that all those predicates could be null or empty strings? Do they really contain invalid commas?
All the ISNULL(), REPLACE(), & LOWER() functions make your...
November 8, 2022 at 2:43 pm
Note that query would still return a row for every different combination of the columns. If all you're trying to get is the sum, you need to change the group...
November 4, 2022 at 7:59 pm
Then none of those columns in any of the rows evaluate to valid NUMERIC(10) values. e.g., they might have spaces, punctuation, or alpha characters... or actually be null.
Do a select...
November 4, 2022 at 7:52 pm
Can you provide an actual execution plan?
How many rows are in tblPolMaster? tblPolSpec?
How many rows are returned by the query?
Is tblPolSpec a generic Entity-Attribute Value lookup table? Do you have...
November 4, 2022 at 6:05 pm
Why are all the columns being selected via subqueries rather than joins?
November 4, 2022 at 6:02 pm
It's just a filter:
WHERE getdate() >= glfStartDate AND getdate() <= glfEndDate
November 3, 2022 at 2:31 pm
Based on other articles, it appears you can change the data type of a column not used in the partitioning function/primary key.
November 1, 2022 at 9:30 pm
Parentheses.
You probably want
and ([Error] LIKE 'Delivery Flushed'
OR [Error] LIKE '%offline%'
OR [Error] LIKE '%online%')
October 28, 2022 at 4:15 pm
That's Oracle, not TSQL.
What's the error?
NVL2 (or COALESCE) seems like the better option anyway -- simpler, clearer.
October 28, 2022 at 2:23 pm
Yes, I have the fnTally function. When I run your code the way it is, it errors "Invalid column name 'Number'
Sorry. His version uses "N". I modified my version to...
October 27, 2022 at 6:30 pm
Do you have Jeff's fnTally function and did you test it? It is a TVF that in this case returns numbers 1-52...
after I fixed the script to return Number + 1...
October 27, 2022 at 5:22 pm
You can create a view using linked server tables, including with joins to local tables. You can't create a view including linked server tables with schemabinding.
October 27, 2022 at 5:16 pm
Something like this using a tally table or function:
DECLARE @startDate date = '2021-01-06'
DECLARE @nextYear date = DATEADD(year,1,DATEADD(year,DATEDIFF(year,0,@startDate),0));
SELECT DATEADD(WEEK,Number,@startDate ) AS StartDate, DATEADD(DAY,6,DATEADD(WEEK,Number,@startDate )) AS EndDate, Number +...
October 27, 2022 at 4:16 pm
No.
Amazon recommends using their Data Migration Service for this scenario.
October 26, 2022 at 6:28 pm
Viewing 15 posts - 241 through 255 (of 751 total)