Nevermind, I managed to figure it out.
Anyone that had the same question I had, use the below and just add in your table info:
BEGIN TRAN
DELETE a FROM [table name] a
INNER JOIN [your etl table] b on b.QueuedIDs = a.QueuedIDs
--COMMIT TRAN
I'm trying to write a simplified SQL Delete statement using an etl table I already have.
Instead of writing it out like"
BEGIN TRAN
DELETE FROM [table name] WHERE [column name] = 12345
DELETE FROM [table name] WHERE [column name] = 12346
--and so on
--COMMIT TRAN
I want to use an etl table that I called... RW_sn201 that has over 112 items in the spreadsheet.
So I don't want to write 112 delete statements... I just want to write 1 delete statement that will encompass my etl table's contents.
I wrote it once, but I cannot for the life of me remember how it was written. It's been well over 2 years since I've ever wrote one again and now I need to do so now... and completely forgot.
Googling it has not been helpful. Please help...
If it makes it easier, the column name in my etl is called "QueuedIDs".
Nevermind, I managed to figure it out.
Anyone that had the same question I had, use the below and just add in your table info:
BEGIN TRAN
DELETE a FROM [table name] a
INNER JOIN [your etl table] b on b.QueuedIDs = a.QueuedIDs
--COMMIT TRAN
Yes, delete using a join is a common thing yet surprisingly there are lots who do not know about it.
Good to hear you got it worked out.
Yes, delete using a join is a common thing yet surprisingly there are lots who do not know about it.
Good to hear you got it worked out.
Agreed. I started with Oracle and always used WHERE EXISTS. That's what I continue to use with SQL Server.
Alec6638
I have a "traditional" on-prem small office setup. Server hardware getting a little dated (Dell 12G v current 15G), OS is 2016 Core w/Hyper-V/Server Essentials 2016, < 30 Windows 10 clients, GPO for about 20 mapped drives and printer deployment, less than...
I'm looking for a recommendation for a web based, locally hosted document management system. We're needing something to host our companies Policies and Procedures that makes it easier for the staff to pull them up when they need them. Currently they're ju...
Your daily dose of tech news, in brief. Welcome to Friday, everyone! You need to hear this. DuckDuckGo browser now blocks all third-party Microsoft trackers As some of you may remember, DuckDuckGo got some, shall we say, feedback a few mon...
Good morningI have a VSphere infrastructure of approx. 80 servers. 10x on 2012 R2, 50x on Windows Server 2019 and 20x on Server 2022.Before anyone says it, I don't always in-place upgrade and would much rather rebuild a new server when it comes to upgradi...
Afternoon all, I'd say I have a pretty strong grasp of WiFi technology overall but I don't really deal with it very often these days and I'm trying/failing to find a clear answer on something... Is it possible to have office WiFi that would allow you to w...