Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- u.name,
- o.name,
- case (o.type) when 'S' then 'SYSTEM TABLE' else 'TABLE' end,
- (select convert(varchar(8000), value) from ::fn_listextendedproperty(NULL, 'user', u.name, 'table', o.name, null, null) where name = 'MS_Description') as coln
- from
- sys.sysobjects o
- join sys.schemas u on (u.schema_id = o.uid)
- where
- o.type in ('U', 'S')
- and u.name = "something here"
- order by 1, 2
- SQLSTATE = 42000, Microsoft SQL Native Client, Incorrect Syntax near āuā
- select
- u.name,
- o.name,
- case (o.type) when 'S' then 'SYSTEM TABLE' else 'TABLE' end,
- convert(varchar(8000), ex.value) as coln
- from
- [%CATALOG%.]sys.sysobjects o
- join [%CATALOG%.]sys.schemas u on (u.schema_id = o.uid)
- cross apply ::fn_listextendedproperty(NULL, 'user', u.name, 'table', o.name, null, null) ex
- where
- o.type in ('U', 'S')
- [ and u.name = %.q:OWNER%]
- and ex.name = 'MS_Description'
- order by 1, 2
- [ and u.name = %.q:OWNER%]
Add Comment
Please, Sign In to add comment