日期:2014-05-17 浏览次数:20551 次
declare @xmlData nvarchar(max)
set @xmlData = 'select * from _role where roleid=5 for xml path(''_role'')'
exec(@xmlData)
INSERT into _operateLog (employeeid,clientId,recordData,operateType,operateTime,operateMsg,moduleName)
values(1,1,exec(@xmlData),1,getdate(),'添加了部门节点','部门')
declare @xmlData XML,
@tbName nvarchar(20),
@Sql nvarchar(max)
set @tbName='role'
set @Sql = 'set @xmlData=(select * from '+@tbName+' where roleid=5 for xml path(''' + @tbName + ''')'
exec sp_executesql @Sql,N'@xmlData xml output',@xmlData OUTPUT
INSERT into _operateLog (employeeid,clientId,recordData,operateType,operateTime,operateMsg,moduleName)
values(1,1, @xmlData,1,getdate(),'添加了部门节点','部门')