Solved

SQL Enterprise manager connected to SQLExpress - Conversion failed when converting a char to a uniqueidentifier

Posted on 2011-02-27
3
344 Views
Last Modified: 2012-05-11
Hi..
I registered a SQLExpress DB in SQL 2008 Enterprise manager.
When I run some of the views I get
CONVERSION FAILED WHEN CONVERTING FROM CHARACTER STRING TO UNIQUEIDENTIFIER
Any ideas... The App that uses SQLExpress works fine.
How can I query the views/tables?
thx
0
Comment
Question by:JElster
3 Comments
 
LVL 15

Expert Comment

by:derekkromm
ID: 34993815
Can you give a little more detail? Like what the data is, the view or query, etc?
0
 
LVL 12

Accepted Solution

by:
pastorchris earned 500 total points
ID: 34994514
It's possible you are getting this error by querying a view, not a table and either the view was not written well and so it's giving you data-type conflicts or it was written well but the data-type of one of the fields in the parent table which the view queries was changed from one type to another.

So it's possible that the view expects character (CHAR, VARCHAR or NVACHAR) data which it converts to data-type uniqueidentifier before displaying it.

To resolve this, run sp_helptext 'schema.view_name' on the view and see which tables it queries then correct the view's text so that it can query the parent tables without any problem.

Once the problem is fixed, you may alter the view to reflect the new one.
Be sure to perform sufficient testing using the data available. Also keep the old and new view syscomments somewhere in a file so that you can roll back to the original view format whenever you want.

Use the snippet attached to see the listing of the different tables and views in your database.

Regards,
Chris
SELECT TABLE_NAME As [Object Name], TABLE_TYPE as [Object Type], TABLE_SCHEMA as [Schema], 
		TABLE_CATALOG As [Database]
FROM information_schema.tables where table_type in ('VIEW', 'BASE TABLE')
order by TABLE_NAME asc

Open in new window

0
 
LVL 1

Author Comment

by:JElster
ID: 34996568
The view is based on a UDF... It's selecting from a UDF.  which I can't open in Enterprise manager.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now