Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO sql procedure error

Status
Not open for further replies.
Jun 25, 2006
25
US
Im basically designing a VB program that takes user inputs to add a new row to an "Employees" table. My procedure in SQL is giving me trouble though, and i don't know why.

Code:
CREATE PROCEDURE up_New_Employee
@LastName nvarchar(20),
@FirstName nvarchar(10),
@Title nvarchar(30),
@TitleOfCourtesy nvarchar(25),
@BirthDate datetime,
@HireDate datetime,
@Address nvarchar(60),
@City nvarchar(15),
@Region nvarchar(15),
@PostalCode nvarchar(10),
@Country nvarchar(15),
@HomePhone nvarchar(24),
@Extension nvarchar(4),
@Notes ntext(16),
@ReportsTo int
AS
DECLARE @EmployeeID int,
 
INSERT INTO Employees (EmployeeID, LastName, FirstName,
Title, TitleOfCourtesy, BirthDate, HireDate, Address,
City, Region, PostalCode, Country, HomePhone, Extension,
Notes, ReportsTo)
VALUES ( @EmployeeID, @LastName, @FirstName, @Title,
@TitleOfCourtesy, @BirthDate, @HireDate, @Address,
@City, @Region, @PostalCode, @Country, @HomePhone,
@Extension, @Notes, @ReportsTo)

Server: Msg 156, Level 15, State 1, Procedure up_New_Employee, Line 20
Incorrect syntax near the keyword 'INSERT'.

Any ideas on what could be wrong? This is my first time trying an INSERT INTO statement.
 
Nevermind, i solved it... I had one too many commas and ntext does not have a datatype length. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top