er.mayankshukla - Wednesday, January 11, 2017 8:27 PM
I use to call this powershell script via batch file.Here is the code for the batch file@echo offpowershell -executionpolicy bypass -File C:\Users\mayank\Documents\Powershell\SqlMisc.ps1pauseJust change the path for the powershell script
Such utilities can be easily used by the developers in the team without making them approach to DBA for such tasks on various development or testing environments.
Who fixes it when either the MDF drive or the backup drive get's filled up? Who fixes it when one developer does a restore over a database of another that has a lot of critical test data in it?
I give my Developers a whole lot of freedom on the Dev boxes but backups and restores won't ever be one of them.
RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row. First step towards the paradigm shift of writing Set Based code: ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
"Change is inevitable... change for the better is not".
"Dear Lord... I'm a DBA so please give me patience because, if you give me strength, I'm going to need bail money too!" Helpful Links: How to post code problems How to Post Performance Problems Create a Tally Function (fnTally)
Tried to run the script in our environment it gives below error. Please help to fix it.
Exception calling "Open" with "0" argument(s): "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct an d that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"