SQL : Generate Field List For All Tables

By at August 29, 2007 06:52
Filed Under:
SELECT DISTINCT
        TABLE_NAME,
        COLUMN_NAME
FROM    ( SELECT    TABLE_NAME,
                    COLUMN_NAME = REPLACE(( SELECT  '[' + hp.COLUMN_NAME + ']' AS [data()]
                                            FROM    INFORMATION_SCHEMA.COLUMNS hp
                                            WHERE   hp.TABLE_NAME = T.TABLE_NAME
                                            ORDER BY hp.ORDINAL_POSITION
                                          FOR
                                            XML PATH('')
                                          ), ' ', ',')
          FROM      INFORMATION_SCHEMA.COLUMNS T
          WHERE     TABLE_NAME NOT IN ( SELECT  TABLE_NAME
                                        FROM    INFORMATION_SCHEMA.VIEWS )
        ) T
ORDER BY TABLE_NAME DESC

Comments

2/9/2010 2:26:48 AM #

pet potty

Easily, the job is real the large on this laudable subject. I occur with your conclusions and testament thirstily seem headlong to your upcoming updates. Locution thanks testament not rightful be adequate, for the fantasti c lucidity in your oeuvre. I faculty now touching your rss enclose to rescript secret of any updates. Dry work and such success in your enterprise enterprize!

Regards
japes

pet potty United States | Reply

2/9/2010 8:40:47 AM #

how to control acne

Hmm eery this occupation is totaly moot to the activity ask I entered in google but it was recorded on the premiere page.

Regards
johney

how to control acne United States | Reply

2/26/2010 4:25:05 PM #

Fatcow

Should I get a VPS? Currently I am using lunarpages but they keep disabling my account due to high server overload. Im getting about 4,000 UV a day. What brand should I get?

Fatcow United States | Reply

3/2/2010 2:01:34 PM #

wow mobiles

WoW Mobile is awesome! I get free mobile service with t-mobile because I refered 3 people to wow. You can too!

wow mobiles United States | Reply

3/20/2010 11:45:03 PM #

cheap prom Dresses

I entered in google but it was recorded on the premiere page.

cheap prom Dresses People's Republic of China | Reply

4/28/2010 9:48:15 AM #

Marlon Heeter

I just discovered your web site on yahoo and see that you've got some fantastic thoughts in this post. I specifically appreciate the way you've been able to stick so very much thought into a relatively short submit (comparitively) which creates it an thoughtful post on your subject. IMHO you put a lot of good information in this submit not having all the filler that most bloggers use just to make their posts appear longer, that is ideal for a gal like me who doesn't have a lot time cause I'm usually within the go. I often get so frustrated with so many of the final results in the major SE's due to the fact they frequently seem to mostly be filled with filler content that frequently isn't quite sensible. If you don't mind I'm going to add this post and your weblog to my delicious favorites so I can share it with my family. I appear forward to coming back to read your future posts too.

Marlon Heeter United States | Reply

6/15/2010 10:05:16 AM #

dog walking businesses

www.mywalkies.co.uk We are your #1 puppy jogging website, My Walkies. Become a free of charge member and begin listing your adverts totally totally free inside of minutes. You are able to handle all adverts from your personalized dashboard. Developments your a dog walker owner or walking group we have a place for you.

dog walking businesses Taiwan | Reply

7/6/2010 12:29:41 PM #

www.doessizemattertowomen.com

Thank you for another great weblog. Where else could I receive this sort of facts written in such an inciteful way? I've a assignment that I am just right now doing work on, and I have been seeking for such information... Regards…

www.doessizemattertowomen.com United States | Reply

7/7/2010 9:57:47 AM #

Stephen Aument

Love your weblog I will subscribe

Stephen Aument Uzbekistan | Reply

7/24/2010 4:56:42 PM #

myrtle beach short sales

great blog you have here

myrtle beach short sales Puerto Rico | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading