execute sql stored procedure in powershell

Solutions on MaxInterview for execute sql stored procedure in powershell by the best coders in the world

showing results for - "execute sql stored procedure in powershell"
Marcus
19 May 2016
1$rrex = Invoke-Sqlcmd -ServerInstance "OurServer" -Database "OurDatabase" -Query "EXEC stpGetData"
2
3foreach ($rrec in $rrex)
4{
5    if ($rrec.IdVar -notmatch "V-[1-8]{1}")
6    {
7        $rrec.Id
8    }
9}