0
Under review

Convert from SQL Server to Snowflake not working for "bit" and "datetime2" datatypes

robert 4 years ago updated by Support 4 years ago 2

When trying to convert a sql server table with the following format:

-- *********************** SqlDBM: Snowflake ************************
-- ******************************************************************


-- ************************************** "dbo"."tAlert"
CREATE TABLE "dbo"."tAlert"
(
"AlertId" int AUTOINCREMENT START 1 INCREMENT 1 NOT NULL,
"AlertcategoryId" int,
"PlantId" int,
"UnitId" int,
"EquipmentId" int,
"UserId" int,
"KPIId" int,
"SKUId" int,
"WorkOrderId" int,
"AlertName" nvarchar(100) NOT NULL,
"AlertDescription" nvarchar(255),
"AlertValue" numeric(18, 2),
"AlertDateTime" datetime,
"IsNotificationSent" bit NOT NULL,
"CreatedBy" nvarchar(100) NOT NULL,
"CreatedOn" datetime2(7),
"DowntimeId" int,
"HourResetDateTime" datetime2(7),
"NotificationDetails" varchar(max),
"Status" nvarchar(255),
"KPIDate" date,
"ShiftId" int,
"AlertType" varchar(200),
"ShiftResetDateTime" datetime,
"AlertDuration" varchar(100),
CONSTRAINT "pk_tAlert_AlertId" PRIMARY KEY ( "AlertId" )
)

The bit, datetime2(7) and varchar(max) cause the create table statement to fail.  We would like bit converted to boolean, varchar(max) to the largest varchar size for sql server and datetime2(7) to datetime(7).

I believe Snowflake converts these to timestamp_ntz or ltz of the same precision.

I appreciate your help in advance.

Thank you for reporting this issue, we will look into ant try tor resolve it soon.