Category: Powershell

Script SQL Objects with Powershell

Like so many of you out there in Internetland, I’m fairly new to Powershell, which is fairly new to the world. Recently I wanted a simple way to script out database objects, and a couple of you were kind enough to share your solutions with me. Sean Likes Powershell I also worked with Sean, who […]

Index Rebuilds: SQL vs. PowerShell

I thought this conversation worth reporting…Sean and I were comparing our scripts to create rebuild / reorgs, and he sent this: DECLARE @currSchema VARCHAR(100) ,   @currTableName VARCHAR(100) ,   @SQL NVARCHAR(200) DECLARE Tables CURSOR read_only FOR SELECT SS.name ,    SO.name    FROM sys.objects SO    INNER JOIN sys.schemas SS ON SO.schema_id = SS.schema_id […]