将SQL表中的数据导出成一批INSERT语句.

 

select 'insert into UserRight (ID, parentId, rightId, rightType, userGrade, isDefault, url, module, menuname) 
values (
'+ convert(varchar,ID)+','+ convert(varchar,parentId)+','+ convert(varchar,rightId)+','''+ rightType +''','+ convert(varchar,userGrade)+','+ convert(varchar,isDefault)+','''+ url +''''+','''+ module +''''+','''+ menuname +''')' from UserRight

重要的是控制好字符串的引号就可以了...
posted @ 2008-04-03 13:17  zhengguoqing  阅读(312)  评论(0)    收藏  举报