Showing posts with label logs. Show all posts
Showing posts with label logs. Show all posts

Sunday, March 25, 2012

Droping active connections

I have a database that is not droping connections when a
user logs out. Is there anyway to drop multiple
connections to a database? Or is there a way to drop all
connections for a specific user?
Thanks in advance,
SteveJeff,
Thanks. This worked great. It did exactly what I wanted
it to do with just a little bit of tweaking.
Thanks Again,
Steve
>--Original Message--
>there is no built-in way to drop all connections for a
>database or a user, but you can write your own stored
>procedure to exactly do that.
>-- Example
>declare @.dbname sysname
>set @.dbname = 'pubs'
>declare c1 cursor for
>select cast('kill ' as nchar(6)) + cast(spid as nchar
(5))
>KillCommand
> from master..sysprocesses
> where spid > 50
> and spid <> @.@.spid
> and program_Name not like 'SQLAgent%'
> and dbid = db_id(@.dbname)
>declare @.KillCommand nvarchar(60)
>open c1
>fetch c1 into @.KillCommand
>while @.@.fetch_status = 0
>begin
> print @.KillCommand
> exec sp_executesql @.KillCommand
> fetch c1 into @.KillCommand
>end
>close c1
>deallocate c1
>--
>>--Original Message--
>>I have a database that is not droping connections when
a
>>user logs out. Is there anyway to drop multiple
>>connections to a database? Or is there a way to drop
all
>>connections for a specific user?
>>Thanks in advance,
>>Steve
>>.
>.
>

Friday, February 24, 2012

Drive missing from Enterprise Manager

Hi,

I have an SQL cluster on Windows 2003 with 2 drives (1 for dbs and 1 for logs). Both of these drives are accessible from Windows explorer.

In Enterprise Manager only the db drive appears as a location to house dbs and logs.

I can't work out how to get the second drive to appear and adding the path manual doesn't work as I end up with the other drive letter appending to the front eg "y:\z:\logs"

Has anyone seen this or have any ideas how to fix it?

Help much appreciated.What's your cluster like? Active/Passive or Active/Active?|||The cluster is active/passive.

Just figured it out, I forgot to add the log drive to the dependennce list for the SQL service.