T-SQL function 'json_object' not supported in Visual Studio / SSDT? - json

Visual Studio will no longer build a project since I started using the json_object function.
Code sample:
declare #j varchar(max) = json_object(
'key1': 'value1',
'key2': 'value2'
)
This works fine in Azure SQL DB.
When I update the database to my SSDT project, the project will not build, throwing a bunch of errors.
SQL46010: Incorrect syntax near 'key1'.`, `SQL80001: Incorrect syntax near ':'.
SQL80001: Incorrect syntax near ','.
SQL80001: Incorrect syntax near ','.
SQL80001: Incorrect syntax near ')'. Expecting '(', or SELECT.
I updated Visual Studio and SSDT to the latest versions. SSDT is version 1.4.
Is there any way I can update or configure Visual Studio to the latest SQL version? If not, can I get Visual Studio to suppress the errors linked to json_object so building and publishing will succeed?

Related

Strange syntax error in simple CREATE TABLE command - PostgreSQL, MySQL, & SQLite

I am getting a syntax error with PostgreSQL, MySQL, & SQLite that I don't understand. It occurs when the same CREATE TABLE command is run from Python and as a Query in pgAdmin4 and MySQL WorkBench. The same command works perfectly on SQL Server, using MS SQL Server Management Studio.
The command is:
create table asDataSpecs ( NumField1 integer, CharField1 char(30), CharField2 char(30) )
pgAdmin4 displays the error message:
LINE 1: ...e asDataSpecs ( NumField1 integer, CharField1 char(30), Char...
^
SQL state: 42601
Character: 62
MySQL generates an "Error Code: 1064" at the same point:
Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(30), CharField2 char(30) )' at line 1
PostgreSQL & MySQL understandably fail at the same point when this command is run in Python - as a .execute() on a cursor connected to the appropriate back-end and database.
SQLite (run using .execute() in the same Python program) produces an error presumably at the same point:
Failed 'Try' while attempting to create the 'asDataSpecs' table
near "(": syntax error
Why do PostgreSQL, MySQL, & SQLite accept the "integer" field, but reject the first "char" one - yet MS SQL Server runs it OK?
(I don't think it is a credentials issue, as I successfully used ODBC with the same credentials to create other tables in the same database - in all four backends. I would expect different error messages, if credentials were the issue - and it should not accept the numeric field.)
That was it - funky hidden characters. (There was some high-ASCII character instead of a normal space (ASCII 32) between the field name and data type.)
All platforms now work as expected, both in the Python program and the respective back-end management consoles.
For anyone who is interested, even NotePad++ displayed this as a space. But basic Windows NotePad revealed the mystery.
Thanks again, "sticky bit".

Fatal error encountered attempting to read the resultset In Mysql version 8.0.2

This errors occurred only when stored procedure used otherwise in inline query works. Mysql version is 8.0.21 and framework used - Visual studio 2012 ultimate.
enter image description here
This errors occurred only when stored procedure used otherwise inline query works. MySQL version is 8.0.21 and framework used - Visual studio 2012 ultimate.
Please help me. Thanks in advance
May be it is mysql version dll issue.
remove current mysql dll references and add old one mysql version dll references.
i am not sure it is correct or not. but this works for me.

Unrecognized statement type. (near "WITH" at position 0) even after upgrade MariaDB version

i have used xampp that include mariadb 10.1.x on windows pc.
As i need to use recursive cte function which needed at least mariadb 10.2.x, i try look for new xampp but not found any that have mariadb 10.2, so i do install mariadb 10.3 manually on xampp mysql folder. it worked and show me right version of mariadb 10.3 but when i try it on query it still return me error "Unrecognized statement near WITH" any suggestion to fix my problem?
WITH RECURSIVE category AS (
SELECT NULL AS col
UNION
SELECT "THIS NEVER SHOWS UP" AS col FROM category
)
*edited
even with example query from mariaDB doc it still give me same error
WITH keyword (Common Table Expressions) are not yet supported by phpmyadmin's sql parser yet
can check it here.
Until that to use the same syntax use other alternatives tools like sequal pro for macos etc or sql command line itself.

SQL syntax error in MySQL unsing a cast(Partition as Signed)

I have to support an application on a MySQL server. I can´t change the source code so I can´t change the used syntax.
My problem is that I always get an syntax error like this:
Microsoft OLE DB Provider for ODBC Drivers [-2147217900]
[MySQL][ODBC 5.1 Driver][mysqld-5.6.26]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near 'Partition as Signed)' at
line 1
I looked into the log file and found the problem in this line:
Select *
from XYZ
where `Type`='something'
and Client='{3DBEA33A-9F0A-4e86-8354-F652713EA458}'
order by Cast(Partition as Signed);
I always get this error when the "Cast(Partition as Signed)" appears.
Is there any way to configure the server to accept this syntax?
I´m using MySQL (x64) 5.6.26 with InnoDB.
Partition is reserved word.
http://dev.mysql.com/doc/refman/5.6/en/keywords.html
you should use it with backticks
`Partition`

SSRS could not create a list of fields for procedure

I'm Using Microsoft SQL Server Reporting Services to generate the business reports visual studio.
When i'm adding dataset with stored procedure, im getting this error:
Could not create a list of fields for the query.
Verify that you can connect to the data source and that your query syntax is correct.
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'PROCEDURE_NAME'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
stored procedure is simple select :
CREATE OR REPLACE PROCEDURE [PROCEDURE_NAME](L_CURSOR out SYS_REFCURSOR)
as
Begin
open L_CURSOR for
SELECT [columnname] FROM
[tablename]
End;
Configuration:
on visual studio 2013.
DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
Visual Studio Installed Products:
..
Oracle Developer Tools for Visual Studio Copyright (c) 2005, 2014
SQL Server Data Tools 12.0.30919.1 ...
The answer is of inside question. It is about provider.
Change my provider ODTwithODAC for 10g (my database version). And problem resolved.
Thank you for your helps,
Regards,
A