Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql server base tables

I use SQL Server 2012.

How can select from sql server system base table such as below tables.

  • sys.sysschobjs
  • sys.sysbinobjs
  • sys.sysclsobjs

When I get query from base system table such as below query. get following error.

select * from sys.sysschobjs


Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.sysschobjs'.
like image 420
mehdi lotfi Avatar asked Sep 12 '25 21:09

mehdi lotfi


2 Answers

It is doable if you used a "Database Engine Query", and an administrator user. To do so, after you open the SQL Management Studio: Click File Menu, "New" sub menu, and select "Database Engine Query". In the server name, write "Admin:" before your server name (eg., if your server name is "localhost", then the full server name to be written is "admin:localhost") Then write your credentials (for administrative account).

N.B.: Make sure that there are no other administrator logged in to the Database Engine Query other than you (I believe it is a single access point)

For more information:

http://technet.microsoft.com/en-us/library/ms178068(v=sql.105).aspx

http://zarez.net/?p=774

like image 73
CodingMate Avatar answered Sep 15 '25 11:09

CodingMate


To query this system base tables needs a Dedicated Administrator Console (DAC).

First, connect to your database using the DAC. To do this from SQL Server Management Studio, go to File -> New -> Database Engine Query. Put ADMIN: in front of your instance name and click Connect.

Change to the your database using the USE [mydb]

Now you can query

select * from sys.sysschobjs

See this post for further info on this:

http://www.hackingsqlserver.com/

https://sqlblog.org/2011/11/08/t-sql-tuesday-24-dude-wheres-the-rest-of-my-procedure

like image 40
Rahul Avatar answered Sep 15 '25 09:09

Rahul