SQL Azure - Create Stored Procedures



Create Stored Procedure using SQL Azure

protected void Page_Load(object sender, EventArgs e)
    {
//stoaxy9 - unique server that is generated automatically for your account. Make trusted connection to false. 
        string sConn = "Server=tcp:stoaxy9.database.windows.net;
        Database=SyntaxHelpTestDB;User ID=Hima;	Password=password;Trusted_Connection=False";

        SqlConnection objConn = new SqlConnection(sConn);
        objConn.Open();

        string sSQL = "CREATE PROCEDURE GetNames AS SELECT * FROM SyntaxHelpTestTable";

        SqlCommand objCmd = new SqlCommand(sSQL, objConn);
        objCmd.CommandType = System.Data.CommandType.Text;

        objCmd.ExecuteNonQuery();
        objConn.Close();

    }

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.