text: USE `cosinee`;
  -- -----------------
  -- prepare variables
  -- -----------------
  
  SET @dbname = DATABASE ( );
  SET @tablename = "uk_leavemsg";
  SET @columnname = "snsid";
  
  SET @preparedStatement = (
  	SELECT
  	IF
  		(
  			(
  			SELECT
  				COUNT( * ) 
  			FROM
  				INFORMATION_SCHEMA.COLUMNS 
  			WHERE
  				( table_name = @tablename ) 
  				AND ( table_schema = @dbname ) 
  				AND ( column_name = @columnname ) 
  			) > 0,
  			"SELECT 1",
  			CONCAT( "ALTER TABLE ", @tablename, " ADD ", @columnname, " varchar(32) DEFAULT NULL COMMENT '渠道snsid';" ) 
  	)
  );
  PREPARE alterIfNotExists 
  FROM
  	@preparedStatement;
  EXECUTE alterIfNotExists;
  DEALLOCATE PREPARE alterIfNotExists;