xDatabase icon indicating copy to clipboard operation
xDatabase copied to clipboard

Error while trying to use xDBpackage to export a bacpac

Open dpatelapx opened this issue 10 years ago • 2 comments

Hi, I am new to DSC and have encountered an error while trying use the xDBPackage to export a BACPAC file. I am getting the following error

"Error SQL71562: Error validating element [dbo].[XXXXX]: Procedure: [dbo].[XXXXX] has an unresolved reference to object [tempdb].[dbo].[SysObjects]. External references are not supported when creating a package from this platform. ". I am getting several such errors like

"Error SQL71562: Error validating element [dbo].[XXXXX]: Procedure: [dbo].[XXXXX] has an unresolved reference to object [master].[dbo].[sysmessages]. External references are not supported when creating a package from this platform.

Error SQL71562: Error validating element [dbo].[XXXXX]: Procedure: [dbo].[XXXXX] has an unresolved reference to object [msdb].[dbo].[sp_send_dbmail]. External referen ces are not supported when creating a package from this platform.

Error validating element [dbo].[XXXXX]: Procedure: [dbo].[XXXXX] has an unresolved reference to object [msdb].[dbo].[sp_send_dbmail].[@profile_name]. External references are not supported when creating a package from this platform."

Any help/guidance would be much appreciated here.

dpatelapx avatar Jul 02 '15 19:07 dpatelapx

Take a look at https://azure.microsoft.com/en-us/documentation/articles/sql-database-transact-sql-information/.

It is saying that when you use SQLPackage, you have to have a DB that complies with both SQLServer and Azure. Azure does not support DB Mail and you should probably use INFORMATION_SCHEMA instead of sysobjects. I have the same problem and did post a comment.

rmcmullan avatar Sep 26 '16 15:09 rmcmullan

I did find a way to do this successfully but it's sort of obscure.

When you are in VS creating your DACPAC, since you have a reference to MSDB, you will need to add it as a DB Reference. My solution has DB References to MSDB and Master. Right click each DB ref to bring up its property. Check for "Suppress Reference Warnings" and set that to True. By default it is false. Then create the DACPAC, populate it with data and then you can make the BACPAC okay. This was after commenting out the call to sp_send_dbmail.

rmcmullan avatar Sep 28 '16 18:09 rmcmullan