46. Extract custom code from the MS SQL database
Click the Extract code button to copy all custom code of procedures and triggers from the MS SQL Server database to files. This step also adds lines to the code containing SET ANSI NULLS OFF
, SET QUOTED IDENTIFIER OFF
and SET NOCOUNT ON
.
Click the Run button to re-insert the UDTs into the code of procedures and triggers in the files. All code will be copied and will end up in the StoredProcs_MSSQL_UDTs_replaced and Triggers_MSSQL_UDTs_replaced folders.
48. Change the calls to the SSMA emulation functions
The SSMA tool creates a 'sysdb' database containing the emulation functions. Three of these functions have already been moved to the Isah database itself. You will therefore have to change the calls to the SSMA emulation functions in such a way that the functions will refer to the database itself. This will prevent any cross-database references.
To do this, replace 's2ss.' by 'dbo.' in the code in the files.
Check the code for the use of other ssma emulation functions as well. If an emulation function is found, create that ssma emulation function in the Isah database as well and modify the call.
49. Delete the ASCII() function or replace it by the UNICODE() function
Manually check the use of ASCII, since the ASCII function for Unicode only supports values up to 127. Where it is used to test for <ESC><ESC>
, it is no longer required. In all other cases, the UNICODE()
function can be used. The <ESC><ESC>
code to be deleted will look like this:
If ascii(@old_CountryCode) = 27
And ascii(substring(@old_CountryCode,2,1)) = 27
Begin
Select @old_CountryCode = ''
End
Char()
function should be replaced by the NChar()
function.Char
type should be replaced by the NChar
type.You can do this by searching for and replacing whole words (replace the whole word 'Char' by the whole word 'NChar'). This operation can be performed automatically. Most editors will not include parentheses in the search for whole words. Replacement of 'Char' by 'NChar' will therefore change both the Char
type and the Char
function.
51. Replace VarChar by NVarChar
The VarChar
type should be replaced by the NVarChar
type. You can do this by searching for and replacing whole words.
52. Change char_length_varchar
Change all calls of the char_length_varchar
function by the char_length_nvarchar
function.
53. Look for incorrect stored procedure calls
It is necessary to modify:
Non-existing parameters must always be deleted from the list. If the same parameter is passed on more than once, the first occurrence must be preserved, as this is the parameter that was used by Sybase.
54. Convert string literals to Unicode
This involves the conversion of strings such as 'abc'
to N'abc'
.
…\<My Documents>\Isah Migrationbox\ <Migrationbox Project>\Output\UnicodeStringReplace_errors.out
.After a refresh, any errors are displayed on the Error tab. The error message contains the name of the file and the line on which the string literal begins.
The output files contain all occurrences of a quote being used within a string, as it could mean that dynamic SQL is generated here. Perhaps some quotes within the string should be preceded by an 'N'. This automatic conversion does not affect the contents of such strings. Example:
SELECT @Statement = N'SET @Description = ''Country'''
This should be the following:
SELECT @Statement = N'SET @Description = N''Country'''
55. Import customizations into the MS SQL database
Note: In the steps above, it is assumed that there were no unclassified objects in MSSQL_Unknown_ObjectType
during the migration. You must check for these objects yourself and replace them where necessary.