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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Aug 12, 2013, 7:32 PM EDT
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.