cancel
Showing results for 
Search instead for 
Did you mean: 

why I cannot select * from TCPDB?

Former Member
0 Kudos

I can see that TCPDB in sysobjects.

However:

select * from 'TCPDB'

ends up with:

Server: Msg 170, Level 15, State 1, Line 1

Line 1: Incorrect syntax near 'TCPDB'.

I try SID.sid.TCPDB also get the same eeror.

Please help. Points!

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member193399
Active Participant
0 Kudos

try this

select * from <sid>.TCPDB

no need for single or double quotes.

RT

Former Member
0 Kudos

Thanks! Fixed.

Why sometimes we need to specify SID.sid.TABLE_NAME?

Please explain. Thx!

andreas_herzog
Active Contributor
0 Kudos

you have to use the appropriate database schema...

GreetZ, AH

former_member193399
Active Participant
0 Kudos

All the database objects in the <SID> database is either under SAP<SID> (ABAP stack objects it is SAPR3 in earlier versions) and SAP<SID>DB (Java stack objects). So any SAP tables has to be addressed using the schema prefix. If you are quering for SQL Server system tables then no need to do the schema prefix since these are under "dbo" schema.

I hope this answers your quesiton.

RT