Tabulify supports Sql Server as source and target.
To use the Howto sqlserver connection, you can start a local SqlServer with the following docker command:
docker run \
-e MSSQL_SA_PASSWORD=TheSecret1! \
-e ACCEPT_EULA=Y \
-p 1433:1433 \
-d \
--name sqlserver \
mcr.microsoft.com/mssql/server:2022-CU18-ubuntu-22.04
Tabulify modifies the default length for VARCHAR and NVARCHAR from 1 to max
max is the default for most database and avoid many problem when the length is not defined (ie nobody wants to store 1 character in a varchar).
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.
We map:
Because Sql Server does not support time with time zone, we translate it to the time sql server type when creating a table from a third database.
Sql Server does not support the truncate operations on 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 drop and recreate
Sql Server does not support dependencies on view (ie dependent on the table used in the view), meaning any with-dependencies operation on view will not see them.
Order By is not supported by Sql Server in derived table such as:
unless TOP, OFFSET or FOR XML is specified.
Example: if you create this view:
create view "error_orderby" as
select
"cat_id",
"cat_desc",
"load_timestamp"
from "master"."dbo"."d_category"
order by "cat_id"
You would get this error:
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries,
and common table expressions, unless TOP, OFFSET or FOR XML is also specified.
Sql Server requires an alias for each select expression in a query.
For instance:
create view "alias_error" as
select
avg(sales_price),
avg(sales_qty)
from "f_sales"
Create View or Function failed because no column name was specified for column 1.