?
Solved

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

Posted on 2011-02-27
3
Medium Priority
?
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:
Chris M earned 2000 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

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 we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

762 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