SET statement Issue: Multiple variable assignments in SET statements In MySQL a SET statement can contain multiple variable assignments, separated by commas. A SQL Server SET statement can contain only one assignment to a variable. Example: create procedure proc_set_var () begin declare a, b int; set a=10, b=20; select a+b; end call proc_set_var () -- 30 Solution: Convert each variable assignment to a separate SET statement. SQL Server Example: create procedure proc_set_var as declare @a int, @b int set @a=10 set @b=20 select @a+@b end exec proc_set_var -- 30 Issue: Server system variables (global variables) The server maintains many system variables that indicate how it is configured. Each system variable has a default value. System variables can be set at server startup by using options on the command line or in an option file. Most of them can be changed dynamically while the server is running by means of the SET statement, which enables you to modify the operation of the server without having to stop and restart it. You can refer to system variable values in expressions.
SET statement Issue: Multiple variable assignments in SET statements In MySQL a SET statement can contain multiple variable assignments, separated by commas. A SQL Server SET statement can contain only one assignment to a variable. Example: create procedure proc_set_var () begin declare a, b int; set a=10, b=20; select a+b; end call proc_set_var () -- 30 Solution: Convert each variable assignment to a separate SET statement. SQL Server Example: create procedure proc_set_var as declare @a int, @b int set @a=10 set @b=20 select @a+@b end exec proc_set_var -- 30 Issue: Server system variables (global variables) The server maintains many system variables that indicate how it is configured. Each system variable has a default value. System variables can be set at server startup by using options on the command line or in an option file. Most of them can be changed dynamically while the server is running by means of the SET statement, which enables you to modify the operation of the server without having to stop and restart it. You can refer to system variable values in expressions.
MigrateMySQLtoSQLServer.docx