Ali Ahmadi
Ali Ahmadi

Reputation: 2417

Connect to sql server management studio with specific database name

I want connect to sql server with username and password, but in this server I have over of 100 databases.

1.How can I connect to sql server and see just databases that I have owner access(filter on databases with I access them) ?

2.How can I connect to sql server with specific database name (1 of 100 database name), for example : Northwind Db.

Upvotes: 3

Views: 5261

Answers (2)

bjnr
bjnr

Reputation: 3437

2/ Create a bat file with the following line of code:

ssms -S YourServerNameOrIP -d YourDbName -U UserName -P Password

or just run it in cmd

Upvotes: 4

bjnr
bjnr

Reputation: 3437

1/ By default, all databases can be seen by any user. In order to revoke the permission to view all databases for the connected user use this:

DENY VIEW ANY DATABASE TO <login>;

Upvotes: 0

Related Questions