Using SQL-DMO Multistrings
SQL-DMO multistrings are used in numerous parameters in SQL-DMO properties and methods. Using multistrings, a user can supply one or more delimited strings to the parameter, and SQL-DMO parses the input into multiple strings.
Database objects in instances of Microsoft® SQL Server™ version 6.5 and earlier could not contain special characters such as spaces, commas, and semicolons. Therefore, these characters could be used interchangeably as string delimiter characters. For example, this multistring contains four separate strings:
However, database objects in instances of SQL Server 2000 and SQL Server version 7.0 can contain any valid Microsoft Windows NT® or Microsoft Windows® 2000 characters, including spaces, commas, and semicolons. To accommodate this change, SQL-DMO multistring format uses left and right brackets () as delimiters. The use of spaces, commas, and semicolons between bracketed strings is optional. For example these two multistrings, which contain four strings, are identical:
[S1] [S2] [S3] [S4] [S1] [S2],[S3];[S4]
A right bracket is used as the escape character for a string that contains a right bracket. For example, the string "My]object" should be specified as:
No escape character is required for a left bracket because SQL-DMO parses multistrings from left to right.
To maintain backward compatibility, the original multistring format is still supported if the string does not contain any spaces, commas, semicolons, or brackets. If an application uses the newer multistring format for one string, then the same format must be used for all strings in the multistring parameter.
SQL-DMO multistrings are used by these properties and methods: