How to declare a variable in SQL Server and use it in the same Stored Procedure

后端 未结 4 1053
再見小時候
再見小時候 2021-02-03 17:57

Im trying to get the value from BrandID in one table and add it to another table. But I can\'t get it to work. Anybody know how to do it right?

CREATE PROCEDURE          


        
4条回答
  •  迷失自我
    2021-02-03 18:31

    In sql 2012 (and maybe as far back as 2005), you should do this:

    EXEC AddBrand @BrandName = 'Gucci', @CategoryId = 23
    

提交回复
热议问题