|
Ok, I’m talking to myself I know, here’s the solution if
anyone cares. Andrew, your pointer got me looking in a different
direction that found this. <cfquery name="query" datasource="master"> IF EXISTS(SELECT * FROM sysdatabases WHERE
name='#arguments.stack#') BEGIN DECLARE @db NVARCHAR(50) SET @db = N'#arguments.stack#' DECLARE @sql VARCHAR(8000) SET @sql = '' SELECT @sql = @sql + 'KILL ' + CAST(spid
AS VARCHAR(6)) + ' ' FROM master..sysprocesses WHERE DB_NAME(dbid) = @db AND spid >
6 --PRINT 'Kill cmd = ' + @sql EXEC (@sql) DROP DATABASE #arguments.stack#; END </cfquery> Regards From:
Andrew, I did a bit of a search and there is a SP sp_who2
which lists all the processes, including what DB’s So I could loop through that and then issue a kill
on all the relevant processes. I thought there might be an easier way, like a force
option on DROP or a CLEAR command. Regards From:
Dale, Wouldn’t a SP work then call that via CF? Senior Coldfusion Developer Aegeon Pty. Ltd. Phone: +613 8676 4223
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~--- |
- [cfaussie] Re: OT: DROP Database Andrew Scott
- [cfaussie] Re: OT: DROP Database Dale Fraser
- [cfaussie] Re: OT: DROP Database Andrew Scott
- [cfaussie] Re: OT: DROP Database Dale Fraser
- [cfaussie] Re: OT: DROP Database Dale Fraser
- [cfaussie] Re: OT: DROP Database Andrew Scott
