in that store procedure in a particular database and finally as a result the store procedure should reflect in
that database with the mentioned above query.
Please guide me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Aug 12, 2013, 11:32 PM
hi,
I think, in this can you can use Command object as well as SQL Management Objects (SMO).
Please refer
http://www.codeshode.com/2011/06/create-alter-drop-stored-procedures.html
using command object
cmd.CommandText = @"exec('CREATE PROCEDURE MyTest
AS
BEGIN
select * from testTable
END')";
cmd.ExecuteNonQuery();
hope this will help you.