Solved

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

Posted on 2011-02-27
3
348 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

832 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