SqlServer stored procedure is created using the table

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/Nash_Cyk/article/details/89948599

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[new_pr_create_pressure_table]
    @table nvarchar(64)    
AS
BEGIN

EXEC(
    'CREATE TABLE [dbo].' + @table + '([Num] [bigint] NOT NULL)  ON [PRIMARY]')

END
 

Common parameters fail directly, using EXEC to execute the corresponding string.

Guess you like

Origin blog.csdn.net/Nash_Cyk/article/details/89948599