Friday, February 24, 2012

Data Types

Hi All.
Bit of a newbie here, and I'm assuming this is a simple question, but I
can't find what I'm looking for in BOL:
I need to get a list of all the column names, data types and sizes in 8
tables in my database. I can see it in Enterprise Manager, but I'd like a
manageble listing which I'm assuming can be done via an SQL query. I'm using
SQL 7.0.
tia.
steve.
use sp_help tablename
"molsonexpert" <imdrunk@.work.ca> wrote in message
news:ONBw0UG3EHA.2600@.TK2MSFTNGP09.phx.gbl...
> Hi All.
> Bit of a newbie here, and I'm assuming this is a simple question, but I
> can't find what I'm looking for in BOL:
> I need to get a list of all the column names, data types and sizes in 8
> tables in my database. I can see it in Enterprise Manager, but I'd like a
> manageble listing which I'm assuming can be done via an SQL query. I'm
> using
> SQL 7.0.
> tia.
> steve.
>
|||you need to query the syscolumns table.
ex:
SELECT b."name",b."type",a.*
FROM "dbo"."syscolumns" a,
"dbo"."sysobjects" b
where a.name = 'GRANT_NUM'
and a.id=b.id
order by 1
"molsonexpert" wrote:

> Hi All.
> Bit of a newbie here, and I'm assuming this is a simple question, but I
> can't find what I'm looking for in BOL:
> I need to get a list of all the column names, data types and sizes in 8
> tables in my database. I can see it in Enterprise Manager, but I'd like a
> manageble listing which I'm assuming can be done via an SQL query. I'm using
> SQL 7.0.
> tia.
> steve.
>
>
|||INFORMATION_SCHEMA.COLUMNS view
"molsonexpert" <imdrunk@.work.ca> wrote in message
news:ONBw0UG3EHA.2600@.TK2MSFTNGP09.phx.gbl...
> Hi All.
> Bit of a newbie here, and I'm assuming this is a simple question, but I
> can't find what I'm looking for in BOL:
> I need to get a list of all the column names, data types and sizes in 8
> tables in my database. I can see it in Enterprise Manager, but I'd like a
> manageble listing which I'm assuming can be done via an SQL query. I'm
> using
> SQL 7.0.
> tia.
> steve.
>

No comments:

Post a Comment