Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Another way to get a table list from a string

By Bernabe Diaz,

the default delimiter is comma and the default list type is sysname.

You can pass whatever delimiter you want and ask for any datatype list.

Here is a sample of its use:

EXEC Usp_GetTableList @strDataSet='01/24/1965,1900-01-01 23:15:00.000,03/21/2009,1965,03/02/1975'

,@Rt='DATETIME'

EXEC Usp_GetTableList @strDataSet='$45,50.639,60.1965,123456.9'

,@Rt='MONEY'

--,@delimiter ='.'

EXEC Usp_GetTableList @strDataSet='45,50.639,60.19651234569'

,@Rt='NUMERIC(10,6)'

Enjoy it !

Total article views: 1442 | Views in the last 30 days: 1
 
Related Articles
FORUM

Comma Delimited Conversion

Comma Delimited data

FORUM

comma delimited name column

comma delimited name column

SCRIPT

Get String between two delimiters

Get string between two delimiters

SCRIPT

Delimited String Parser

Parses delimited string into a table of up to 9 varchar fields.

Tags
t-sql    
xml    
 
Contribute