Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display user name of the user who has a lock on a database. 1

Status
Not open for further replies.

jabmod

MIS
Sep 12, 2004
68
US
Our SQL server as the back-end has several database on the network.
Users have access to specific databases .
These databases are locked at different times when changes like edits and deletes are going on.

I would like to display the user name of the user who has the lock on a message pop up that currently say "database is locked by another user"

This would allow the user to be contated if the lock takes too long.

Thank you.
jabmod
 
nigelrivett

I have tried using your SP but keep getting error:

Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict.

any ideas why ?

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
nigelrivett

sorry that error message was from your other stored procedure sp_CreateDataLoadScript.

cheers

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Suspect that's because tempdb has a different collation to the database.

Can get round it by using collate database_default on the char columns.

======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top