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)
 Conditional creation of stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-27 : 07:55:27
Daniel Crane writes "I really need to be able to write a sql script, that checks for a condition before creating a stored procedure.

Now I've already done the:

If condition = true
begin
EXECUTE('Create procedure etc...')
end

But this has a problem running as a batch file, why? I don't know the same script works fine when running from Query Analyzer. Is there any other way to write the script that would be different, and possibly resolve my issue?

Using SQL Server 2000."

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-27 : 08:07:11
Creating Stored Procedure Dynamically is not recommended
Why do you want to do this?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-09-28 : 02:08:33
if this is to create objects as part of installer
read sql-dmo in books online

HTH

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -