Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8052077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:27:33+00:00 2026-06-05T07:27:33+00:00

I am not sure why the below code is giving errors when I try

  • 0

I am not sure why the below code is giving errors when I try to create a stored procedure. I am relatively inexperienced with SP.

CREATE PROCEDURE [dbo].[InsertDuplicateFields] 
    (@UniqueColID varchar(50), @IndividualID varchar(50) = null)
AS
Begin           
    INSERT INTO TableCollisionBegin 
        SELECT * FROM TableCollisionBegin 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableCollisionDetails 
        SELECT * FROM TableCollisionDetails 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableCollisionLocation 
        SELECT * FROM TableCollisionLocation 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableDriver 
        SELECT * FROM TableDriver 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableFollowUp 
        SELECT * FROM TableFollowUp 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableOfficerLogs 
        SELECT * FROM TableOfficerLogs 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TablePolice 
        SELECT * FROM TablePolice 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableRecVerified 
        SELECT * FROM TableRecVerified 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableSignature 
        SELECT * FROM TableSignature 
        WHERE [IndividualID] = @IndividualID;

    INSERT INTO TableTrailer 
        SELECT * FROM TableTrailer 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableValidateLog 
        SELECT * FROM TableValidateLog 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableVehicle 
        SELECT * FROM TableVehicle 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableWitness 
        SELECT * FROM TableWitness 
        WHERE [UniqueColID] = @UniqueColID;

    INSERT INTO TableInvolvedPerson 
        SELECT * FROM TableInvolvedPerson 
        WHERE [IndividualID] = @IndividualID;

    INSERT INTO TableStatement 
        SELECT * FROM TableStatement 
        WHERE [UniqueColID] = @UniqueColID; 

    INSERT INTO TableCollisionDiagram 
        SELECT * FROM TableCollisionDiagram 
        WHERE [UniqueColID] = @UniqueColID;
END

The error that I get is:

Line 21 Invalid column name ‘IndividualID’.

If I remove the line of code inserting individualID then it gives the same error about the UniqueColID

This is strange because in that given table there IS a column IndividualID so I don’t know why it won’t recognize it….I typed this code in MS Excel then copy pasted it into notepad, could that be why the code isn’t working?

I copied one row from that table and as you can see it DOES have IndividualID:

IndividualID
059D1263-F0F3-4D19-8C56-0FC7D2B5266E
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:27:34+00:00Added an answer on June 5, 2026 at 7:27 am

    Double check your table TableInvolvedPerson and make sure the column IndividualID is spelled the same.

    Updated

    When you updated your question, you added a value for IndividualID. The value you added is a Guid, which can possibly be stored in SQL Server as a UNIQUEIDENTIFIER column. But the type you declared on your stored procedure is a VARCHAR. Can you double check your types? What is the type for IndividualID on both the original table and the table you are copying into? Do they match?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've encountered code below and I'm not fully sure what it's achieving. I think
Below is my code, which behaves extremely bizarre, and I am not sure I
I am not sure how fast the below code is. If anyone knows the
I am having a problem with the below code and I am not sure
The code below is giving the following error: An expression tree may not contain
Im not sure how to output MySQL data into formats below. (eg: timelist, usersex,
Not sure why my .plist looks like this when viwed as source code, and
The output of the below code is as following: not equal equal Note the
Not sure if this counts as programming related, it's a tool that I use.
Not sure exactly what I need to do to make this work, so my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.