0
最初,我將使用存儲過程(SP1)將源表的所有列存儲到單個變量。此SP1在SP2內部調用,並且該變量被插入到目標表中。如何使用存儲過程將完全相同的一個表的模式複製到另一個表
我知道這種方法,但堅持實施它。
-- SP1
Create procedure insert_data
AS
Declare @data nvarchar(60)
Begin
EXEC get
--Here i have to insert
END
Go
--SP2
Create procedure get_column
AS
Declare
@e_id int , @e_name nvarchar(20) , @d_id int,@res nvarchar(50)
Begin
SET @e_id =(select Emp_ID from Dim_Employee where Emp_Name='Cathy');
SET @e_name =(select Emp_Name from Dim_Employee where emp_id=101);
SET @d_id =(select Dept_ID from Dim_Employee where emp_name='Cathy');
SET @res ='@e_id , @e_name , @d_id';
return @res
END
Go
請使用圖片避免。改爲在問題中複製並粘貼代碼。 –