I digged into it, and it's really weird. It seems there is a conflict between Groovy SQL and MS SQL. I am not sure yet, but it seems that Groovy passes connection info wrong to SQl Server. Specifically, it sends the database name into the port number.
Here is my workaround.
sql = Sql.newInstance("jdbc:sqlserver://localhost:1898", "eviware", "eviware",
"com.microsoft.sqlserver.jdbc.SQLServerDriver")
sql.execute("insert into eviware_demo_datainsert.dbo.eviware_tb_datainsert (Author, NumberOfBooks) values (${AuthorName}, ${ResultCount})")
That is; I removed the database name from the connection string (jdbc:sqlserver://localhost:1898" insted of jdbc:sqlserver://localhost:1898/eviware_demo_datainsert" )
and moved it to the query itself
(eviware_demo_datainsert.dbo.eviware_tb_datainsert (Author, NumberOfBooks) values (${AuthorName}, ${ResultCount})") instead of eviware_tb_datainsert (Author, NumberOfBooks) values (${AuthorName}, ${ResultCount})"))
Here is the full Groovy code to replace the code in the example:
--------------------------------------------------------------------------------
import groovy.sql.Sql
def authorStep = testRunner.testCase.getTestStepByName( "GetData" )
def resultStep = testRunner.testCase.getTestStepByName( "ResultProperties" )
AuthorName = authorStep.getPropertyValue( "Author" )
ResultCount = resultStep.getPropertyValue( "TotalResults" )
sql = Sql.newInstance("jdbc:sqlserver://localhost:1898", "eviware", "eviware",
"com.microsoft.sqlserver.jdbc.SQLServerDriver")
sql.execute("insert into eviware_demo_datainsert.dbo.eviware_tb_datainsert (Author, NumberOfBooks) values (${AuthorName}, ${ResultCount})")