Click here to monitor SSC

prepare statement

Last post 11-20-2008, 7:54 AM by Phil Factor. 1 replies.
Sort Posts: Previous Next
  •  11-19-2008, 4:17 AM Post number 70528

    • akbar is not online. Last active: 03-25-2011, 3:05 AM akbar
    • Not Ranked
    • Joined on 11-19-2008
    • Mumbai, India
    • Level 1: Deep thought

    prepare statement

    i want to convet mysql code into the MS sql server.since there is no prepare keywordin mssql so plz help me to code equivalent code to this follwing code..

    SET  strSTMTDEFINATION =  Concat(SUBSTRING(strSTMTDEFINATION,1,LENGTH(strSTMTDEFINATION) -1),");");



    SET @myCREATE := strSTMTDEFINATION;
    PREPARE stmt FROM @myCREATE;
    EXECUTE stmt;

    here @myCREATE is global variable.i do not found any prepare keyword.
    so plz help me to convert this code for mssql.

    Akbar Mahrat
  •  11-20-2008, 7:54 AM Post number 70546 in reply to post number 70528

    Re: prepare statement

    You'll find that the sp_executeSQL procedure has both input and output variables, and will do what you want.
    http://msdn.microsoft.com/en-us/library/ms188001.aspx
View as RSS news feed in XML