存儲過程標識列
CREATE PROCEDURE [dbo].[Insert_Customer]
@id int,
@FName varchar(50) ,
@MName varchar(50) ,
@LName varchar(50) ,
@Age int ,
@Citizen varchar(50),
@Gender varchar(50) ,
@DOB varchar(50) ,
@Status varchar(50) ,
@Nationality varchar(50) ,
@Country varchar(50) ,
@State varchar(50) ,
@City varchar(50) ,
@Address varchar(MAX) ,
@Pin varchar(50) ,
@AccNo int IDENTITY (100,1),
@Branch varchar(50) ,
@IDProof varchar(50) ,
@IDNo varchar(50) ,
@IDName varchar(50) ,
@DOI varchar(50) ,
@Date datetime
AS
BEGIN
Insert into tbl_Customer1
values(@id,@FName,@MName,@LName,@Age,@Citizen,@Gender,@DOB,@Status,@Nationality)
Insert into tbl_Customer2
values(@id,@Country,@State,@City,@Address,@Pin,@accno ,@Branch)
Insert into tbl_Customer3
values(@id,@IDProof,@IDNo,@IDName,@DOI,@Date)
END
在這裏的錯誤是
Msg 156, Level 15, State 1, Procedure Insert_Customer, Line 28
Incorrect syntax near the keyword 'IDENTITY'.
Msg 137, Level 15, State 2, Procedure Insert_Customer, Line 42
Must declare the scalar variable "@accno".
Msg 137, Level 15, State 2, Procedure Insert_Customer, Line 44
Must declare the scalar variable "@IDProof".
第一個錯誤:你**不能**有存儲過程的參數被聲明爲INT INTENTIYT列.... –