SQL Server

About

Tabulify supports SQL Server as source and target.

It inherits the attributes of the database system.

How to

Table Size

See SQL Server - Table Size

Support

Data Type

See Sql Server - Data Type Support

Upsert

Over the upsert operation, SqlServer does not use the SQL standard insert on conflict statement but a merge statement.

This merge statement requires a ON condition.

Tabulify sets it:

  • to the first unique key constraint
  • and if none is found, a standard insert statement is used.

Unable to truncate a table with a foreign key

Sql Server does not allow to truncate a table that has a foreign key even if the foreign table is empty.

You would get this kind of error:

Cannot truncate table 'master.dbo.d_date' because it is being referenced by a FOREIGN KEY constraint.

If you want to truncate, you need to use the force option to delete the foreign keys beforehands.

tabul data truncate --force mytable

Views

Views have so much constraint in SqlServer that we have created a dedicated page. Tabulify Sql Server View Support

Only one result set by SQL statement

The Sql Server driver does not support SQL statement that returns multiple result set.

getMoreResults returns the following error:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: This operation is not supported.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:248)
	at com.microsoft.sqlserver.jdbc.SQLServerException.throwNotSupportedException(SQLServerException.java:442)
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getMoreResults(SQLServerStatement.java:2398)

When a SQL Procedure is executed, the Print statement is printed as a execution warnings




Related HowTo
How to create an Microsoft SqlServer connection?

This howto shows you how to create a connection to an sqlserver database. An sqlserver connection supports : all common connection attributes Uri, user, password ... and all relational...
How to start and use the HowTo SqlServer database in Tabulify

This howto shows you how to: start an sqlserver database with the sqlserver howto docker service and use the @sqlserver default howto sqlserver connection in tabul commands. howto docker services...
SQL Server - Anonymous Code Block

In , an anonymous code block can be created with the BEGIN/END block. The next steps will be using the howto connection....

Task Runner