When creating new database manually in PowerShell using command
New-SPContentDatabase -Name $ContentDatabase -WebApplication $WebApplicationName
it works fine, but recently it has started to fail when it is run as part of nightly build. If I run the exact same scripts manually on the same farm, I get no errors. Error it gives is:
2015-12-08T07:51:03.8157500Z ##[error]New-SPContentDatabase : String or binary data would be truncated.
2015-12-08T07:51:03.8157500Z ##[error]The statement has been terminated.
2015-12-08T07:51:03.8157500Z ##[error]At E:\Builds\Plaza for SharePoint\Scripts\50_CreateModuleSiteCollections.ps1:36 char:9
2015-12-08T07:51:03.8157500Z ##[error]+ New-SPContentDatabase -Name $ContentDatabase -WebApplication $WebApplica ...
2015-12-08T07:51:03.8157500Z ##[error]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2015-12-08T07:51:03.8157500Z ##[error] + CategoryInfo : InvalidData: (Microsoft.Share...ContentDatabase:SPCmdletNewContentDatabase) [New-SPConte
2015-12-08T07:51:03.8157500Z ##[error] ntDatabase], SqlException
2015-12-08T07:51:03.8157500Z ##[error] + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewContentDatabase
In ULS logs it says things like:
System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. The statement has been terminated.
Unknown SQL Exception 8152 occurred. Additional error information from SQL Server is included below. String or binary data would be truncated. The statement has been terminated.
Exception occured during acquiring a server lock. System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. The statement has been terminated.
I have all the recent Windows Updates installed to SQL and SharePoint.
Any ideas?