SQL Server Query

Tags:
Development
Hi Gurus, My requirement is to get a list of tables and their columns in a .XLS. Is there a procedure or any script that could do it - for all tables at once. Thanks Sreeni
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Sreeni,

On which type system are your tables stored i.e. I-series, SQL server etc.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • AaronCutshall
    Here's a couple that I use that may help. Bear in mind that I prefix all my tables with "tb", my views with "vw", and stored procedures with "sp" just to make life simplier. For tables: CREATE VIEW dbo.systables AS SELECT TOP 100 PERCENT name AS TableName FROM dbo.sysobjects WHERE (xtype = 'U') AND (name LIKE N'tb%') For Tables & Fields: CREATE VIEW dbo.sysfields AS SELECT dbo.sysobjects.name AS TableName, dbo.syscolumns.name AS FieldName FROM dbo.sysobjects INNER JOIN dbo.syscolumns ON dbo.sysobjects.id = dbo.syscolumns.id WHERE (dbo.sysobjects.xtype = 'U') AND (dbo.sysobjects.name LIKE N'tb%') Hope this helps! Aaron
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: