SSC-FDM-TS0016

XML columns in Snowflake might have a different format

Description

This warning is added when an SQL Server FOR XML clause is transformed to its Snowflake equivalent. It is added because columns in XML could be different.

Code Example

Given the following table called employee as an example.

Id
Name
Hint

1

Kinslee Park

Developer

2

Ezra Mata

Developer

3

Aliana Quinn

Manager

Input Code:

IN -> SqlServer_01.sql
SELECT
  	e.id,
  	e.name as full_name,
  	e.hint
  FROM
  	employee e
  FOR XML PATH;

Output Code:

OUT -> SqlServer_01.sql
SELECT
	--** SSC-FDM-TS0016 - XML COLUMNS IN SNOWFLAKE MIGHT HAVE A DIFFERENT FORMAT **
	FOR_XML_UDF(OBJECT_CONSTRUCT('id', e.id, 'full_name', e.name, 'hint', e.hint), 'row')
FROM
	employee e;

Recommendations

Last updated