sqlparser/sqlserver.cpp
// Handle GO after a statement in SQL Server
Handle GO after a statement in SQL Server
Handle GO after a statement in SQL Server
bool SqlParser::SqlServerGoDelimiter(bool just_remove)
{
	if(Source(SQL_SQL_SERVER, SQL_SYBASE) == false || Target(SQL_SQL_SERVER, SQL_SYBASE) == true)
		return false;
	Token *stmt_end = GetLastToken();
	Token *semi = GetNextCharToken(';', L';');
	Token *go = GetNextWordToken("GO", L"GO", 2);
	if(go == NULL)
	{
		if(semi != NULL)
			PushBack(semi);
		return false;
	}
	if(semi == NULL && just_remove == false)
		AppendNoFormat(stmt_end, ";", L";", 1);
	Token::Change(go, " ", L" ", 1);
	return true;
}
bool SqlParser :: SqlServerGoDelimiter ( bool just_remove ) { if ( Source ( SQL_SQL_SERVER , SQL_SYBASE ) == false || Target ( SQL_SQL_SERVER , SQL_SYBASE ) == true ) return false ; Token * stmt_end = GetLastToken ( ) ; Token * semi = GetNextCharToken ( ' ' , L' ' ) ; Token * go = GetNextWordToken ( " " , L" " , 2 ) ; if ( go == NULL ) { if ( semi != NULL ) PushBack ( semi ) ; return false ; } if ( semi == NULL && just_remove == false ) AppendNoFormat ( stmt_end , " " , L" " , 1 ) ; Token :: Change ( go , " " , L" " , 1 ) ; return true ; }
Handle GO after a statement in SQL Server
Handle GO after a statement in SQL Server
// Optional ; can go before GO // ; is processed at statement parser // The delimiter ; does not already exist, add it otherwise just remove GO