Using SQL-DMO Multistrings
Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.
SQL Distributed Management Objects (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:
S1 S2,S3;S4
However, database objects in instances of SQL Server version 7.0 and later can contain any characters valid in the underlying operating system, 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:
[My]]object]
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: