Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 delete problem

Author  Topic 

zubair
Yak Posting Veteran

67 Posts

Posted - 2004-05-10 : 06:54:50
I have a select statement that return me the id column of files to delete like so

select [file].fileId
from [file] inner join
fileType on [file].fileTypeId = fileType.fileTypeId
where [file].assetId = '292332E5-C042-4020-AA8D-A036294D19D7'
and fileType.resolution = 'high'

this shoudl return me say 2 fileid values which are uniqueidentifiers
232312FA-2650-47C8-9F28-73AE3B203244
FFE6236B-663F-4A91-A693-6DBCD24E7520

I then want to do a delete from the [file]. table where these values exist?

This looks simple to do but I'm stuck on doing a delete where there is more than one value to do a delete on

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-05-10 : 07:07:18
[code]
delete from [file] where fileid in (select [file].fileId
from [file] inner join
fileType on [file].fileTypeId = fileType.fileTypeId
where [file].assetId = '292332E5-C042-4020-AA8D-A036294D19D7'
and fileType.resolution = 'high')
[/code]
Go to Top of Page

zubair
Yak Posting Veteran

67 Posts

Posted - 2004-05-10 : 07:12:53
thanks! this works
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-05-10 : 07:32:24
Of course it does...
Go to Top of Page
   

- Advertisement -