使用字符串连接的方式来执行Sql语句
declare @str varchar(8000) set @str='select * from ' + 'table1' exec(@str) 也就是通过声明一个字符串变量,并把要执行的语句存入字符串中,然后使用exec()函数来执行它
使用字符串连接的方式来执行Sql语句
最新推荐文章于 2024-04-19 21:48:11 发布
使用字符串连接的方式来执行Sql语句
declare @str varchar(8000) set @str='select * from ' + 'table1' exec(@str) 也就是通过声明一个字符串变量,并把要执行的语句存入字符串中,然后使用exec()函数来执行它