tigertoolbox icon indicating copy to clipboard operation
tigertoolbox copied to clipboard

issue when Script Deployed with Powershell (POSH)

Open durgaganeshpolisetti opened this issue 5 years ago • 2 comments

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!!

durgaganeshpolisetti avatar Apr 01 '20 18:04 durgaganeshpolisetti

Add -MaxCharLength <Int32> to your Invoke-Sqlcmd

marcingminski avatar Apr 01 '20 21:04 marcingminski

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.

durgaganeshpolisetti avatar Apr 02 '20 05:04 durgaganeshpolisetti