I’m trying to do this in my stored procedure:
declare @CategoryId int
-- stuff
IF EXISTS (select A_categoryId from dbo.categories
where B_categoryId = @b_categoryId
and C_cactegoryId = @c_categoryId
)
-- it doesn't like the following line:
@CategoryId = select A_categoryId from dbo.categories
where B_categoryId = @b_categoryId
and C_cactegoryId = @c_categoryId
but it doesn’t like the way it’s structured. any ideas?
SELECT @CategoryId = A_categoryId from dbo.categories...That being said, please don’t post questions about how to assign variables on SO. This is really way below the scope of what the site is about and could have been resolved by reviewing any documentation for SQL Server.