Access tables which are created in dbo in MSSQL se

2019-07-24 12:31发布

问题:

I have connect MSSQL server through java using following Code

Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DATABASENAME=;instanceName=MSSQLSERVER", "DB_USER_NAME", "DB_PASSWORD");

After that I am able to connect database and execute sql script without giving any object name. for example

SELECT * FROM TEST_TABLE

Now, I have some tables which are got created under dbo and I want to access them using same connect. How Can I go with this? I have try with

SELECT * FROM dbo.TEST_TABLE1

but it says that this table is not there in database.

回答1:

Make your DB user to the DB owner.