執行字符串 sql

執行字符串 sql

==

SET @SqlStr=N'delete  from '+@batchdataTable+'
                where exists( select 1 from csps_batch t2  
                                where batchid =t2.batchid     
                                and t2.lupdtime <=convert(datetime,'''+@dBefHusrKp+''',103)     
                                and status in (''A'',''D''))';
                --select @SqlStr as col;   
                exec sp_executesql @SqlStr ;  

posted @ 2011-06-10 10:40  左安  阅读(161)  评论(0编辑  收藏  举报