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

mac2024-05-22  31

 直接上代码 

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')

 

最新回复(0)