Saturday, February 25, 2012

Developing Stored Procedures using Management Studio Express

Hi,

I am new to SQL server 2005. I am developing stored procedures as follows in Management Studio:

1)Right click Stored Procedures folder on a database
2)Select "New Stored Procedure"
3)Write the query in a .sql file
4)Execute the query.

Now in this model, I dont seem to have a develop->test->develop and then deploy, type of development cycle. The problem is each time I execute a query it is deployed and re-executing it results in an error like: "There is already an object named 'NewEmployee' in the database." Which forces you to manually delete the SP and re-execute your query. It doesn't give you a chance to test your SP logic before deploying. Contrary to this, If I developed CLR SP's in Visual Studio, I would test/debug the procedure, and then "deploy" it later when I'm finished with it. Can I not do this in Management Studio?

Thanks,
Bahadir

right click the existing stored proc

click on "script stored procedure as">alter>"new query editor"

modify the scripts

and run

|||Doh! I think this was a bit stupid question. More clever next time :)

Thanks,
Bahadir

No comments:

Post a Comment