Link to home
Create AccountLog in
Avatar of marku24
marku24Flag for United States of America

asked on

INSERT statement syntax in SQL Server 2008

I am new to SQL coding and am trying to get an INSERT Statement using parameters to work.  I get two errors here when trying to create this procedure.  Both seem to revolve around the date parameter.  

CREATE PROCEDURE spAddAssetInventory
      -- Add the parameters for the stored procedure here
      @AssetName nchar
      @AssetDate datetime
      @AssetFlag nchar  
      @AssetID int      
AS
BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;

    -- Insert statements for procedure here
      INSERT INTO  dbo.tbl_AssetInventory(AssetID, AssetName, AssetInServiceDate, AssetInventoryActiveFlag)
      VALUES     (@AssetID,@AssetName,@AssetDate,@AssetFlag)
END
GO
Avatar of Koen Van Wielink
Koen Van Wielink
Flag of Netherlands image

It would really help if you can post the error messages you're getting. Also, what are the datatypes of your table columns?
ASKER CERTIFIED SOLUTION
Avatar of HugoHiasl
HugoHiasl

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of marku24

ASKER

that was it exactly, thanks