Home All Groups Group Topic Archive Search About
Author
19 May 2006 3:37 PM
Matthew
Quick Dumb Question

I was wondering if there was a way to revel what format a query returns
per column.

I am running into the situation where I am pulling data from a huge
list, and occasionally I get the error "Implicit conversion from data
type sql_variant to varchar is not allowed. Use the CONVERT function to
run this query." When inserting it into a table. When I run the
command without the insert it return all the information without the
error. So now I need to go hunt what column has the incorrect format
and what format to change it to or need to run CONVERT on that
particular item in the query

Hope that made sense.

Author
19 May 2006 3:57 PM
Mark Williams
SELECT COLUMN_NAME, DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Your Table'

Should give you a listing of the columns in a table, and their datatypes.

--
Show quote
"Matthew" wrote:

> Quick Dumb Question
>
> I was wondering if there was a way to revel what format a query returns
> per column.
>
> I am running into the situation where I am pulling data from a huge
> list, and occasionally I get the error "Implicit conversion from data
> type sql_variant to varchar is not allowed. Use the CONVERT function to
> run this query." When inserting it into a table. When I run the
> command without the insert it return all the information without the
> error. So now I need to go hunt what column has the incorrect format
> and what format to change it to or need to run CONVERT on that
> particular item in the query
>
> Hope that made sense.
>
>

AddThis Social Bookmark Button