How to use spatial data types in SQL Server Database project

Hi guys,

I want to write the stored procedures and the UDF etc in managed code using C#CLR, however i am struggling to find the namespace to be used in SQL Database project type.

This name space https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.types.aspx has got the spatial data types but this is not available in the SQL Server Database project.

For instance i am writing a UDF in CLR managed code and i want to use the geography data type.

regards,
Ali ShahSQL DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zephyr_hex (Megan)DeveloperCommented:
Are you able to install the Microsoft.SqlServer.Types from NuGet ?  I had to do this in order to use SQL spatial types in my C# project.

using Microsoft.SqlServer.Types;

Open in new window


If you're still not able to include it after installing the NuGet package, try adding the dll as a reference in your project (you may need to use the Browse option in the Reference Manager)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ali ShahSQL DeveloperAuthor Commented:
Thanks with your suggestion i was able to download the dll file and then added it as a reference and it worked. i suppose perhaps in SQL Server i would need to register that dll.

regards,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.