6/21/2026 2:29:24 AM
|
| |
| slxdeveloper.com Community Forums |
|
| |
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss SQL Server or Oracle database administration related to SalesLogix databases. View the code of conduct for posting guidelines.
|
|
|
|
SQL Maintenance Hangs Because Of SLX Query
Posted: 28 Jul 08 12:29 AM
|
I have some maintenance scripts that run on a weekend including reindexing, updating statistics etc. What I am finding is when they kick off they get "stuck" by a NETWORKIO lock created by a user that has not closed the SLX client. (just a select statement from a group) It is almost always caused by 1 particular user but it has happened on others. I kill the process for the user and everything runs fine.
It's SLX 5.2 with SQL2000. I have no problems with locks, performance during the week and if I restart the SQL service before the maintenance runs, the maintenance runs without a problem.
Any ideas? Thx Leon |
|
|
| |
| |
|
Re: SQL Maintenance Hangs Because Of SLX Query
Posted: 28 Jul 08 2:14 AM
|
OK, I'm plagiarising here - thanks to SQLServerCentral.com and users there.
First thing to do is create a stored procedure somewhere - ideally in your Master database:
CREATE PROCEDURE kill_database_users @arg_dbname sysname with recompile AS
-- kills all the users in a particular database -- dlhatheway/3M, 11-Jun-2000
declare @a_spid smallint declare @msg varchar(255) declare @a_dbid int
select @a_dbid = sdb.dbid from master..sysdatabases sdb where sdb.name = @arg_dbname
declare db_users insensitive cursor for select sp.spid from master..sysprocesses sp where sp.dbid = @a_dbid
open db_users
fetch next from db_users into @a_spid while @@fetch_status = 0 begin select @msg = 'kill '+convert(char(5),@a_spid) print @msg execute (@msg) fetch next from db_users into @a_spid end
close db_users deallocate db_users GO
Once this is created, to disconnect users from a particular database (let's use 'SalesLogix_Eval' as an example), you just need to issue this command:
exec kill_database_users 'SalesLogix_Eval'
Be careful when you test this 
I take no responsibility for the code, by the way - just trying to help.
Phil
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|