Creating Stored Procedure...

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

Eric,

I want to create a SP based on the availability of a particular table i.e., I would check the existence of the table, if exists then I shall create a SP. Q. How should I achieve it?

Note : I tried... if exists (...............particular table) Create proceudre ( ........ ........ )

error : create procedure should be the first command in the query batch.

Your help would be appreciated.

Thanks, Kothans.

-- Anonymous, January 06, 1999

Answers

Kothans,

Try:

if exists (...............particular table) exec ("Create procedure ( ........ ........ )")

Eric

-- Anonymous, January 06, 1999


Moderation questions? read the FAQ