我有以下存储过程:
create procedure new (@user nvarchar(50))
as
Declare @ids uniqueidentifier
set @ids = (
select id from table6 where name = @user and @ids = id)
SELECT * from table1 as 1, table2 as 2
where 1.id = @ids
它没有返回正确的结果 - 它没有返回任何内容。它似乎将变量 ( @ids
) 作为空传递。