Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 28th, 2004, 07:47 AM
Registered User
 
Join Date: Nov 2003
Location: BANGALORE, KARNATAKA, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do we differentiate b/w User and Sys tables

How do we differentiate between USer tables and System Tables in SQL Server

Thanks

Plz Reply ASAP

Best Regards

Anil Mahadev

Software Dev 2 Da Max


Reply With Quote
  #2 (permalink)  
Old May 28th, 2004, 12:02 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

what do you mean by differentiate between them???
you can observe that system table names starts with "sys"


Ahmed Ali
Software Developer
Reply With Quote
  #3 (permalink)  
Old May 28th, 2004, 12:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

If you select from the sysobjects table, the field xtype can be used to make that determination. This char(2) field uses the following table values:

S = System table
U = User table
V = View

This is apart from the fact that most system tables start with sys, other than the dtproperties table.

I don't know if you can differentiate between these two types using the INFORMATION_SCHEMA.TABLES or another of the INFORMATION_SCHEMA views.

Brian
Reply With Quote
  #4 (permalink)  
Old May 29th, 2004, 12:04 AM
Registered User
 
Join Date: Nov 2003
Location: BANGALORE, KARNATAKA, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bmains
 Hello,

If you select from the sysobjects table, the field xtype can be used to make that determination.††This char(2) field uses the following table values:

S = System table
U = User table
V = View

This is apart from the fact that most system tables start with sys, other than the dtproperties table.

I don't know if you can differentiate between these two types using the INFORMATION_SCHEMA.TABLES or another of the INFORMATION_SCHEMA views.

Brian
Dear Brian,

Thanks 4 the help given.

My question was actually,

Can we change a sys table to a user table in a database.

Thanks

Anil Mahadev

Software Dev 2 Da Max

Reply With Quote
  #5 (permalink)  
Old May 29th, 2004, 04:30 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

first:
i am asking what is the user table advantages so i need to change the sys table to a user table.
secoded:
if you change for example the name of system table all sys procedure and views will fail.

you can get the system tables data after inserting it in separate temperory table like follows:

select * into #table1
from dbo.syscolumns


Ahmed Ali
Software Developer
Reply With Quote
  #6 (permalink)  
Old May 30th, 2004, 08:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You have to look at some of the change object procedures for that. I don't believe so, because the system tables are needed by SQL Server. Why do you need to do this?

Brian
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE Errormessege Error "Sys" undefined chandana ASP.NET 2.0 Professional 1 August 12th, 2008 11:35 AM
Indexing tables in user defined functions A17560127 SQL Server 2005 1 July 21st, 2008 03:56 AM
drop user from sys.server_principals priyaram SQL Server 2005 1 March 12th, 2007 10:42 AM
Select to all user tables in db Moueg SQL Server 2000 5 December 13th, 2004 09:56 AM
How to differentiate to number lists gilgalbiblewheel Java GUI 0 September 15th, 2004 07:22 PM



All times are GMT -4. The time now is 01:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.