Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    33

    Unanswered: The name 'HeaderID' is not permitted in this context. Only constants, expressions, or

    I'm pulling data from one database in which the headerID is the primary key which automatically increases by one on each insert. Modifying all of the other fields from one data type to another and then inserting them into another database after the convertion is done. I keep getting this error.

    The name 'HeaderID' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.

    INSERT INTO [DatabaseName].[dbo].[InvoiceHeaderConverted]
    ([HeaderID], [InvoiceNumber], [StoreNumber], [DeliveryDate], [DueDate],
    [TotalInvoice], [TotalTax], [ManifestNumber])
    VALUES(HeaderID = @HeaderID, InvoiceNumber = @InvoiceNumber, StoreNumber = @StoreNumber,
    DeliveryDate = @DeliveryDate, DueDate = @DueDate, TotalInvoice = @TotalInvoice,
    TotalTax = @TotalTax, ManifestNumber = @ManifestNumber)

    Can anyone point me in the right direction on this one. The headerid isn't autogenerated in the second database but is still the primary key.

  2. #2
    Join Date
    Feb 2007
    Posts
    33

    Oops

    I got it.

    I knew it too.

    This is what happens when you're coding at 4am.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Glad you sorted it! What was the solution in the end?
    George
    Home | Blog

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    What was the solution in the end?
    Ten bob on removing the aliases from the VALUES(....) bit
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by pootle flump
    Ten bob on removing the aliases from the VALUES(....) bit
    Shhhhhh
    George
    Home | Blog

Posting Permissions

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