Finding out if an object esists using SQL Server SMO

  • Thread starter Thread starter Patrick Hill
  • Start date Start date
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])
 
theserver.Databases("DBName").StoredProcedures.Contains("spGetActiveEmps")

HTH, Jakob.
 
Back
Top