Necessity is the mother of new PowerShell code :-)! Today, I received an email request to get the list of all indexes in a given TableName but the requester did not specify the DatabaseName although the SQL InstanceName was specified. It would be too easy to ask the person for the DBName and script it … Continue reading PowerShell & SQL Server: Search & Find Indexes By SchemaName, TableName, IndexName Or ColumnName Across Instances/DB’s
Tag: Find
PowerShell: Invoke-RDPLogoff – Logoff From Windows Servers In Parallel
Recently, I changed my Windows password and that started a chain of events. My account would get locked out because an invalid password was used and I started getting weird errors in various programs when using the account even after getting it unlocked several times. Restarting my own PC did not help. Then, it occurred … Continue reading PowerShell: Invoke-RDPLogoff – Logoff From Windows Servers In Parallel
PowerShell: Find & Replace SQL Server Stored Procedure/View/UDF/Trigger Code En Masse Based On Custom Criteria
Update April 19, 2019: Thanks to Tim (in comments), the updated script can also do find/replace in not just stored procedures but also views, UDF's and triggers. Today, a need came-up where a bunch of stored procedures had to be altered based on certain criteria. Easy way: Obviously, the easiest way would be to script … Continue reading PowerShell: Find & Replace SQL Server Stored Procedure/View/UDF/Trigger Code En Masse Based On Custom Criteria