none
sqlpackage.exe publish with SQL72014 error, .Net SqlClient Data Provider: Msg 8152, Level 16, State 14, Line 1 String or binary data would be truncated. RRS feed

  • Question

  • Hi, We are trying to use sqlpackage.exe to deploy a db and received

    "SQL72014 error, .Net SqlClient Data Provider: Msg 8152, Level 16, State 14, Line 1 String or binary data would be truncated". 

    We used /p:BlockOnPossibleDataLoss=False trying to get over this error but failed.

    There are also warnings as following but these should NOT be the cause of deployment's failure.

    SQL72015 but SQL 72014 error might be the real cause of deployment's failure. Warning SQL72015: The column [dbo].[table].[column] is being dropped, data loss could occur

    Does anyone have similar issue? and how  the issue is resolved?

    Thanks!



    • Edited by Su_TCC Thursday, September 13, 2012 4:54 PM
    Thursday, September 13, 2012 4:48 PM

Answers

  • Both are runtime errors/warnings, if you execute this inside the Visual Studio IDE you can double click on the error and it should bring you to the batch inside the SQL script that causes this problem.

    Hard to determine a work around without the source and target representation.


    -GertD @ www.sqlproj.com

    • Proposed as answer by Janet Yeilding Friday, September 14, 2012 6:04 PM
    • Marked as answer by Janet Yeilding Tuesday, September 18, 2012 6:05 PM
    Friday, September 14, 2012 12:22 AM
    Moderator

All replies

  • Both are runtime errors/warnings, if you execute this inside the Visual Studio IDE you can double click on the error and it should bring you to the batch inside the SQL script that causes this problem.

    Hard to determine a work around without the source and target representation.


    -GertD @ www.sqlproj.com

    • Proposed as answer by Janet Yeilding Friday, September 14, 2012 6:04 PM
    • Marked as answer by Janet Yeilding Tuesday, September 18, 2012 6:05 PM
    Friday, September 14, 2012 12:22 AM
    Moderator
  • How did you manage to resolve this? I am getting the same error in spite of BlockOnPossibleDataLoss = False

    sqlpackage.exe : *** Could not deploy package.
    At D:\Projects\CBI\CBI12_SVN\CbiReleaseAutomation\ReleaseAutomationApp\PowershellScripts\Test_Database_Update.ps1:34 char:13
    +             & $sqlpackage /Action:Publish /SourceFile:"$sourceDacPac" ...
    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (*** Could not deploy package.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError
     
    Warning SQL72015: The type for column Name in table [dbo].[Court] is currently  NVARCHAR (1000) NULL but is being changed to  NVARCHAR (50) NULL. Data loss could occur.
    Error SQL72014: .Net SqlClient Data Provider: Msg 8152,
     Level 16, State 13, Line 1 String or binary data would be truncated.
    Error SQL72045: Script execution error.  The executed script:
    ALTER TABLE [dbo].[Court] ALTER COLUMN [Name] NVARCHAR (50) NULL;


    Monday, September 9, 2019 12:29 PM