Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 SQL Server中的参数化存储过程-错误“;列名称不明确';musictypeID'&引用;_Sql Server 2008 - Fatal编程技术网

Sql server 2008 SQL Server中的参数化存储过程-错误“;列名称不明确';musictypeID'&引用;

Sql server 2008 SQL Server中的参数化存储过程-错误“;列名称不明确';musictypeID'&引用;,sql-server-2008,Sql Server 2008,我一直在处理SQL Server中的参数化存储过程,但遇到一个错误 列名称“musictypeID”不明确 代码: 两个表都有musictypeID,因此需要在where子句中指定一个 将where musictypeID=@musictypeID更改为where musicc.musictypeID=@musictypeID两个表都有musictypeID,因此需要在where子句中指定一个 将其中musictypeID=@musictypeID更改为其中musicc.musictypeID=

我一直在处理SQL Server中的参数化存储过程,但遇到一个错误

列名称“musictypeID”不明确

代码:


两个表都有
musictypeID
,因此需要在
where
子句中指定一个


where musictypeID=@musictypeID
更改为
where musicc.musictypeID=@musictypeID
两个表都有
musictypeID
,因此需要在
where
子句中指定一个

其中musictypeID=@musictypeID
更改为
其中musicc.musictypeID=@musictypeID

create procedure getmusicbytype
    (@musictypeID int)
as
begin
    select * 
    from musicc 
    inner join MusicType on musicc.musictypeID = MusicType.musictypeID
    where musictypeID = @musictypeID
end