'Getting the SQL71561 error while migrating the DB from MS SQL to MS Azure
I have a scenario where I'm calling two different DB in a single view like below.
[DB_Name].[Schema].[Table_Name]
The view is working fine.
Currently I want to migrate the Database to Azure where I have this view. Azure is not allowing me to specify the database name in view. Is there any workaround available to fix this issue. Please advise.
Thanks.
I have tried to remove the db name in view but it resulted in a error.
Solution 1:[1]
To resolve the?SQL71561 build error?please follow:
Add a reference to the other database, clear out the?"Database variable"?field in the dialog. If you don't clear this field, when doing a schema compare, SSDT would generate the script using the database variable name, which would fail.
- Add a Database Reference to the project.
- If in case the other database was another project in the same solution, you would be able to select it in the first drop down on the "Add Database Reference" dialog.
- Make sure the text in the "Database name" field is correct.
- Clear out the "Database variable" field.
Look at the "Example usage" text and verify that it looks as expected. Click "OK" to add the reference and that should take care of the 'unresolved reference' errors.
After doing this, you will be able to do a schema comparison, but could get the following error:
Error 408 SQL00208: Invalid object name 'db.schema.table'.
**Go to the project properties and uncheck "Enable extended Transact-SQL verification for common objects" will allow the project to build successfully. **
Consider and follow the below steps when converting existing DB to SSDT:
Create a new SSDT database project
Import the existing DB into that project, which will recreate all the script files and change the way they are organized/grouped
Do some cleanup on a few of the script files, including the post-deploy script
If it is SQLCLR project, make sure master DB stuff has done right (creating logins)
4.1 Make sure SQLCLR is enabled and configured correctly in the SSDT project's SQLCLR property page
4.2 Copy the source code for the SQL CLR into the top level of the project
4.3 Add the references need by the SQL CLR code
Compile
Publish
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PratikLad-MT |