• andrexcobar (3/14/2014)


    Sean Lange (3/14/2014)


    Well you first example was using a parameter. Not sure what you mean by an array of strings. How do you get this into sql?

    You seem to be jumping back and forth between string literals and parameters. Honestly your query doesn't make any sense because you have IN with no parenthesis. Are you passing the whole string including the parenthesis? How are you running this? This really isn't that hard but you aren't providing much detail for me to work with here.

    The query is placed in Business Objects. The parameter is also from Business Objects. It's a Multi value parameter that includes parenthesis.

    So the @parameter is equal to: ('Value1', 'Value2', 'Value3') --parenthesis included.

    So when you use that parameter in a IN statement, it works perfectly. But it seems that it only works exclusively with the IN statement.

    Maybe a better example will be the following:

    SELECT ('Value1', 'Value2') --This will get an error.

    How can you work that query in order to get the following result:

    Code

    -----------------

    'Value1', 'Value2'

    (1 row(s) affected)

    SAP BusinessObjects?

    I have no experience at all with that but maybe you can do something like this?

    select replace(replace(@parameter, '(', ''), ')', '')

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/