Setting up Azure SQL data sync's sync group - sql-server

I just tried setting up Azure SQL data sync's sync group using sample Azure SQL database. I am syncing dbo.BuildVersion table of the sample database.
I get the following error on member database.
Database provisioning failed with the exception "Incorrect syntax near the keyword 'NOT'.Inner exception: SqlException ID: 39f49622-6a56-4a44-8e55-2a646f99a584, Error Code: -2146232060 - SqlError Number:156, Message: SQL error with code 156 For more information, provide tracing ID ‘679953bc-7dac-4490-89e9-ea6d145d0442’ to customer support."
How should I resolve this issue?
Thanks

I am able to resolve this issue by creating empty table in the member database first and then running the sync.
Does Sync service not create table when table does not exist in the member database?

It does create it, however, under certain circumstances it fails to create it do to some issue with the schema itself. Therefore, the workaround, as you figured out, is to create the table manually.

Related

Snowflake - Querying External Table from Tableau

I am trying to use the Snowflake connector in Tableau to query an external Snowflake table.
I cannot see the external table in the list of all tables on the left pane in Tableau (only regular Snowflake tables), so I have tried to pull from the external table using SQL.
Running this from the Snowflake site gets me the contents of the external table:
select * from EXTERNAL_TABLE_NAME;
Running the same from the "New Custom SQL" dialog in Tableau's Snowflake connector gets me this:
SQL compilation error: Object 'EXTERNAL_TABLE_NAME' does not exist or not authorized.
I also tried the following:
select from #DATABASE_NAME.SCHEMA_NAME.STAGE_NAME.EXTERNAL_TABLE_NAME
...which gets me: SQL compilation error: Object does not exist, or operation cannot be performed.
Any thoughts on what I can do to get this to work? I don't think it is a permissioning issue because I am using the same account to auth in Tableau as I am on the Snowflake website.
I'm guessing that I simply need to do a better job pointing to the location where the external table is, but I can't figure it out.
Thanks in advance for your help!
Looks like this is a deeper permissioning issue that I will have to resolve with our Snowflake admin. I was able to pull to Tableau from an external Snowflake table successfully using a different ROLE and DATABASE, so marking this resolved.

java.sql.SQLException: No data read- jdbcTemplete

Trying to run the query using jdbcTemplete on oracle database where M_DB is the schema name and M_USER_DB is user for M_DB schema. M_USER_DB has certain tables on which I am trying to execute some queries like in springboot project
jdbcTemplate.query("SELECT * FROM M_USER_DB.C_USER_INFO", new ResultSetExtractor<HashMap<String, String>>()
However, while running the program its throwing below error:
No data read; nested exception is java.sql.SQLException: No data read
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
In the application.properties the database/datasource connection are for my primary Schema M_DB (not user M_USER_DB ). From SqlDeveloper, I can connect to M_DB and run the query like
select * from M_USER_DB.C_USER_INFO
without connecting to M_USER_INFO. I believe I need not to create primary and secondary jdbcTemplete here.
Any suggestion what could be the reason or anything I am missing? Thanks for help in advance.

Error reading View in PlayFab Shared Database: "Object 'REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER' does not exist or not authorized."

We have a Snowflake database that connects to a Shared View from PlayFab (for game events etc.) Stored procedures run daily via scheduled tasks to copy the latest data from the view into our own 'local' Snowflake table. It's been working fine, but today we're getting the following error trying to read from the PlayFab View:
Error: 100183: SQL compilation error: Failure during expansion of view 'PLAYFAB_ARCHIVE_SHARED': SQL compilation error: Object 'REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER' does not exist or not authorized.
I can't find any mention of the error number or REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER in the documentation. I believe error 100183 relates to a problem in a stored procedure, but I don't think it's my procedure, since I get the same error running a simple query from the PLAYFAB_ARCHIVE_SHARED view manually. I've checked the data from the PlayFab side, and it exists there. I'm not really sure whether the problem is Snowflake or PlayFab, but because of the error code, I suspect Snowflake.
I'm trying to get a direct support answer, but that doesn't seem to be happening for some reason. Anybody experienced this before?
PlayFab had mistakenly removed access to the view. Snowflake support confirmed that they could not find the view REPORT_PRIMARY.PUBLIC.ACCOUNT_MAPPER. After contacting PlayFab support, they re-enabled the shared view and Snowflake access is now working again.
In past I have faced similar error on view, Its because of the access could you run grant access on the stored procedure to your role.

SQL Server User-Defined Table Type / Crystal Reports Error

I was forwarded a Crystal Reports error message that said:
Failed to retrieve data from the database. ... Description: The EXECUTE permission was denied on the object 'xxxx_IDList', database 'DBName', schema 'dbo'.
There is an 'object?' named 'xxxx.IDList' under User-Defined Table Types - in the database.
I have never created or used a User-defined Table Type so I am just trying to figure out how to approach this error and how I might proceed with troubleshooting it.
I am hoping this is not an uncommon error.
Can anyone suggest an approach to solving this problem?
Thanks in advance!
In SQL server, any table that is not a system table is a user-defined table. So, anything in a typical non-system database that holds business data. The error message tells me that you have a database (dbname) on the server you are connecting to. In that database there is at least one schema (dbo, which is the default) and that the table xxxx_IDList lives in that schema.
Your app is trying to execute this table as if it was a function or stored procedure and you do not have permission to do that.
Do you have the source for the app that we can look at?

Oracle to MSSQL migration error 'The table xxx doesnot exist in target'

I am trying to convert and migrate an Oracle schema to MSSQL server. At the last step, migrating data, I get the error message:
The table [MYDATABASE].[MYSCHEMA].MYTABLE] doesnot exist in target. You must first convert the table then load it into the database.
This error message appears for each table in my schema.
Can someone explain what is happening and what I need to do to get past this?
Are you tries to migrate the data before doing the ‘synchronize with the database’ operation?
If Yes,
This error message generally occurs when the target table doesn’t
exist on SQL server database. After converting schema, you need to
synchronize the table with the database before migrating the data.
To do this you right click on the SQL Server database in Metadata
explorer and click “Synchronize with database” menu.
Note: Table structure will not be created in the SQL server database until you synchronize.

Resources