Skip to main content
Tweeted twitter.com/StackDBAs/status/822940343993765890
removed a tag from the title, improved punctuation and grammar
Source Link
Andriy M
  • 23.2k
  • 6
  • 59
  • 103

SQL Server 2016 bug for Bug with sp_execute_external_script

I think I encountered a bug with [sp_execute_external_script][1]sp_execute_external_script, so here is the replay.

I will get an error if I run the following script:

Msg 8144, Level 16, State 2, Line 1
Procedure or function  has too many arguments specified.

Msg 8144, Level 16, State 2, Line 1
Procedure or function has too many arguments specified.

However, if I just move up the @output_data_1_name@output_data_1_name like the following:

and I will get a normal output:

[![enter image description here][2]][2]enter image description here

Does anyone know whether I am doing something wrong or it indeed could be a bug of sql serverin SQL Server 2016?

My environment is (by select @@versionselect @@version):

Update: I tested a little bit more and indeed the position of parameters will cause errors, such as following:

Oror this:

The error message will be:

Msg 214, Level 16, State 175, Procedure sp_execute_external_script, Line 1 [Batch Start Line 19]
Procedure expects parameter '@params' of type 'ntext/nchar/nvarchar'.

Msg 214, Level 16, State 175, Procedure sp_execute_external_script, Line 1 [Batch Start Line 19]
Procedure expects parameter '@params' of type 'ntext/nchar/nvarchar'.

But I actually give each parameter of type nvarcharnvarchar already.

I will consider open a bug report to MS if I do not see anyone pointing out my "errors" [1]: https://msdn.microsoft.com/en-US/library/mt604368.aspx [2]: https://i.sstatic.net/qgUtF.jpg.

SQL Server 2016 bug for sp_execute_external_script

I think I encountered a bug with [sp_execute_external_script][1], so here is the replay

I will get an error if I run the following script

Msg 8144, Level 16, State 2, Line 1
Procedure or function  has too many arguments specified.

However, if I just move up the @output_data_1_name like the following

and I will get

[![enter image description here][2]][2]

Does anyone know whether I am doing something wrong or it indeed could be a bug of sql server 2016?

My environment is (by select @@version):

Update: I tested a little bit more and indeed the position of parameters will cause errors, such as following

Or

The error message will be

Msg 214, Level 16, State 175, Procedure sp_execute_external_script, Line 1 [Batch Start Line 19]
Procedure expects parameter '@params' of type 'ntext/nchar/nvarchar'.

But I actually give each parameter of type nvarchar already.

I will consider open a bug report to MS if I do not see anyone pointing out my "errors" [1]: https://msdn.microsoft.com/en-US/library/mt604368.aspx [2]: https://i.sstatic.net/qgUtF.jpg

Bug with sp_execute_external_script

I think I encountered a bug with sp_execute_external_script, so here is the replay.

I will get an error if I run the following script:

Msg 8144, Level 16, State 2, Line 1
Procedure or function has too many arguments specified.

However, if I just move up the @output_data_1_name like the following:

I will get a normal output:

enter image description here

Does anyone know whether I am doing something wrong or it indeed could be a bug in SQL Server 2016?

My environment is (by select @@version):

Update: I tested a little bit more and indeed the position of parameters will cause errors, such as following:

or this:

The error message will be:

Msg 214, Level 16, State 175, Procedure sp_execute_external_script, Line 1 [Batch Start Line 19]
Procedure expects parameter '@params' of type 'ntext/nchar/nvarchar'.

But I actually give each parameter of type nvarchar already.

I will consider open a bug report to MS if I do not see anyone pointing out my "errors".

adding more examples
Source Link
jyao
  • 3.1k
  • 1
  • 13
  • 27

I think I encountered a bug with sp_execute_external_script[sp_execute_external_script][1], so here is the replay

enter image description here [![enter image description here][2]][2]

Microsoft SQL Server 2016 (SP1-CU1) (KB3208177) - 13.0.4411.0 (X64) 
    Jan  6 2017 14:24:37 
    Copyright (c) Microsoft Corporation
    Developer Edition (64-bit) on Windows 10 Pro 6.3 <X64> (Build 14393: )

Update: I tested a little bit more and indeed the position of parameters will cause errors, such as following

exec sp_execute_external_script 
 @script = N' result <- as.data.frame(c(i, j));'
, @output_data_1_name = N'result' -- the position of this param caused NO problem
, @params = N'@i varchar(100), @j varchar(100)'
, @i = N'hello'
, @j = N'world'
, @language=N'R' -- if I put @language here, it will cause error
with result sets ((test varchar(100)));

Or

exec sp_execute_external_script  @language=N'R'
, @script = N' result <- as.data.frame(c(i, j));'
, @output_data_1_name = N'result' -- the position of this param caused NO problem
, @i = N'hello'
, @j = N'world'
, @params = N'@i varchar(100), @j varchar(100)'
with result sets ((test varchar(100)));

The error message will be

Msg 214, Level 16, State 175, Procedure sp_execute_external_script, Line 1 [Batch Start Line 19]
Procedure expects parameter '@params' of type 'ntext/nchar/nvarchar'.

But I actually give each parameter of type nvarchar already.

I will consider open a bug report to MS if I do not see anyone pointing out my "errors" [1]: https://msdn.microsoft.com/en-US/library/mt604368.aspx [2]: https://i.sstatic.net/qgUtF.jpg

I think I encountered a bug with sp_execute_external_script, so here is the replay

enter image description here

Microsoft SQL Server 2016 (SP1-CU1) (KB3208177) - 13.0.4411.0 (X64) 
    Jan  6 2017 14:24:37 
    Copyright (c) Microsoft Corporation
    Developer Edition (64-bit) on Windows 10 Pro 6.3 <X64> (Build 14393: )

I think I encountered a bug with [sp_execute_external_script][1], so here is the replay

[![enter image description here][2]][2]

Microsoft SQL Server 2016 (SP1-CU1) (KB3208177) - 13.0.4411.0 (X64) 
    Jan  6 2017 14:24:37 
    Copyright (c) Microsoft Corporation
    Developer Edition (64-bit) on Windows 10 Pro 6.3 <X64> (Build 14393: )

Update: I tested a little bit more and indeed the position of parameters will cause errors, such as following

exec sp_execute_external_script 
 @script = N' result <- as.data.frame(c(i, j));'
, @output_data_1_name = N'result' -- the position of this param caused NO problem
, @params = N'@i varchar(100), @j varchar(100)'
, @i = N'hello'
, @j = N'world'
, @language=N'R' -- if I put @language here, it will cause error
with result sets ((test varchar(100)));

Or

exec sp_execute_external_script  @language=N'R'
, @script = N' result <- as.data.frame(c(i, j));'
, @output_data_1_name = N'result' -- the position of this param caused NO problem
, @i = N'hello'
, @j = N'world'
, @params = N'@i varchar(100), @j varchar(100)'
with result sets ((test varchar(100)));

The error message will be

Msg 214, Level 16, State 175, Procedure sp_execute_external_script, Line 1 [Batch Start Line 19]
Procedure expects parameter '@params' of type 'ntext/nchar/nvarchar'.

But I actually give each parameter of type nvarchar already.

I will consider open a bug report to MS if I do not see anyone pointing out my "errors" [1]: https://msdn.microsoft.com/en-US/library/mt604368.aspx [2]: https://i.sstatic.net/qgUtF.jpg

Source Link
jyao
  • 3.1k
  • 1
  • 13
  • 27
Loading