SQL Server: The sqlps PowerShell for easy Database File Navigation

In the previous article, I have shared basic detail about the working with the Windows PowerShell for the SQL Server.

SQL Server 2012: Working with the PowerShell Environment

Using sqlps PowerShell provider, you can easily navigate all files of SQL Server Instance like any other file system.

When Database Administrator requires to navigate or search different objects of a Database, PowerShell is much faster than T-SQL.
At single window DBA can navigate all different objects and file of a Database Server and it saves the time of Database Administrator to write a multiple T-SQL for accessing database instance information.

First start, PowerShell by right clicking on database in SSMS.

SQL Server PowerShell

In that root path, you can execute [dir] command to get a list of all SQL Server Folders.

SQL Server PowerShell Dir

Using [cd], you can select any folder like below, I have selected Databases folder.

SQL Server PowerShell CD

Execute [dir] for Databases.

SQL Server PowerShell DB Dir

Using [cd..], you can go back to a particular folder and can select a new folder.
In below example, I have selected Logins folder.
You can easily get all the available Logins by execution [dir] on that folder.

SQL Server PowerShell Change CD

Another example is to list out all tables of a particular database.
select Databases -> Database -> Tables.

SQL Server PowerShell Tables Dir

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of