Does anyone know of an SQL statement that I can use to see if a database or login/user exists?
Should tell you everything you need to know...
Where in there, I looked.
It should be in database, general... titled "How do I tell if a record already exists?" I don't know the number or link, but you could search on that.
I am looking to see if a user or database exists and not a record
I woulda thunk.<BR><BR>You just query in the master database...<BR><BR>if exists(dbo.master.whateverdatabase)<BR><BR><BR>I could be wrong though.
What about to check if a user/login exists?
List all users<BR>This example lists all users in the current database.<BR><BR>EXEC sp_helpuser<BR><BR>