sql server 2008 - stored procedure and split function.....how to -


i have stored procedure saves rs report parameters table, user runs report selection , saved retrieval @ later date. worked great until had switch multi-selection parameters.

this because stores parameter -

value, value, value

. when comes retrieval see string in table. need split parameters when saving them table. i've got hold of function struggling implement stored procedure.

its basic stored proc inserts savename, para1, para2. hope i've not been vague!

you can split multiple values this, #table stores values required

    create table #table (value varchar(max))     declare @values varchar(max) = (select stringstoredvalue tablename)     set @values = 'insert #table select ' + replace(@values, ',',' union select ')     exec(@values)     --here can join #table , find values required     select * #table      drop table #table 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -