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
 SQL Server Administration (2000)
 Net Send Message to Particular Database Users

Author  Topic 

Tracey
Starting Member

40 Posts

Posted - 2004-06-17 : 22:51:05
Hello Everyone,
Is there anyway to send messages(net send) to users connected to a particular Database?

I know the following command send messages to all users connected to that Server? Actually i never tried cos it might slow down the network.

EXEC xp_cmdshell 'net send /users' 'This is a Test Message, Please Ignore'

I want to send messages to users who connected to a Particular Database,during Database Restore etc..

Thanks in Advance

Tracey

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-06-17 : 23:51:25
What are you going to do about users connected through an application? You won't know their NT account. They might not even have one if they are internet users.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-06-18 : 01:08:08
quote:
Originally posted by Tracey

I want to send messages to users who connected to a Particular Database,during Database Restore etc..

I like your style Tracey! Perhaps you could fire them by NET SEND too!

You could set the database to DBO only, which would presumably prevent them connnecting (provided you don't have any apps connecting as SA)

But I think the "options" on a DB are stored in the backup, so a restore will put it back to normal (which may be just fine, of course, if its just a RESTORE and not a RESTORE-and-then-have-a-quick-look).

I expect you'll have to throw (KILL) the connected users off before you can change to DBO only, but that's also true of RESTORE, so I suppose getting the DB to DBO-only before a RESTORE is a good idea anyway - as there is, otherwise, a window of opporunity between issuing the restore and it starting for folk to connect.

Hmmm ... maybe I should do that too ...

Kristen
Go to Top of Page
   

- Advertisement -