Viewing 15 posts - 91 through 105 (of 1,435 total)
Your fingers might get considerably shorter, but you could always add a lot of these ...
IF UPDATE (colName )
BEGIN
-- Add your column to DSQL ...
END;
November 30, 2022 at 4:00 am
Something like this
DECLARE @Year int = 2022;
WITH cteMonthStarts AS (
SELECT FebStart = DATEADD(mm, (@year-1900)*12 +1, 0)
, AugStart...
November 11, 2022 at 2:12 pm
You are creating a "Catch-All" query. The pattern used in your WHERE clause is non-sargeable, forcing SQL to do a full scan.
With the following pattern,
AND (ISNULL(@email,'') =...
November 9, 2022 at 5:32 am
Assuming that all of the other 20 subqueries are based on the same pattern in tblPolSpec, you will probably get better performance if you use a CROSS-TAB query like this
November 4, 2022 at 6:16 pm
My code works with the data that you provided. I cant test against the unknown
October 10, 2022 at 4:15 pm
I'm not looking to delete, just exclude. See my response to Des below. I made an adjustment to the data. I left out a column by mistake.
Simply include the...
October 10, 2022 at 2:23 pm
Setting Consumable data
IF OBJECT_ID(N'tempdb..#DocData', N'U') IS NOT NULL DROP TABLE #DocData;
CREATE TABLE #DocData (
RefDocNum char(10) NOT...
October 10, 2022 at 11:08 am
That is battling. I was stunned by your affiliation. I'm happy to see a particularly subject. Altruisticly go to my blog and read it.
Spam incoming .....
September 19, 2022 at 2:24 pm
I'm having an issue on 2016 and 2017... If you have 2019 or any version prior to 2016, would you run the following code, please, and let me know...
September 4, 2022 at 6:55 am
I dont have access to SQL22, but looking at GREATEST/LEAST, I assume that using them in a WHERE clause will make the query NON-SARGEABLE.
SELECT P.Name, P.SellStartDate, P.DiscontinuedDate,...
September 1, 2022 at 8:06 am
Is it possible use case more than once in an expression? I have a query tha calculates the cost of insurence. but i need to see if i can...
August 23, 2022 at 6:05 pm
i get an error that why i was asking help.
What is the error?
August 23, 2022 at 6:00 pm
Take a look at this post
http://stackoverflow.com/questions/10404348/sql-server-dynamic-pivot-query
August 23, 2022 at 6:00 am
Your sample data did not contain any duplicate companies.
To cater for duplicates, wrap each CASE ... END statement in a MAX(CASE ... END)
and add a GROUP BY src.CoName
August 18, 2022 at 6:13 pm
This SQL will achieve the required results
SELECT Company = src.CoName
, aaa = CASE WHEN src.Class = 'aaa' THEN 'Yes' ELSE '' END
...
August 18, 2022 at 5:49 pm
Viewing 15 posts - 91 through 105 (of 1,435 total)