Finding out if an object esists using SQL Server SMO

P

Patrick Hill

Is there a way using SMO to find out if an object exists?

I want to find out if this sp exists on the server

[dbo].[spGetActiveEmps]

I know I would have to use something like:

theserver.Databases.Item(DBName).StoredProcedures.Item([dbo].[spGetActiveEmps])
 
G

Guest

theserver.Databases("DBName").StoredProcedures.Contains("spGetActiveEmps")

HTH, Jakob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top