Spatial data type in SQL Server Data Tools (SSDT) is not working - sql-server

I have a regular SQL Server view that refers to the planar spatial data type, geometry. When I import this database view into my SSDT project, it throws the following exception:
SQL70561: Cannot schema bind view 'MyView' because name 'geometry' is
invalid for schema binding. Names must be in a two-part format and an
object cannot reference itself.
It seems like the type geometry is not recognized by my SQL Server Database Project in Visual Studio. My target SQL Server version is 2016.
Here's the Visual Studio screenshot:
TIA

It took me two days to figure it out. So, whenever we have a view containing the clause WITH SCHEMABINDING it is forced to bind the schema for everything included in the PL/SQL block. In my case, it was trying to look under dbo and couldn't find geometry there. So, once I specified system schema sys in front of the geometry, it was accepted.
Hopefully, it helps someone in the future.

Related

How to find lineage between SSAS (Tabular Model) and SQL database

We have 20+ tabular cubes with 300+ dimensions and was hoping to find - if there is some automated way to find what is the source for this dimension
Yes manually, I can get into Tabular model > Table Properties and can find what view and table are used to populate dimension. However not practically possible to get for 300+ dimensions.
And yes, I know some 3rd party provider such as SQL Sentry has some tools which can find that lineage.
But just wondering, is there any SSAS DMVs or any other script which can give these details?
Much appreciated for all your help
Note: Environment is On-Prem Microsoft SQL 2016 suite (SQL DB, SSAS and SSIS)
For compatibility level 1200 or above Tabublar models the QueryDefinition column of the $SYSTEM.TMSCHEMA_PARTITIONS DMV will show the source SQL statement for either each partition, or the entire dimension/fact table if it isn't partitioned. In the event that a full table or view name is used (instead of a query) the full SELECT statement will be displayed with the object name. This can be queried from either SSMS by connecting to the SSAS server and opening a new MDX/DAX query window or another tool such as Dax Studio. This DMV is specific to whatever model you're connected to, as opposed to the whole SSAS instance. In the example below the Name column is the name of the dimension from the model. Since Name is a keyword it will need to be enclosed in brackets.
SELECT QueryDefinition FROM $SYSTEM.TMSCHEMA_PARTITIONS WHERE [Name] = 'DimensionName'

Don't see attributes (columns) in SQL Server Management Studio

I'm following a course on edX and I'm using the AdventureWorksLT database for the exercises, everything seems fine.
However, in the Object Explorer I can't see the attributes (columns) of a table.
When I expand the table I see 4 subfolders:
Keys (which generates an error when I try to open it)
Constraints
Triggers
Statistics
No attributes/columns of the table.
Does anyone know how to fix this? I really need this sometimes to see, for instance, the type of attribute (i.e. varchar or int).
The database is hosted on Microsoft Azure and I'm using SQL Server 2014 Management Studio and database.

How can I configure Sql Server Management Studio to ignore certain extended properties on a view when creating a BACPAC?

When I try to generate a BACPAC from a database running on a local MSSQL database I get an error:
One or more unsupported elements were found in the schema used as part of a data package.
Error SQL71564: The element Extended Property: [dbo].[EnabledCompany].[MS_DiagramPane1] is not supported when used as part of a data package (.bacpac file).
Error SQL71564: The element Extended Property: [dbo].[EnabledCompany].[MS_DiagramPaneCount] is not supported when used as part of a data package (.bacpac file).
(Microsoft.SqlServer.Dac)
[EnabledCompany] is a simple view made up of a select from a single table with a single where filter based on a bit column. (It only shows companies where IsEnabled == true).
I'm using SQL Server 2014 with the latest version of the tooling (SSMS).
One workaround for this is to delete the extended properties on the view.
This will then allow the database to be exported.
However, it will break the graphical designer for the view in question and so isn't ideal.

How to get SharePoint to “see” new SQL Views, Tables and Stored Procedures in SQL Server?

I’m trying to define new external content types, I’m able to connect to SQL Server and define external content types from tables, stored procedures and views that were already in the database.
The problem I’m having is that I created a new SQL View in SQL Server with the data I want, but when I try to define a new content type, SharePoint doesn’t show me the new SQL View in Data Source Explorer.
I thought it could possibly be the way the SQL view was created, so I created a new test Table, a new stored procedure but that didn’t work either.
I tried “Refresh All” and deleting and re-creating the connection in Data Source Explorer, but nothing seems to work.
It seems that any views, tables or stored procedures that I created after a certain point in time are not available in SharePoint
I’m using SharePoint 2010 and SQL Server Express Edition with Advanced Services (64bit)
Any help is greatly appreciated.
Thanks in advance,
Silvio

Migrating from Access to SSCE

I have an application with databases in MS Access. I want to migrate that to SSCE.
I have converted all the databases. Problem is with datasets.
Do I need to make all new datasets or there is a way to convert the existing ones to SSCE datasets?
Thanks
They should remain unchanged except for the connection string to the database (datasets are based on ADO.NET which talks both Jet SQL and TSQL.
For instance if your datasets use table adapters for their data you can change the connection strings in the table adaptor properties using Visual Studio's dataset editor (just double click the xsd file, right click on the desired table adapter and choose properties; in the property pane you can set the connection appropriately).

Resources