Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server equivalent of hstore?

Is there an equivalent of Postgresql's hstore within SQL Server? I'm running SQL Server 2008 with a web application that has an increasingly large need for sparse key/value pairing on the database. It is not feasible in our situation to create a new column each time this occurs. Currently we use a standard column and throw all of this "schema-less" sparse data into a single column and then run checks in the application for the keys we need. This is not very clean/elegant.

I've just recently begun working on another project that uses Postgresql and uses hstore for a very similar problem. hstore is a much cleaner solution to the problem we have, so now I'm wondering if there is an equivalent feature within SQL Server 2008?

like image 937
bigtunacan Avatar asked Jan 22 '14 16:01

bigtunacan


People also ask

What is Hstore format?

This module implements the hstore data type for storing sets of key/value pairs within a single PostgreSQL value. This can be useful in various scenarios, such as rows with many attributes that are rarely examined, or semi-structured data. Keys and values are simply text strings.

What is Hstore?

hstore is a PostgreSQL extension that implements the hstore data type. It's a key-value data type for PostgreSQL that's been around since before JSON and JSONB data types were added.


1 Answers

MSSQL does not come with any builtin function similar to "hstore" unless you want to build your function that will return the value based on the key.

like image 113
vamsi Avatar answered Nov 15 '22 21:11

vamsi