Connecting Tech Pros Worldwide Forums | Help | Site Map

how can we convert prepare satament of mysql into mssql

Newbie
 
Join Date: Nov 2008
Posts: 2
#1: Nov 19 '08
i want to convert this mysql code into mssql.

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



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

ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#2: Nov 19 '08

re: how can we convert prepare satament of mysql into mssql


Just use EXEC (@statement_variable) directly. You don't need to prepare the statement, but you have to build the dynamic query string.


-- CK
Newbie
 
Join Date: Nov 2008
Posts: 2
#3: Nov 20 '08

re: how can we convert prepare satament of mysql into mssql


Quote:

Originally Posted by ck9663

Just use EXEC (@statement_variable) directly. You don't need to prepare the statement, but you have to build the dynamic query string.


-- CK

its working fine . thanks for ur guideline.
Reply