Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to copy database

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-16 : 09:36:32
khurram sultan writes "i am a visual basic programmer and i ve developed an inventory system now i have given that inventory system to many customers. lets say that when i gave project to my customer i had two coumns in the table named as customers they have added their customers and that table now contains data now i have added a new coulmn. Now i ve done alot of ammenments in the database i need to check that if the table exists then it should not be created and if it doent exist then it should be created and in this way column view n stor4ed procedures is there a way to do it
plese reply as soon as possible
thanks"

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-08-16 : 09:42:25
If Not Exists (Select * from sysobjects Where [Name] = 'yourtable' And xType = 'U')
--Create the Table

If Not Exists (Select * from sysobjects Where [Name] = 'yourtable' And xType = 'V')
--Create the View

If Not Exists (Select * from sysobjects Where [Name] = 'yourtable' And xType = 'P')
--Create the Stored Procedure




Chirag
Go to Top of Page
   

- Advertisement -