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 6667407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:55:47+00:00 2026-05-26T02:55:47+00:00

I am trying to update data in a Contacts_CSTM table based on data in

  • 0

I am trying to update data in a Contacts_CSTM table based on data in a Project_CSTM table. This is the query I’m using, but I get an error: “Conversion failed when converting from a character string to uniqueidentifier”

 ALTER PROCEDURE Insurance_Check_Expiration
  @ID_C AS NVARCHAR (55) = ID_C
  AS
 BEGIN      
 SET NOCOUNT ON
 IF EXISTS(SELECT * FROM CONTACTS_CSTM WHERE ID_C = @ID_c)

 Update contacts_cstm set insurance_expired_label_c = 'INSURANCE EXPIRED'
 WHERE DRIVERS_LICENSE_NUMBER_C IS NOT NULL AND @ID_C=
 (SELECT cc.id_c
 FROM PROJECT_CSTM PC 
 JOIN PROJECT P 
 ON P.ID = PC.ID_C
 JOIN PROJECT_RELATION PR
 ON PR.PROJECT_ID = P.ID  
 JOIN CONTACTS C
 ON C.ID = PR.RELATION_ID 
 JOIN CONTACTS_CSTM CC
 ON CC.ID_C = C.ID
 WHERE CC.ID_C = @ID_C AND INSURANCE_EXPIRED_C ='1') 

Thanks.

  • 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-05-26T02:55:48+00:00Added an answer on May 26, 2026 at 2:55 am

    For one, you’re setting the value of @ID_C to a value (ID_C) which is obviously not a valid GUID.

    This is the functional equivalent of what you did, run it and you’ll get the same error.

    CREATE PROCEDURE Insurance_Check_Expiration
      @ID_C AS NVARCHAR (55) = ID_C
      AS
     BEGIN      
     DECLARE @A UNIQUEIDENTIFIER
    
     SET @A = @ID_C
    
    
     END
    
     exec Insurance_Check_Expiration
    

    EDIT: Here’s a functional example based on the OP’s comments:

    CREATE TABLE GUIDExample (ID_C UNIQUEIDENTIFIER)
    GO
    CREATE PROC GuidExample_Insert @ID_C UNIQUEIDENTIFIER
    AS
    BEGIN
        SELECT @ID_C
    END
    GO
    CREATE TRIGGER GUID_Example ON GUIDExample
    AFTER INSERT
    AS
        DECLARE @ID_C UNIQUEIDENTIFIER
    
        SELECT @ID_C = ID_C
        FROM Inserted
    
    
        EXEC GuidExample_Insert @ID_C
    GO
    
    DECLARE @SampleGUID UNIQUEIDENTIFIER
    
    SET @SampleGUID = NEWID()
    
    INSERT GUIDExample (ID_C)
    VALUES(@SampleGUID)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im getting this error when Im trying to update data in the database. this
I'm trying to update table data from a database in CakePHP. Query: UPDATE status
I'm trying to update the data from my oracle database using this code. The
I am trying to update table A with data from table B. I thought
I am trying to update a field in a table with data from another
I'm trying to update a hashtable in a loop but getting an error: System.InvalidOperationException:
I am trying some SQL code but I get an error when I try
I'm trying to update the data in the parent table that is referenced in
I am trying to use jQuery's ajax functionality to update data from a web
I trying to update a model on a callback but the validation is causing

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.