Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Location
    India
    Posts
    21

    Unanswered: Insert Error: Column name or number of supplied values

    In SQL 2005 I created table as

    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[logMsg](
    [logMsgID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
    [msg] [nvarchar](256) COLLATE Latin1_General_CI_AS NOT NULL,
    [AppId] [int] NULL,
    CONSTRAINT [PK_logMsg] PRIMARY KEY CLUSTERED
    (
    [logMsgID] ASC
    )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]

    and trying to insert values with

    INSERT INTO [ProxyDB].[dbo].[logMsg]
    ([msg]
    ,[AppId])
    VALUES
    ('Text Test',1)

    Getting error message:

    Msg 213, Level 16, State 1, Procedure TrgInslogMsg, Line 14
    Insert Error: Column name or number of supplied values does not match table definition.


    Urgent help is required

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    it worked fine for me, after i took the [ProxyDB] off the front (obviously i created the table in a different database)

    are you sure you declared the table in the [ProxyDB] database?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •