我正在关注这篇文章:SQL:INSERT INTO...VALUES..SELECT
我的问题是如何声明从 SELECT 语句中分配值的临时 @value1 ?我有类似的东西
CREATE PROCEDURE name
(
@arg1 as type1,
@arg2 as type2
)
AS
@value1 = SELECT x from tabley WHERE <something>
INSERT INTO Table(x,y,z) VALUES(@arg1,@arg2,@value1)
但我不知道在哪里声明和设置@value1??