select ステートメントで tablename 変数を使用したいのですが、エラーが発生しています
-テーブル変数 "@table" を宣言する必要があります
alter PROCEDURE testTblName
(
@id int,
@name varchar(50)
)
AS
BEGIN
declare @table varchar(50)
declare @add varchar(150)
set @table = 'DBTest..testMaster'
select @add = address from @table where id=@id and name=@name
END
これは私のコードのスナップショットです