Monday, March 19, 2012

Displaying the table owner

Hi,
How can I display the table owner and the table name in
the form of 'tableowner.tablename' from the 'sysobjects'
table. Another words, I want to add the table
owner 'sqlapp' to the table names in my select query.
Thanks for help.You'd be better off using information_Schema views.. try this
select table_schema + '.' + table_name from information_Schema.tables
where table_type = 'base table'
"Rick" <anonymous@.discussions.microsoft.com> wrote in message
news:89e501c3e9be$3a804a10$a001280a@.phx.gbl...
quote:

> Hi,
> How can I display the table owner and the table name in
> the form of 'tableowner.tablename' from the 'sysobjects'
> table. Another words, I want to add the table
> owner 'sqlapp' to the table names in my select query.
> Thanks for help.
|||I found it Thanks...This was what I needed...
select 'sqlapp.' + name from sysobjects
where xtype = 'U' and name <> 'dt_properties'
quote:

>--Original Message--
>You'd be better off using information_Schema views.. try

this
quote:

>select table_schema + '.' + table_name from

information_Schema.tables
quote:

>where table_type = 'base table'
>"Rick" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:89e501c3e9be$3a804a10$a001280a@.phx.gbl...
>
>.
>

No comments:

Post a Comment