Viewing 15 posts - 661 through 675 (of 2,648 total)
Ah, I see, test driven development:
;with cte as
(
select * from (values ('Restaurant'),
...
October 31, 2022 at 9:09 pm
Considering there's something urgent going on, why not tell us exactly what it is that you're trying to do and then we might be able to better help. All...
October 24, 2022 at 1:39 pm
IF OBJECT_ID('tempdb..#temp','u') is not null
DROP TABLE #temp
GO
SELECT *
INTO #temp
FROM (VALUES ('MN', 'KL'),
... October 20, 2022 at 3:46 pm
This code would check for State = 'MN' AND ProdCodes NOT IN ('Kl', 'Kjh') )
I need it to exclude ProdCodes NOT IN ('Kl', 'Kjh') When the state is MN.
That's...
October 20, 2022 at 3:38 pm
That may work but I need something a little different:
I need the if it is State = MN then Exclude ProdCodes IN ('Kl', 'Kjh') Else if State not =...
October 20, 2022 at 3:14 pm
Thanks for the reply, but that is not what I need.
I need a way to write this that when the state is MN then these ProcCodes are Excluded, but...
October 20, 2022 at 2:49 pm
As a bit of a sidebar, you may have some people come back with a suggestion of using the built-in STRING_SPLIT() function. That will seem to work but there...
October 8, 2022 at 11:08 pm
Have you tried clearing the cache and running the queries again?
DBCC FREEPROCCACHE
October 4, 2022 at 5:26 pm
You should look at partitioning the table by period.
September 13, 2022 at 3:11 pm
Can you try this?
It should move the sort to the inserts into the clustered index on the temporary table
DROP TABLE IF EXISTS #temp;
CREATE TABLE #temp
(
...
September 12, 2022 at 6:09 pm
The question is too long for me to read.
If you are inserting with DISTINCT, as you appear to be, that will ensure no duplicates are generated at the source
If you...
September 11, 2022 at 3:12 pm
I would use an SSMS add-in like ApexSQL Refactor.
There is a free version of it here https://en.freedownloadmanager.org/Windows-PC/ApexSQL-Refactor-FREE.html
I think you only get a trial period with the current version from...
September 1, 2022 at 3:58 pm
Alternatively using OUTER or CROSS APPLY
SELECT c.CityName, x.MonthName
FROM dbo.City c
OUTER APPLY (SELECT TOP(1) m.MonthName
...
August 31, 2022 at 6:27 pm
If I try to use what I showed it fails. I get an error on WO.dtCall, says multi-part identifier could not be bound.
Thanks
Try this:
FROM PROPERTY...
August 31, 2022 at 4:51 pm
Use CROSS APPLY instead of INNER JOIN
FROM PROPERTY P
INNER Join UNIT U
ON P.hMy = U.hProperty
INNER...
August 31, 2022 at 3:32 pm
Viewing 15 posts - 661 through 675 (of 2,648 total)