I'm creating views and stored procedures in my database via a script. If a certain table does not exist, I don't want to create some of the objects, so I want to exit the script at that point, or put a condition if/then loop around that part of the script.
2006-09-26
06:37:22
·
3 answers
·
asked by
colo programmer
1
in
Computers & Internet
➔ Programming & Design
Quit doesn't work, and I've tried EXIT, but get an error.
2006-09-28
07:58:58 ·
update #1
I did the if exists thing, but there are many objects I want to create if a certain table exists. I tried a begin end loop, but got an error with that, too. if exist (anntab)
begin create view1 go create view2 go create storedproc1 go end
gives me errors.
2006-09-28
11:32:27 ·
update #2