SQL In book not working
I'm working my way through Beginning SQL Server 2005 Administration and I'm in Chapter 8, page 306. The exercise includes creating a stored proc for inserting a credit card that will cause an error to be raised. The code is:
CREATE PROCEDURE AddNewCreditCard
@CardType nvarchar(50),
@CardNumber nvarchar(25),
@ExpMonth tinyint,
@ExpYear smallint
AS
DECLARE @username varchar(60)
DECLARE @loginame varchar(60)
DECLARE @CreditCardInfo Table(CreditCardID INT)
DECLARE @CreditCardID INT
SET @loginame = suser_sname()
SET @username = user_name()
I keep getting the following error:
Msg 8152, Level 16, State 2, Procedure RecordDDL, Line 8
String or binary data would be truncated.
The statement has been terminated.
Everything looks good. The sizes for card type and number match the table and creditcardinfo is INT.
Why is the code getting an error? I feel silly asking this, but that's life.
B
|