We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I noticed that when the value of the parameter of tested procedure is equal to the sql keyword - procedure tSQLt.ResultSetFilter returns an error:
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'AS'.
Test script:
USE tSQLt_Example GO IF OBJECT_ID('dbo.uspForTest') IS NOT NULL DROP PROCEDURE dbo.uspForTest GO CREATE PROCEDURE dbo.uspForTest ( @InParam01 VARCHAR(20) ) AS BEGIN SELECT @InParam01 [InParam01] ENd GO IF OBJECT_ID('dbo.test_uspForTest') IS NOT NULL DROP PROCEDURE dbo.test_uspForTest GO -- ok test case CREATE PROCEDURE dbo.test_uspForTest AS BEGIN CREATE TABLE #uspForTest ( InParam01 VARCHAR(20) ) DECLARE @command VARCHAR(4000) DECLARE @InParam01 VARCHAR(20) SET @InParam01 = 'AT' SET @command = 'EXEC dbo.uspForTest @InParam01 = ' + @InParam01 INSERT INTO #uspForTest EXEC tSQLt.ResultSetFilter @ResultsetNo = 1 , @command = @command SELECT * FROM #uspForTest END GO EXEC tSQLt.Run '[dbo].[test_uspForTest]' GO -- error test case ALTER PROCEDURE dbo.test_uspForTest AS BEGIN CREATE TABLE #uspForTest ( InParam01 VARCHAR(20) ) DECLARE @command VARCHAR(4000) DECLARE @InParam01 VARCHAR(20) SET @InParam01 = 'AS' SET @command = 'EXEC dbo.uspForTest @InParam01 = ' + @InParam01 INSERT INTO #uspForTest EXEC tSQLt.ResultSetFilter @ResultsetNo = 1 , @command = @command SELECT * FROM #uspForTest END GO EXEC tSQLt.Run '[dbo].[test_uspForTest]' GO
USE tSQLt_Example GO
IF OBJECT_ID('dbo.uspForTest') IS NOT NULL DROP PROCEDURE dbo.uspForTest GO
CREATE PROCEDURE dbo.uspForTest ( @InParam01 VARCHAR(20) ) AS BEGIN SELECT @InParam01 [InParam01] ENd GO
IF OBJECT_ID('dbo.test_uspForTest') IS NOT NULL DROP PROCEDURE dbo.test_uspForTest GO
-- ok test case CREATE PROCEDURE dbo.test_uspForTest AS BEGIN
CREATE TABLE #uspForTest ( InParam01 VARCHAR(20) )
DECLARE @command VARCHAR(4000) DECLARE @InParam01 VARCHAR(20)
SET @InParam01 = 'AT'
SET @command = 'EXEC dbo.uspForTest @InParam01 = ' + @InParam01
INSERT INTO #uspForTest EXEC tSQLt.ResultSetFilter @ResultsetNo = 1 , @command = @command
SELECT * FROM #uspForTest END GO
EXEC tSQLt.Run '[dbo].[test_uspForTest]' GO
-- error test case ALTER PROCEDURE dbo.test_uspForTest AS BEGIN
SET @InParam01 = 'AS'
The text was updated successfully, but these errors were encountered:
Solution:
SET @InParam01 = '''AS'''
Issue to CLOSE.
Sorry, something went wrong.
This is not a ResultSetFilter issue. But it looks like you figured that out already.
Merge pull request #4 from LarryBlake/docs-001
00311b2
Docs 001
No branches or pull requests
Hello,
I noticed that when the value of the parameter of tested procedure is equal to the sql keyword - procedure tSQLt.ResultSetFilter returns an error:
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'AS'.
Test script:
The text was updated successfully, but these errors were encountered: