|
if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Demo_DeleteEmployee]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
select 'Missing procedure Demo_DeleteEmployee'
else if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Demo_GetEmployee]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
select 'Missing procedure Demo_GetEmployee'
else if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Demo_GetEmployeeSubordinates]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
select 'Missing procedure Demo_GetEmployeeSubordinates'
else if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Demo_SaveEmployee]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
select 'Missing procedure Demo_SaveEmployee'
else if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Demo_Employee]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
select 'Missing table Demo_Employee'
Else If not exists
( select * from dbo.syscolumns where name = 'EmployeeID' and id =
(select id from dbo.sysobjects where id = object_id(N'[dbo].[Demo_Employee]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
)
Select 'Missing column EmployeeID on table Demo_Employee'
Else If not exists
( select * from dbo.syscolumns where name = 'ManagerID' and id =
(select id from dbo.sysobjects where id = object_id(N'[dbo].[Demo_Employee]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
)
Select 'Missing column ManagerID on table Demo_Employee'
Else If not exists
( select * from dbo.syscolumns where name = 'FirstName' and id =
(select id from dbo.sysobjects where id = object_id(N'[dbo].[Demo_Employee]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
)
Select 'Missing column FirstName on table Demo_Employee'
Else If not exists
( select * from dbo.syscolumns where name = 'LastName' and id =
(select id from dbo.sysobjects where id = object_id(N'[dbo].[Demo_Employee]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
)
Select 'Missing column LastName on table Demo_Employee'
Else select '*' /* latest version */
GO
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Mike has worked in the .Net platform since the beta 2 release of version 1.0. Before that he worked on VB6 windows forms applications automating other applications such as AutoCAD and "Intent".
Mike has released a number of open source applications in javascript and C#.Net. Most of them can be found on github.
github/michael-lang
You can find older .Net open source projects on sourceforge at:
http://sourceforge.net/users/versat1474/
Mike is currently blogging at
candordeveloper.com