PC Review


Reply
Thread Tools Rate Thread

get user tables/views and/or system tables/views

 
 
David Thielen
Guest
Posts: n/a
 
      11th Dec 2008
Hi;

I use:

SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE (table_type =
'BASE TABLE') and (TABLE_NAME != 'dtproperties')

to get all user tables. Is this still the best way to do this?

And what is the select to get all system tables?

thanks - dave


david@at-at-(E-Mail Removed)
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Reply With Quote
 
 
 
 
Trevor Benedict
Guest
Posts: n/a
 
      11th Dec 2008
David,
Have you tried "SQL Profiler". This is by far one of the best tools to dig
around and see how SQL Server in itself builds the SQL.

All user defined Tables
Select * from sysobjects
where xtype = 'U'

This should give you a fair idea about the sysobjects table

http://articles.techrepublic.com.com...1-6142579.html

Regards,

Trevor Benedict



"David Thielen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi;
>
> I use:
>
> SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE (table_type =
> 'BASE TABLE') and (TABLE_NAME != 'dtproperties')
>
> to get all user tables. Is this still the best way to do this?
>
> And what is the select to get all system tables?
>
> thanks - dave
>
>
> david@at-at-(E-Mail Removed)
> Windward Reports -- http://www.WindwardReports.com
> me -- http://dave.thielen.com
>
> Cubicle Wars - http://www.windwardreports.com/film.htm



 
Reply With Quote
 
 
 
 
David Thielen
Guest
Posts: n/a
 
      9th Jan 2009
thank you very much.

New question, how can I get the system tables & views?

thanks - dave


On Thu, 11 Dec 2008 14:00:24 -0800, "Trevor Benedict"
<(E-Mail Removed)> wrote:

>David,
>Have you tried "SQL Profiler". This is by far one of the best tools to dig
>around and see how SQL Server in itself builds the SQL.
>
>All user defined Tables
>Select * from sysobjects
>where xtype = 'U'
>
>This should give you a fair idea about the sysobjects table
>
>http://articles.techrepublic.com.com...1-6142579.html
>
>Regards,
>
>Trevor Benedict
>
>
>
>"David Thielen" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> Hi;
>>
>> I use:
>>
>> SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE (table_type =
>> 'BASE TABLE') and (TABLE_NAME != 'dtproperties')
>>
>> to get all user tables. Is this still the best way to do this?
>>
>> And what is the select to get all system tables?
>>
>> thanks - dave
>>
>>
>> david@at-at-(E-Mail Removed)
>> Windward Reports -- http://www.WindwardReports.com
>> me -- http://dave.thielen.com
>>
>> Cubicle Wars - http://www.windwardreports.com/film.htm

>



david@at-at-(E-Mail Removed)
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Reply With Quote
 
Trevor Benedict
Guest
Posts: n/a
 
      9th Jan 2009
David,
This article explains what the values for x_type represent. Using this you
should be able to build your query

http://www.devx.com/tips/Tip/14107

Regards,

Trevor Benedict

"David Thielen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> thank you very much.
>
> New question, how can I get the system tables & views?
>
> thanks - dave
>
>
> On Thu, 11 Dec 2008 14:00:24 -0800, "Trevor Benedict"
> <(E-Mail Removed)> wrote:
>
>>David,
>>Have you tried "SQL Profiler". This is by far one of the best tools to dig
>>around and see how SQL Server in itself builds the SQL.
>>
>>All user defined Tables
>>Select * from sysobjects
>>where xtype = 'U'
>>
>>This should give you a fair idea about the sysobjects table
>>
>>http://articles.techrepublic.com.com...1-6142579.html
>>
>>Regards,
>>
>>Trevor Benedict
>>
>>
>>
>>"David Thielen" <(E-Mail Removed)> wrote in message
>>news:(E-Mail Removed)...
>>> Hi;
>>>
>>> I use:
>>>
>>> SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE (table_type =
>>> 'BASE TABLE') and (TABLE_NAME != 'dtproperties')
>>>
>>> to get all user tables. Is this still the best way to do this?
>>>
>>> And what is the select to get all system tables?
>>>
>>> thanks - dave
>>>
>>>
>>> david@at-at-(E-Mail Removed)
>>> Windward Reports -- http://www.WindwardReports.com
>>> me -- http://dave.thielen.com
>>>
>>> Cubicle Wars - http://www.windwardreports.com/film.htm

>>

>
>
> david@at-at-(E-Mail Removed)
> Windward Reports -- http://www.WindwardReports.com
> me -- http://dave.thielen.com
>
> Cubicle Wars - http://www.windwardreports.com/film.htm



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! Rich Windows Vista General Discussion 8 7th Jun 2009 06:29 PM
SPAM Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! Bob I Windows XP General 0 3rd Jun 2009 04:50 PM
Re: Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! The Seabat Windows XP General 0 2nd Jun 2009 04:32 PM
Re: Get ubuntu ! Get ubuntu ! Get ubuntu ! Get ubuntu ! Mike Brannigan Windows Vista Security 0 1st Jun 2009 11:39 AM
Re: Don't Get ubuntu ! Don't Get ubuntu ! Don't Get ubuntu ! Don't Get ubuntu ! TheBiG Douche Windows Vista General Discussion 0 31st May 2009 10:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 AM.