tigertoolbox
tigertoolbox copied to clipboard
issue when Script Deployed with Powershell (POSH)
I'm able to execute SP without any issue if I've deployed directly from SSMS, But when I've deploy it using Powershell, SP created successfully and when i tried to execute its throwing an error like..
Msg 8152, Level 16, State 14, Procedure usp_bpcheck, Line 5704 String or binary data would be truncated.
Msg 8152, Level 16, State 4, Procedure usp_bpcheck, Line 6093 String or binary data would be truncated.
I tried multiple ways in POSH to deploy the SP every time I'm getting same error when SP executed. Please help me how to deploy the Store Proc using POSH without any run time errors.
POSH command used :
$attachSQLCMD1 = @" ......... BP CHECK Script .... "@ Invoke-Sqlcmd $attachSQLCMD1 -QueryTimeout 0 -ServerInstance $SQLServer
Thanks In advance!!
Add -MaxCharLength <Int32> to your Invoke-Sqlcmd
Add -MaxCharLength to your
Invoke-Sqlcmd
Thanks for your reply @marcingminski .
I'm able to run powershell script without any issue, already my invoke-sqlcmd have -maxcharlength ([int]::MaxValue)
issue with the SP after deployment with Posh.