Viewing 14 posts - 1 through 14 (of 14 total)
GrassHopper,
Here is a version of my query with columns added. Bit of a rush job so may need to check it. It still doesn't do the schemas though. Oh, and...
November 29, 2019 at 9:19 am
Why omit
QUOTENAME
in the initial statement?
An oversight.
Yours is probably the more complete solution from a generic perspective, including columns etc. My approach was based on the OP's code...
November 28, 2019 at 12:43 pm
There are probably several ways of doing this. One approach is something like this:
DECLARE @sql NVARCHAR(MAX) = N'';
;with tabsWithId as (select t.Name
,...
November 28, 2019 at 9:19 am
I may be missing the point but...
I notice that your addition to the WHERE clause just targets the left table. You are LEFT OUTER JOINing to the right table, but...
November 27, 2019 at 9:18 am
It would probably have been helpful to show the current select query. However, it feels like the LEAD function may help. An example of usage is:
SELECT *
,...
November 26, 2019 at 2:24 pm
Do you have an example of the output you are expecting to generate? It feels like one or two CTEs which are then joined may be the way, but it...
November 22, 2019 at 2:48 pm
Thank you for the reply. This was the sort of info I was hoping for.
I will likely pursue this route in the next appropriate project. I was wary about wading...
November 22, 2019 at 2:36 pm
Are you referring to SPID? If so, you could just exclude the current SPID (@@SPID)...?
November 18, 2019 at 4:36 pm
If you just want to know if there are any such records it is usually better to use "exists" rather than making SQL Server provide a full count
November 18, 2019 at 10:55 am
Minor tweak, but if it's SQL Server you could possibly replace
UPDATE account SET active_yn =0 WHERE account_code='4c'
SELECT 'AFTER' 'AFTER', * FROM dbo.account WHERE account_code='4c'
with
UPDATE...
October 29, 2019 at 11:17 am
Assuming the query is the same in both instances I would probably be looking at the connection from the app to SQL Server. You have given no clue as to...
August 9, 2018 at 7:09 am
As pedantic as this is.....
"I can see only one way to do this"
IF len (ltrim(@datetimevar)) <= 8 and charindex(':',@datetimevar) > 0
I...
April 13, 2017 at 3:29 am
Yes, my bad as I failed to read the original question properly. I assumed wrongly that CustId was a PK.
I'll return to my cave.
February 3, 2016 at 7:58 am
Not sure if I am missing something here, but why can't the following be used?
delete Customers
where CustID NOT in (
...
February 3, 2016 at 2:09 am
Viewing 14 posts - 1 through 14 (of 14 total)