If you encounter the System.Data.CData.Snowflake.SnowflakeException with the message " SQL compilation error: Object does not exist, or operation cannot be performed," this article provides guidance on addressing the issue.
This error is typically returned by Snowflake when attempting to access an incorrect Warehouse, Database, or Schema. Snowflake is case-sensitive, and it's essential to be aware that Databases and Schemes are generated in uppercase letters.
1. Verify Connection Property in Package Manager Console:
Ensure that the connection property in the Package Manager Console is correctly configured, especially when you are scaffolding specific tables.
Even a blank space in the connection property can trigger this error. Double-check the connection details for accuracy.
2. Set IgnoreCase=True in the Connection Property:
You can set the IgnoreCase=True in the connection property to instruct Snowflake to treat identifiers as case-insensitive.
The default behaviour is case-sensitive (IgnoreCase=False).
Example of updated scaffolding command with IgnoreCase=True:
Scaffold-DbContext "url=https://myaccount.region.snowflakecomputing.com;user=Admin;password=test123;Database=Northwind;Warehouse=TestWarehouse;Account=Test;IgnoreCase=True;" CData.EntityFrameworkCore.Snowflake -OutputDir Models -Context SnowflakeContext -Schema PUBLIC -Tables Products
If you continue to face issues after implementing the above steps, don't hesitate to contact CData support for further assistance and troubleshooting.