User Profile

Collapse

Profile Sidebar

Collapse
gen3exo
gen3exo
Last Activity: Nov 25 '08, 08:32 PM
Joined: Nov 18 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • SQL Server passing a list of integers to a stored procedure

    I need to pass a list of integers to a stored procedure. When I place the following into the call to the procedure as @loglist = '123123,345345' and declare the variable in the stored procedure as
    @loglist text,
    then use the expression
    AND E.Escalation_ID IN ('@loglist'),
    I get an "operand type clash text is incompatible with int. If I take the single quotes out as in
    E.Escalation_ID IN (@loglist),...
    See more | Go to post

  • Subqueries can not be used as expressions

    IN SQL SERVER, subqueries can not be used as expressions in a case statement. Normally, the "IN" would expect more than one record to be returned.
    See more | Go to post

    Leave a comment:


  • gen3exo
    started a topic SQL Server - Error when using % in subquery

    SQL Server - Error when using % in subquery

    I have a query which contains

    AND E.escalation_ID IN (CASE WHEN ISNULL(@templat e,0) =0
    THEN (E.Escalation_I D)
    ELSE (SELECT escalation_ID FROM template_info_T B WHERE field_name LIKE '%'+@template+' %')
    END

    This throws the multiple results error

    If the last line is changed to LIKE 'g', the query doesn't throw the error.

    I am using the '%'+@variable+' %' in a regular query...
    See more | Go to post
No activity results to display
Show More
Working...