我有一个类似于下面的存储过程:
ALTER Proc
BEGIN
if object()... drop... #temp_table
select
a,
b,
INTO #temp_table
From physical_table
if object()... drop... physical_table2
select *
into physical_table2
From #temp_table
END
我想在存储过程的临时表内添加一个附加列
赞:
ALTER Proc
BEGIN
select
a,
b,
C <-- NEW COLUMN ADDED
INTO #temp_table
From physical_table
select *
into physical_table2
From #temp_table
END
但是,我收到“无效的列名'C'错误”>
现在,这是一个简单的解决方法...我可以先突出显示并运行存储过程的内部语句,然后执行“ Alter Proc”语句,但是我需要将脚本交给IT来执行。有人告诉我在存储的proc脚本之前创建另一个脚本,以更改临时表并添加该列...但不确定如何执行此操作?
我有一个类似于以下的存储过程:如果object()... drop ... #temp_table,则选择a,b,INTO #temp_table从object_table中选择a,b,INTO #temp_table if object()... drop ... physical_table2。 ..
此代码: