Answer the question
In order to leave comments, you need to log in
How to convert field type in TSQL?
There is a storage that pulls all lines with a certain status from the database. The problem is that the table has a field called "guid", which has the type "text", while in the code we have the type "uniqueidentifier", respectively, the program crashes into an exception. It is necessary to convert the text type from the base during the select and return the uniqueidentifier.
Now the code in the storage is as simple as possible:
SELECT data.* FROM [my_table] data
WHERE STATUS_Code = 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question