Showing posts with label reference. Show all posts
Showing posts with label reference. Show all posts

Friday, March 23, 2012

Question on table 'dtproperties'.

Is 'dtproperties' a system table? And what does this table usually be used for?
Any information or reference resource would be appreciated!
dtproperties holds any database diagrams that might exist. Yes, it is a
system table even though I have seen situations where it seems to be marked
as a user table...
"Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
news:574C866A-01D2-47F2-B702-A1498F5A1893@.microsoft.com...
> Is 'dtproperties' a system table? And what does this table usually be used
for?
> Any information or reference resource would be appreciated!
|||>dtproperties holds any database diagrams that might exist.
Thank you very much!

>Yes, it is a
>system table even though I have seen situations where it seems to be marked
>as a user table...
In the Management Console, it is displayed in the Tables list, and marked with the Type of 'system';
And However, just as you said, it will be grouped into 'User Tables' in the Query Analyzer.
|||Yes, I've never liked this fact...
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
> Thank you very much!
> In the Management Console, it is displayed in the Tables list, and marked
> with the Type of 'system';
> And However, just as you said, it will be grouped into 'User Tables' in
> the Query Analyzer.
>
|||I've never liked the fact that EM shows it as 'system'
Dtproperties actually doesn't have any properties of a system table.
Its ID is > 100, it doesn't start with 'sys' and it doesn't have
sysobjects.type value of 's'.
For all intents and purposes it is a USER table.
EM uses it for its own special purposes, so EM displays it as a system
table, but that is only EM.
SQL Server itself has no idea there is anything special about this table.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Yes, I've never liked this fact...
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
> news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
marked
>
|||It seems dtproperties is somewhere between a system table and a user table.
It's not marked as system but it isn't really user-created either as
indicated by the following:
SELECT OBJECTPROPERTY(OBJECT_ID('dtproperties'), 'IsMSShipped')
Hope this helps.
Dan Guzman
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23aWjAbzKEHA.3292@.TK2MSFTNGP11.phx.gbl...[vbcol=seagreen]
> I've never liked the fact that EM shows it as 'system'
> Dtproperties actually doesn't have any properties of a system table.
> Its ID is > 100, it doesn't start with 'sys' and it doesn't have
> sysobjects.type value of 's'.
> For all intents and purposes it is a USER table.
> EM uses it for its own special purposes, so EM displays it as a system
> table, but that is only EM.
> SQL Server itself has no idea there is anything special about this table.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...
> marked
in
>
|||This doesn't mean anything. Anybody, or any app, can make a table they
create have the value 'IsMSShipped'.
USE pubs
go
CREATE TABLE sillytable
(a INT)
go
EXEC sp_ms_marksystemobject 'sillytable'
go
SELECT OBJECTPROPERTY(OBJECT_ID('sillytable'), 'IsMSShipped')
sillytable is most certainly user created. :-)
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:e2b0qlzKEHA.1192@.TK2MSFTNGP11.phx.gbl...
> It seems dtproperties is somewhere between a system table and a user
table.[vbcol=seagreen]
> It's not marked as system but it isn't really user-created either as
> indicated by the following:
> SELECT OBJECTPROPERTY(OBJECT_ID('dtproperties'), 'IsMSShipped')
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23aWjAbzKEHA.3292@.TK2MSFTNGP11.phx.gbl...
table.
> in
>

Question on table 'dtproperties'.

Is 'dtproperties' a system table? And what does this table usually be used f
or?
Any information or reference resource would be appreciated!dtproperties holds any database diagrams that might exist. Yes, it is a
system table even though I have seen situations where it seems to be marked
as a user table...
"Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
news:574C866A-01D2-47F2-B702-A1498F5A1893@.microsoft.com...
> Is 'dtproperties' a system table? And what does this table usually be used
for?
> Any information or reference resource would be appreciated!|||>dtproperties holds any database diagrams that might exist.
Thank you very much!

>Yes, it is a
>system table even though I have seen situations where it seems to be marked
>as a user table...
In the Management Console, it is displayed in the Tables list, and marked wi
th the Type of 'system';
And However, just as you said, it will be grouped into 'User Tables' in the
Query Analyzer.|||Yes, I've never liked this fact...
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
> Thank you very much!
>
> In the Management Console, it is displayed in the Tables list, and marked
> with the Type of 'system';
> And However, just as you said, it will be grouped into 'User Tables' in
> the Query Analyzer.
>|||I've never liked the fact that EM shows it as 'system'
Dtproperties actually doesn't have any properties of a system table.
Its ID is > 100, it doesn't start with 'sys' and it doesn't have
sysobjects.type value of 's'.
For all intents and purposes it is a USER table.
EM uses it for its own special purposes, so EM displays it as a system
table, but that is only EM.
SQL Server itself has no idea there is anything special about this table.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...
> Yes, I've never liked this fact...
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
> news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
marked[vbcol=seagreen]
>|||It seems dtproperties is somewhere between a system table and a user table.
It's not marked as system but it isn't really user-created either as
indicated by the following:
SELECT OBJECTPROPERTY(OBJECT_ID('dtproperties')
, 'IsMSShipped')
Hope this helps.
Dan Guzman
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23aWjAbzKEHA.3292@.TK2MSFTNGP11.phx.gbl...
> I've never liked the fact that EM shows it as 'system'
> Dtproperties actually doesn't have any properties of a system table.
> Its ID is > 100, it doesn't start with 'sys' and it doesn't have
> sysobjects.type value of 's'.
> For all intents and purposes it is a USER table.
> EM uses it for its own special purposes, so EM displays it as a system
> table, but that is only EM.
> SQL Server itself has no idea there is anything special about this table.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...
> marked
in[vbcol=seagreen]
>|||This doesn't mean anything. Anybody, or any app, can make a table they
create have the value 'IsMSShipped'.
USE pubs
go
CREATE TABLE sillytable
(a INT)
go
EXEC sp_ms_marksystemobject 'sillytable'
go
SELECT OBJECTPROPERTY(OBJECT_ID('sillytable'), 'IsMSShipped')
sillytable is most certainly user created. :-)
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:e2b0qlzKEHA.1192@.TK2MSFTNGP11.phx.gbl...
> It seems dtproperties is somewhere between a system table and a user
table.
> It's not marked as system but it isn't really user-created either as
> indicated by the following:
> SELECT OBJECTPROPERTY(OBJECT_ID('dtproperties')
, 'IsMSShipped')
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23aWjAbzKEHA.3292@.TK2MSFTNGP11.phx.gbl...
table.[vbcol=seagreen]
> in
>

Question on table 'dtproperties'.

Is 'dtproperties' a system table? And what does this table usually be used for
Any information or reference resource would be appreciated!dtproperties holds any database diagrams that might exist. Yes, it is a
system table even though I have seen situations where it seems to be marked
as a user table...
"Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
news:574C866A-01D2-47F2-B702-A1498F5A1893@.microsoft.com...
> Is 'dtproperties' a system table? And what does this table usually be used
for?
> Any information or reference resource would be appreciated!|||>dtproperties holds any database diagrams that might exist.
Thank you very much
>Yes, it is
>system table even though I have seen situations where it seems to be marke
>as a user table..
In the Management Console, it is displayed in the Tables list, and marked with the Type of 'system'
And However, just as you said, it will be grouped into 'User Tables' in the Query Analyzer|||Yes, I've never liked this fact...
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
> >dtproperties holds any database diagrams that might exist.
> Thank you very much!
>>Yes, it is a
>>system table even though I have seen situations where it seems to be
>>marked
>>as a user table...
> In the Management Console, it is displayed in the Tables list, and marked
> with the Type of 'system';
> And However, just as you said, it will be grouped into 'User Tables' in
> the Query Analyzer.
>|||I've never liked the fact that EM shows it as 'system'
Dtproperties actually doesn't have any properties of a system table.
Its ID is > 100, it doesn't start with 'sys' and it doesn't have
sysobjects.type value of 's'.
For all intents and purposes it is a USER table.
EM uses it for its own special purposes, so EM displays it as a system
table, but that is only EM.
SQL Server itself has no idea there is anything special about this table.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...
> Yes, I've never liked this fact...
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
> news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
> > >dtproperties holds any database diagrams that might exist.
> > Thank you very much!
> >
> >>Yes, it is a
> >>system table even though I have seen situations where it seems to be
> >>marked
> >>as a user table...
> > In the Management Console, it is displayed in the Tables list, and
marked
> > with the Type of 'system';
> > And However, just as you said, it will be grouped into 'User Tables' in
> > the Query Analyzer.
> >
>|||It seems dtproperties is somewhere between a system table and a user table.
It's not marked as system but it isn't really user-created either as
indicated by the following:
SELECT OBJECTPROPERTY(OBJECT_ID('dtproperties'), 'IsMSShipped')
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%23aWjAbzKEHA.3292@.TK2MSFTNGP11.phx.gbl...
> I've never liked the fact that EM shows it as 'system'
> Dtproperties actually doesn't have any properties of a system table.
> Its ID is > 100, it doesn't start with 'sys' and it doesn't have
> sysobjects.type value of 's'.
> For all intents and purposes it is a USER table.
> EM uses it for its own special purposes, so EM displays it as a system
> table, but that is only EM.
> SQL Server itself has no idea there is anything special about this table.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...
> > Yes, I've never liked this fact...
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > http://www.aspfaq.com/
> >
> >
> >
> >
> > "Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
> > news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
> > > >dtproperties holds any database diagrams that might exist.
> > > Thank you very much!
> > >
> > >>Yes, it is a
> > >>system table even though I have seen situations where it seems to be
> > >>marked
> > >>as a user table...
> > > In the Management Console, it is displayed in the Tables list, and
> marked
> > > with the Type of 'system';
> > > And However, just as you said, it will be grouped into 'User Tables'
in
> > > the Query Analyzer.
> > >
> >
> >
>|||This doesn't mean anything. Anybody, or any app, can make a table they
create have the value 'IsMSShipped'.
USE pubs
go
CREATE TABLE sillytable
(a INT)
go
EXEC sp_ms_marksystemobject 'sillytable'
go
SELECT OBJECTPROPERTY(OBJECT_ID('sillytable'), 'IsMSShipped')
sillytable is most certainly user created. :-)
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:e2b0qlzKEHA.1192@.TK2MSFTNGP11.phx.gbl...
> It seems dtproperties is somewhere between a system table and a user
table.
> It's not marked as system but it isn't really user-created either as
> indicated by the following:
> SELECT OBJECTPROPERTY(OBJECT_ID('dtproperties'), 'IsMSShipped')
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
> news:%23aWjAbzKEHA.3292@.TK2MSFTNGP11.phx.gbl...
> > I've never liked the fact that EM shows it as 'system'
> >
> > Dtproperties actually doesn't have any properties of a system table.
> > Its ID is > 100, it doesn't start with 'sys' and it doesn't have
> > sysobjects.type value of 's'.
> > For all intents and purposes it is a USER table.
> > EM uses it for its own special purposes, so EM displays it as a system
> > table, but that is only EM.
> > SQL Server itself has no idea there is anything special about this
table.
> >
> > --
> > HTH
> > --
> > Kalen Delaney
> > SQL Server MVP
> > www.SolidQualityLearning.com
> >
> >
> > "Aaron Bertrand [MVP]" <aaron@.TRASHaspfaq.com> wrote in message
> > news:OeoahUzKEHA.3472@.TK2MSFTNGP09.phx.gbl...
> > > Yes, I've never liked this fact...
> > >
> > > --
> > > Aaron Bertrand
> > > SQL Server MVP
> > > http://www.aspfaq.com/
> > >
> > >
> > >
> > >
> > > "Laser Lu" <anonymous@.discussions.microsoft.com> wrote in message
> > > news:410909B0-CA2A-4034-9C34-FE9E26723CA9@.microsoft.com...
> > > > >dtproperties holds any database diagrams that might exist.
> > > > Thank you very much!
> > > >
> > > >>Yes, it is a
> > > >>system table even though I have seen situations where it seems to be
> > > >>marked
> > > >>as a user table...
> > > > In the Management Console, it is displayed in the Tables list, and
> > marked
> > > > with the Type of 'system';
> > > > And However, just as you said, it will be grouped into 'User Tables'
> in
> > > > the Query Analyzer.
> > > >
> > >
> > >
> >
> >
>

Tuesday, March 20, 2012

question on renaming columns

Hi,
Quick question!
Is there anyway to rename a column such that it reflects all columns on all reference tables, stored procedures,views, etc.,
Ex. table1 is with col1 (primary key)

table2 with col2, col1(FK--table1(col1)

if i try to rename col1 on table1 it has to rename col1 on table2 automatically.
Any help is greatly appreciated.
-SSFirst, buy a magic wand....

I've left typos alone because it wasn't worth the risk...or energy...

Friday, March 9, 2012

question on join

I have a database with a many to many relation ...

table REFERENCE contains data about library items
table TOPIC contains the topics covered by these items
table REFERENCE_TOPIC contains the relation between the items in both tables.

suppose i want all the fields from the table REFERENCE but only where the topic is a certain value (i'm doing an ASP page, so it the querystring passed by the page)

would this select statement do the job?

"SELECT * FROM REFERENCE WHERE ([REFERENCE_TOPIC].ref_id=[REFERENCE].ref_id AND [REFERENCE_TOPIC].topic_id=" & Request.QueryString("topic_id")

i'm gonaa try ... hope to get some feed backThere are many methods to accomplish this.

1)
Select R.*
From REFERENCE R
INNER JOIN
REFERENCE_TOPIC RT
ON R.ID = RT.R_ID
INNER JOIN
TOPIC T ON
T.ID = RT.T_ID AND T.value = 'x'

2)
Select R.*
From REFERENCE R
where R.ID IN
(Select RT.R_ID
From REFERENCE_TOPIC RT
Where RT.T_ID IN
(Select T.ID
From TOPIC T
Where T.value ='X'))