You are currently viewing the BOOK: Expert SQL Server 2005 Integration Services ISBN: 978-0-470-13411-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
HI, on page 231 of the book, it is wtritten that a script called usp_killusers can be found on www.wrox.com. Whne I seach in downloads on wrox.com, I do not find it. Where can I find this script?
create proc usp_killusers
@dbname varchar(30)
as
declare @sql varchar(60)
declare kill_cur cursor fast_forward for
select 'kill ' + cast(spid as varchar) from master.dbo.sysprocesses where dbid = db_id(@dbname)
open kill_cur
fetch next from kill_cur into @sql
while @@fetch_status = 0
begin
exec(@sql)
fetch next from kill_cur into @sql
end
close kill_cur
deallocate kill_cur
go
quote:Originally posted by dakaratekid
You can just roll your own:
create proc usp_killusers
@dbname varchar(30)
as
declare @sql varchar(60)
declare kill_cur cursor fast_forward for
select 'kill ' + cast(spid as varchar) from master.dbo.sysprocesses where dbid = db_id(@dbname)
open kill_cur
fetch next from kill_cur into @sql
while @@fetch_status = 0
begin
exec(@sql)
fetch next from kill_cur into @sql
end
close kill_cur
deallocate kill_cur
go
hth, dKK
HI, Thanks for your help! But the book should not tell readers something that seems to be not exact. If the usp_killusers exists, it should be available here. But waht you gave me will do the job.