SqlServe中使用EXEC @sql 来传递table变量

 直接上代码 

IF OBJECT_ID('tempdb..#userConditionTable') IS NOT NULL
            DROP TABLE #userConditionTable;
        CREATE TABLE #userConditionTable
        (
            openId VARCHAR(50),
						user_name VARCHAR(100)
        );
        INSERT INTO #userConditionTable
        (
            openId,
						user_name
        )
	    EXEC('select openid,name from user')
发布了121 篇原创文章 · 获赞 48 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/liuchang19950703/article/details/102839856