Showing posts with label structures. Show all posts
Showing posts with label structures. Show all posts

Friday, March 30, 2012

imports table structures in SQL 2000 into Excel

Hi.
Is there anyway to export the table structures : data type,length,NULLABLE,Description into an Excel file using MS SQL Server?

Or I need to do it manually?
Thank you in advanced.
Sincerely

AgustinaRun this in Query Analyzer: (common data types, add the the case statement for more)


select name,
case xtype
when 56 then 'Int'
when 127 then 'BigInt'
when 167 then 'VarChar'
when 175 then 'Char'
when 60 then 'Money'
when 58 then 'SmallDateTime'
when 104 then 'Bit'
when 173 then 'TimeStamp'
when 61 then 'DateTime'
when 48 then 'TinyInt'
else 'Other' end,
length
from syscolumns
where id = (
select id
from sysobjects
where name = 'TheTableName')
order by colid
|||You could look up the Schema. Run this in Query Analyzer and adjust accordingly:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_CATALOG = '<DATABASE NAME>' AND TABLE_SCHEMA = '<DB OWNER>' AND TABLE_NAME = '<YOUR TABLES NAME>'
sql

Sunday, February 19, 2012

Importing Access?

If I import an MS Access 2002 database into SQL Server, will it carry over
all my tables and table structures and my relationships, or will I need to
make major changes to them after?
Does it change the data types of fields as appropriate to match SQL data
types or make them all a generic one?
Thanksit depends on how you do it. if you are using the upsizing wizard then you
will get your tables, and data, etc. however you will have to go back in and
do a check to make sure everything is right. I have had varying degrees of
success with it and relationships ususally need to be recreated. Sometimes
drops the primary keys and indexes as well. you will also need to do some
coding. If you are using DTS than you can use the transforms in DTS to add
constraints, create indexes, etc. and this will give you better control over
how the data comes accross. but more control = more work upfront.
good luck
Neil MacMurchy
"Keith" <@..> wrote in message news:O13iNZcBEHA.3568@.tk2msftngp13.phx.gbl...
> If I import an MS Access 2002 database into SQL Server, will it carry over
> all my tables and table structures and my relationships, or will I need to
> make major changes to them after?
> Does it change the data types of fields as appropriate to match SQL data
> types or make them all a generic one?
> Thanks
>