Situation

Microsoft introduced a great feature in SQL Server 2016 that support JSON data. However, you can get the error

Invalid object name OPENJSON

when you work on databases that their compatibility level are lower than 130.

 

Solution

To fix this error, you need to update your database compatibility to 130

ALTER DATABASE <Database Name> SET COMPATIBILITY_LEVELĀ  = 130

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.