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

  • Home
  • SEARCH
  • 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 8056955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:52:26+00:00 2026-06-05T08:52:26+00:00

I have searched online and tried the below solution but it does not work;

  • 0

I have searched online and tried the below solution but it does not work; it doesn’t enter a row into the table..

INSERT INTO [CollisionBegin] 
    SELECT '999-999-99999-9999-9999', [LocalNum], [version], [Submitted] 
    FROM [CollisionBegin] 
    WHERE [UniqueColID] = '2C024576-10BB-4A12-8B6E-BB03191866DE';

What I am trying to do: find a row in the table with UniqueColdID="2C024576-10BB-4A12-8B6E-BB03191866DE"

This should retrieve ALL of the columns that correspond to a row with this UniqueColID. Now I want to reinsert this record BUT with a NEW UniqueColID, "999-999-99999-9999-9999".

The above code was a solution I found around the web but it did not work for me because after I execute that statement in my stored procedure, nothing happened.

This is my stored procedure:

ALTER PROCEDURE [dbo].[AmendInsertDuplicateFields] 
AS
BEGIN

   INSERT INTO [MVCNew].[dbo].[CollisionBegin] 
      SELECT
         '999-999-99999-9999-9999', [LocalNum], [version], [Submitted] 
      FROM 
         [MVCNew].[dbo].[CollisionBegin] 
      WHERE 
         [UniqueColID] = '2C024576-10BB-4A12-8B6E-BB03191866DE';
END

I know that I have to provide the values explicitly to the insert:

INSERT INTO [MVCNew].[dbo].[CollisionBegin] (Column1, Column2, Column3, etc) 
   SELECT Column1, Column2, Column3, etc 
   FROM...

BUT I have about 8 tables I need to do this for and 30 columns per table so that would be confusing..

I just tried:

CREATE TEMPORARY TABLE chan2 ENGINE=MEMORY SELECT * FROM [MVCNew].[dbo].[PrideMVCCollisionBegin] WHERE UniqueColID='2C024576-10BB-4A12-8B6E-BB03191866DE'; 
UPDATE chan2 SET UniqueColID='999-999-99999-9999-9999'; 

INSERT INTO [MVCNew].[dbo].[PrideMVCCollisionBegin] SELECT * FROM chan2; 
DROP TABLE chan2; 

But I get the error:

Unknown object type 'TEMPORARY' used in a CREATE, DROP, or ALTER statement.
  • 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-05T08:52:27+00:00Added an answer on June 5, 2026 at 8:52 am

    See my answer on your your other thread on this same topic. In short, yes, I would suggest manually listing all the fields, but no, you don’t need to type them all yourself.

    If you are really motivated to do this without listing all the fields, you’d need to get into some dynamic SQL (or, say, a SQLCLR procedure) to make it happen. It can be done, and it should work, but it’s much more complicated for something that really is probably best solved by writing the queries the conventional way.

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

Sidebar

Related Questions

I have searched online for a solution, but have yet to find one that
I realize this is a basic question but I have searched online, been to
I need a CORE that will perform AES-128 Encryption/Decryption. I have searched online but
(Note that I've searched online for the warnings I'm describing below, and have come
I have searched online for how to do this but I don't understand. The
I have searched this online, but I can't find the answer I am looking
Ok guys, this is my first thread, and I have searched online but with
with javascript(Jquery). Searched online, seems like it's not possible. So far I have something
Have searched for the answer but no joy, so here goes... I'm working on
I have searched the forum and have not found an issue similar to this.

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.