Dynamic SQL results into temp table in SQL Stored procedure

后端 未结 8 1371
孤独总比滥情好
孤独总比滥情好 2020-11-28 10:08

The code is as follows:

ALTER PROCEDURE dbo.pdpd_DynamicCall 
@SQLString varchar(4096) = null

AS

Begin

    create TABLE #T1 ( column_1 varchar(10) , colu         


        
8条回答
  •  情歌与酒
    2020-11-28 10:51

    Not sure if I understand well, but maybe you could form the CREATE statement inside a string, then execute that String? That way you could add as many columns as you want.

提交回复
热议问题