Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Error converting data type varchar to uniqueidentifier -SQL SERVER 2005

Posted on 2009-02-13
10
Medium Priority
?
2,417 Views
Last Modified: 2012-08-13
Hi,
After executing the below small SP with the command
--EXEC SP_OppPipelinePhaseCreate '{626EB86-B455-4D8D-B355-DE7471270A48}'

I am getting "Error converting data type varchar to uniqueidentifier" error
*****************************************************************************
ALTER PROCEDURE SP_OppPipelinePhaseCreate
@OppId as uniqueidentifier
AS BEGIN
PRINT @oppId
END
******************************************************************************

Please help
0
Comment
Question by:arvapal
  • 5
  • 2
8 Comments
 
LVL 12

Expert Comment

by:Dimitris
ID: 23633548
remove the "{" and "}" chars
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 23633592
Your uniqieidentifier is invalid.  It is missing a character in the FIRST section.

YOURS:
EXEC SP_OppPipelinePhaseCreate '{626EB86-B455-4D8D-B355-DE7471270A48}'

Extra "F" at the beginning
EXEC SP_OppPipelinePhaseCreate '{F626EB86-B455-4D8D-B355-DE7471270A48}'
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23634173
Brandon,
    I know that unique identifier will have 8-4-4-4-12 digits and values will be from 0-9 and a-f.
Can you kindly tell me how did you figured that the first value if F instead of other 15 values?

Can you share the logic behind this in more detail
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 23634207
rrjegan:  I didn't.  I just noticed that it was NOT a valid unique identifier and supplied a value that would make it valid.  I was in no way saying that the PROPER value for his unique identifier should be F because the very principal of a unique identifier doesn't allow you to infer a value from the rest of the values.

arvapal:  I was merely showing "A" valid value for a unique identifier.  Not what YOUR value should be.
0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 23634245
Oh.. Is it.. Yes you are correct. Even from the value provided by the asker, I inferred it as incorrect.
But when you said prefixing with 'F' will be enough, I thought you know the logic behind Unique Identifier creation, etc.,

Anyhow thanks for your reply. Cheers
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 2000 total points
ID: 23693474
I have to contest here that "B" is not the correct grade.  I provided an accurate description of your problem.  Please consider changing the grade in accordance with EE's grading guidelines.


What's the right grade to give?

Grading at Experts Exchange is not like school. It's more like the "10-point Must" system in professional boxing; in other words, an answer is worth an A, unless it doesn't resolve your issue. If it requires you to do a little more research, or figure out one more piece of code, then it's worth a B. If you think it's not worth a B, the custom is to offer the Experts an opportunity to earn a better grade.

Giving a higher grade has no impact on your Available Points.
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 23810980
cooleomod: If they won't respond to my questions, what makes you think they will respond and take action to re-close the question?
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 23856244
That's understandable... :)
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question