Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6985375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:40:19+00:00 2026-05-27T18:40:19+00:00

I read somewhere that if we create a table in master db by using

  • 0

I read somewhere that if we create a table in master db by using sp_sometablename it will be accessible from any other user database.

e.g.

use master
create table sp_TestTbl(Id int identity, Name varchar(20))
//Table created

Now if I execute the below

use test
select * from sp_TestTbl

it worked.

Whereas, if I don’t prefix the table name with sp_, though the table will be created in master db, but we cannot access it from any of the user database

use master
create table abc_TestTbl(Id int identity, Name varchar(20))

use test
select * from abc_TestTbl

Error:

Msg 208, Level 16, State 1, Line 6 Invalid object name
‘abc_TestTbl’.

what is the cause?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:40:20+00:00Added an answer on May 27, 2026 at 6:40 pm

    Try this:

    use master
    create table abc_TestTbl(Id int identity, Name varchar(20))
    
    use test
    select * from master.dbo.abc_TestTbl
    

    You need to fully qualify the table name when using from another DB

    BUT

    This is a completely bad idea – to create user objects in master database.

    The sp_ prefix is handled differently by Sql Server – it looks for the object in master DB first for this prefix

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To create a daemon I have read somewhere that in order to close all
I read somewhere that you would never run syncdb on a database, post its
I read somewhere that when creating a HTML email, you should use the table-based
I read somewhere that NTP is based on UDP and there's no security built
I read somewhere that one should never use error conditions as normal program flow.
I read somewhere that the ?: operator in C is slightly different in C++,
I read somewhere that Pattern Matching like that supported by the match/case feature in
I read somewhere that somebody could access a config value during run time but
I read somewhere that body temperature can be measured through touch screen since different
I read somewhere that, overriding is the means by which you get polymorphism. Polymorphism

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.