Thursday, February 16, 2012

Checking datatypes of a field accoss multiple tables

I have a tables called subsid that I need to change the datatype from
text to int.

I think I got them all but is there a query I can run that will check
all fields call subsid accross all tables that are of type text.Try:

SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMN_NAME = 'subsid' AND
DATA_TYPE = 'text'

--
Hope this helps.

Dan Guzman
SQL Server MVP

<tdmailbox@.yahoo.com> wrote in message
news:1113780531.744940.153260@.l41g2000cwc.googlegr oups.com...
>I have a tables called subsid that I need to change the datatype from
> text to int.
> I think I got them all but is there a query I can run that will check
> all fields call subsid accross all tables that are of type text.

No comments:

Post a Comment