Closed Kvasi closed 3 years ago
I can't actually reproduce this, would you mind providing an example call to sp_generate_merge
?
EXEC sp_generate_merge @schema = 'dbo', @table_name = 'BillLocationCategory', @include_use_db = 0, @nologo = 1, @delete_if_not_matched = 0, @cols_to_exclude = "'InterestFreeDays','PaymentAccountID','MinDaysBeforeInterest','InterestPriceGroupID','InterestFromHoldDueDate','MinInterestAmount'"
Looks like an issue with the SQL, rather than the proc.
Try switching off QUOTED_IDENTIFIER
i.e.:
SET QUOTED_IDENTIFIER OFF
EXEC sp_generate_merge @Schema = 'dbo', @table_name = 'BillLocationCategory', @include_use_db = 0, @nologo = 1, @delete_if_not_matched = 0, @cols_to_exclude = "'InterestFreeDays','PaymentAccountID','MinDaysBeforeInterest','InterestPriceGroupID','InterestFromHoldDueDate','MinInterestAmount'"
Or use single-quotes instead of double-quotes, and escape the string accordingly
Awesome, that worked.
If I use more than 128 chars in @cols_to_exclude I get: The identifier that starts with ''InterestFreeDays','PaymentAccountID','MinDaysBeforeInterest','InterestPriceGroupID','InterestFromHoldDueDate','MinInterestAmoun' is too long. Maximum length is 128.