Peristiwa
31 Mac, 11 PTG - 2 Apr, 11 PTG
Acara pembelajaran SQL, Fabric dan Power BI terbesar. 31 Mac - 2 April. Gunakan kod FABINSIDER untuk menjimatkan $400.
Daftar hari iniPelayar ini tidak lagi disokong.
Naik taraf kepada Microsoft Edge untuk memanfaatkan ciri, kemas kini keselamatan dan sokongan teknikal yang terkini.
The Conversion page of the Project Settings dialog box contains settings that customize how SSMA converts SAP Adaptive Server Enterprise (ASE) syntax to SQL Server or Azure SQL syntax.
The Conversion pane is available in the Project Settings and Default Project Settings dialog boxes:
If you want to specify settings for all SSMA projects, on the Tools menu, select Default Project Settings, click General at the bottom of the left pane, and then click Conversion.
To specify settings for the current project, on the Tools menu, select Project Settings, click General at the bottom of the left pane, and then click Conversion.
SQL Server/Azure SQL and ASE use different error codes.
Use this setting to specify the type of message (Warning or Error) that SSMA shows in the Output or Error List pane when it encounters a reference to @@ERROR
in the ASE code.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Convert and mark with warning |
Optimistic | Convert and mark with warning |
Full | Mark with error |
Specifies whether to convert LIKE
operands to match SAP ASE behavior. The point is that ASE trims trailing blanks in a like pattern. The workaround is to make a cast of right expression to a fixed length data type with a maximum precision.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Simple conversion |
Optimistic | Simple conversion |
Full | Cast to fixed length |
Specifies how to handle empty or blank strings within CONVERT
or CAST
expressions with numeric type as datatype argument. The following options are available for this setting:
{s}
will be replaced with CASE ltrim(rtrim({s})) WHEN "" THEN 0 else {s} END
expression.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Simple conversion |
Optimistic | Simple conversion |
Full | Empty string as zero numeric |
This setting specifies how to convert string concatenation with NULL
. The following options can be set for this particular setting:
string_expression
in concatenation will be wrapped with ISNULL(string_expression)
and NULL
s will be replaced with empty string.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Keep current syntax |
Optimistic | Keep current syntax |
Full | Wrap with ISNULL function |
This setting specifies how to convert empty strings. The following options can be set for this particular setting:
To use the SQL Server/Azure SQL behavior, select Keep current syntax.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Keep current syntax |
Optimistic | Keep current syntax |
Full | Replace all string expressions with space |
The conversion of binary values to numbers can return different values on different platforms. For example, on x86 processors, CONVERT(integer, 0x00000100)
returns 65536
in ASE, but 256
in SQL Server. ASE also returns different values depending on byte order.
Use this setting to control how SSMA converts CONVERT
and CAST
expressions that contain binary values:
Select Convert and mark with warning to have SSMA convert and correct the expressions, and mark all converted expressions with warning comments.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Convert and mark with warning |
Optimistic | Simple conversion |
Full | Convert and correct |
Use this setting to specify the type of message (Warning or Error) that SSMA shows in the Output or Error List pane when it encounters dynamic SQL in the ASE code.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Convert and mark with warning |
Optimistic | Convert and mark with warning |
Full | Mark with error |
In SQL Server/Azure SQL, if the ANSI_NULLS
setting is on, SQL Server/Azure SQL returns UNKNOWN
when any equality comparison contains a NULL
value. If ANSI_NULLS
is off, equality comparisons that contain NULL
values return true when the compared column and expression or two expressions are both NULL
. By default (ANSINULL OFF
) SAP ASE equality comparisons behave like SQL Server/Azure SQL with ANSI_NULLS OFF
.
NULL
values. Use this setting if ANSI_NULLS
is OFF
in SQL Server/Azure SQL or if you want to revise equality comparisons on a per-case basis.NULL
values by using the IS NULL
and IS NOT NULL
clauses.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Simple conversion |
Optimistic | Simple conversion |
Full | Consider NULL values |
SQL Server/Azure SQL no longer supports the format_string
argument in PRINT
and RAISERROR
statements. The format_string
argument allowed to put replaceable parameters directly in the string, and then replacing the parameters at runtime. Instead, SQL Server requires the full string by using either a string literal, or a string built by using a variable. For more information, see the PRINT (Transact-SQL) topic.
When SSMA encounters a format_string
argument, it can either build a string literal using the variables or create a new variable and build a string by using that variable.
To use a string literal for PRINT
and RAISERROR
functions, select Create new string.
In this mode, if a PRINT or RAISERROR statement does not use placeholders and local variables, the statement is unchanged. Double percent characters (%%) are changed to a single percent character % in PRINT string literals.
If a PRINT or RAISERROR statement uses placeholders and one or more local variables, such as in the following example:
PRINT 'Total: %1!%%', @percent
SSMA will convert it to the following syntax:
PRINT 'Total: '+ CAST(@percent AS varchar(max)) + '%'
If format_string
is a variable, such as in the following statement:
PRINT @fmt, @arg1, @arg2
SSMA cannot do a simple string conversion, and must create a new variable:
DECLARE @print_format_1 varchar(max)
SET @print_format_1 =
REPLACE (@fmt, '%%', '%')
SET @print_format_1 =
REPLACE (@print_format_1, '%1!',
CAST (@arg1 AS varchar(max)))
SET @print_format_1 =
REPLACE (@print_format_1, '%2!',
CAST (@arg2 AS varchar(max)))
PRINT @print_format_1
When it uses Create new string mode, SSMA assumes that the SQL Server option CONCAT_NULL_YIELDS_NULL
is OFF
. Therefore, SSMA does not check for null arguments.
To have SSMA build a new variable for each PRINT
and RAISERROR
statement, and then use that variable for the string value, select Create new variable.
In this mode, if a PRINT
or RAISERROR
statement does not use placeholders and local variables, SSMA replaces all double percent characters (%%
) with single percent characters to comply with SQL Server/Azure SQL syntax.
If a PRINT
or RAISERROR
statement uses placeholders and one or more local variables, such as in the following example:
PRINT 'Total: %1!%%', @percent
SSMA will convert it to the following syntax:
DECLARE @print_format_1 varchar(max)
SET @print_format_1 = 'Total: %1!%'
SET @print_format_1 =
REPLACE (@print_format_1, '%1!',
ISNULL(CAST (@percent AS VARCHAR(max)), ''))
PRINT @print_format_1
If format_string
is a variable, such as in the following statement:
PRINT @fmt, @arg1, @arg2
SSMA creates a new variable as follows, checking for null values in each argument:
DECLARE @print_format_1 varchar(max)
SET @print_format_1 =
REPLACE (@fmt, '%%', '%')
SET @print_format_1 =
REPLACE (@print_format_1, '%1!',
ISNULL(CAST (@arg1 AS varchar(max)),''))
SET @print_format_1 =
REPLACE (@print_format_1, '%2!',
ISNULL(CAST (@arg2 AS varchar(max)),''))
PRINT @print_format_1
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Create new string |
Optimistic | Create new string |
Full | Create new variable |
SQL Server/Azure SQL does not support inserting explicit values into a timestamp column.
INSERT
statements, select Exclude column.INSERT
statement, select Mark with error. In this mode, INSERT
statements will not be converted and will be marked with error comments.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Exclude column |
Optimistic | Exclude column |
Full | Mark with error |
This setting specifies if the temporary objects definitions which appear in the procedures should be stored in the source metadata during conversion.
Mode | Value |
---|---|
Default | Yes |
Optimistic | Yes |
Full | No |
Specifies if ASE proxy tables are converted to SQL Server/Azure SQL tables, or are not converted and the code is marked with error comments.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Mark with error |
Optimistic | Mark with error |
Full | Mark with error |
ASE user messages are stored in each database. SQL Server user messages are centrally stored and made available through the sys.messages
catalog view. In addition ASE user messages start at 20000
, but SQL Server error messages start at 50001
.
This setting specifies the number to add to the ASE user message number to convert it to a SQL Server user message. If your SQL Server has user messages in the sys.messages
catalog view, you might have to change this number to a higher value. This is so the converted message numbers do not conflict with existing message numbers.
Note the following:
17000
-19999
are from the sysmessages
system table and are not converted.RAISERROR
statement is a constant, SSMA will add the base message number to the constant to determine the new user message number.CONCAT_NULL_YIELDS_NULL
is OFF
and makes no checks for NULL
arguments.NULL
arguments.RAISERROR
with arg-list
argument is not converted.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | 30001 |
Optimistic | 30001 |
Full | 30001 |
Use this setting to specify the type of message (Warning or Error) that SSMA shows in the Output or Error List pane when it encounters the use of ASE system objects.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Convert and mark with warning |
Optimistic | Convert and mark with warning |
Full | Mark with error |
Use this setting to specify the type of message (Warning or Error) that SSMA shows in the Output or Error List pane when it cannot resolve an identifier.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Convert and mark with warning |
Optimistic | Convert and mark with warning |
Full | Mark with error |
In ASE, CHARINDEX
returns NULL
only if all input expressions are NULL
. SQL Server/Azure SQL will return NULL
if any input expression is NULL
.
CHARINDEX
function is substituted with a call to either CHARINDEX_VARCHAR
or CHARINDEX_NVARCHAR
user defined function based on the type of parameters passed (created in the user database under the schema name s2ss
) to emulate the SAP ASE behavior.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Keep current syntax |
Optimistic | Keep current syntax |
Full | Replace function |
SQL Server/Azure SQL and ASE differ in the value returned by the DATALENGTH
function when the value is a single space. In this case, SQL Server/Azure SQL returns 0
and ASE returns 1
.
DATALENGTH
function are substituted with CASE
expression to emulate SAP ASE behavior.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Keep current syntax |
Optimistic | Keep current syntax |
Full | Replace function |
ASE supports an optional user_id
argument to the INDEX_COL
function; however, SQL Server/Azure SQL does not support this argument. If you use the user_id
argument, this function cannot be converted to SQL Server/Azure SQL syntax.
user_id
argument, SSMA will display an error.INDEX_COL
is encountered, select Mark with error. SSMA will not convert references to the function, and will mark the statement with error comments.Mode | Value |
---|---|
Default | Mark with error |
Optimistic | Mark with error |
Full | Mark with error |
SQL Server/Azure SQL does not have an INDEX_COLORDER
system function.
INDEX_COLORDER
function is substituted with a call to a user defined function with same name INDEX_COLORDER
(created in the user database under the schema name s2ss
) which emulates the SAP ASE behavior.INDEX_COLORDER
is encountered, select Mark with error. SSMA will not convert references to the function, and will mark the statement with error comments.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Mark with error |
Optimistic | Mark with error |
Full | Mark with error |
LEFT
and RIGHT
functions in ASE behave differently for negative length parameter.
CASE
expression which would return NULL
for negative value.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Keep current syntax |
Optimistic | Keep current syntax |
Full | Replace function |
Nota
If the length parameter is a literal value and not a complex expression, the length value is always replaced with NULL
irrespective of project setting.
SQL Server/Azure SQL does not have an NEXT_IDENTITY
system function.
NEXT_IDENTITY
function is substituted with expression (IDENT_CURRENT(parameter Value) + IDENT_INCR(parameter Value)
which emulates the SAP ASE behavior.NEXT_IDENTITY
is encountered, select Mark with error. SSMA will not convert references to the function, and will mark the statement with error comments.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Mark with error |
Optimistic | Mark with error |
Full | Mark with error |
Default/Optimistic/Full Mode: Mark with error
Specifies whether to convert PATINDEX
function to match SAP ASE behavior. The point is that ASE trims trailing blanks in a search pattern. The workaround is to make a cast of value expression to a fixed length data type with a maximum precision and apply rtrim
function to search pattern.
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Do not use |
Optimistic | Do not use |
Full | Use |
The REPLICATE
function repeats a string the specified number of times. In ASE, if you specify to repeat the string zero times, the result is NULL
. In SQL Server/Azure SQL, the result is an empty string.
REPLICATE
function is substituted with a call to either REPLICATE_VARCHAR
or REPLICATE_NVARCHAR
user defined function based on the type of parameters passed (created in the user database under the schema name s2ss
) to emulate the SAP ASE behavior.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Replace function |
Optimistic | Replace function |
Full | Replace function |
This setting specifies whether to replace calls to TRIM
, LTRIM
and RTRIM
functions with the SAP ASE-equivalent syntax functions or to keep the current syntax. The following options are present for this particular setting:
When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Replace function |
Optimistic | Replace function |
Full | Replace function |
In ASE, the function SUBSTRING(expression, start, length)
returns NULL
if a start value greater than the number of characters in expression is specified, or if length equals zero. In SQL Server/Azure SQL, the equivalent expression returns an empty string.
SUBSTRING
function is substituted with a call to SUBSTRING_VARCHAR
or SUBSTRING_NVARCHAR
or SUBSTRING_VARBINARY
user defined function based on the type of parameters passed (created in the user database under the schema name s2ss
) to emulate the SAP ASE behavior.When you select a conversion mode in the Mode box, SSMA applies the following setting:
Mode | Value |
---|---|
Default | Keep current syntax |
Optimistic | Keep current syntax |
Full | Replace function |
Creates a new primary key in the SQL Server or Azure SQL table if an SAP ASE table has no primary key or unique index.
Mode | Value |
---|---|
Default | No |
Optimistic | No |
Full | Yes |
Nota
When connected to Azure SQL, it is Yes by default.
Peristiwa
31 Mac, 11 PTG - 2 Apr, 11 PTG
Acara pembelajaran SQL, Fabric dan Power BI terbesar. 31 Mac - 2 April. Gunakan kod FABINSIDER untuk menjimatkan $400.
Daftar hari iniLatihan
Laluan pembelajaran
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization