dcsimg
Results 1 to 2 of 2

Thread: Conversion failed when converting the varchar value to smallint

  1. #1

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,545

    Conversion failed when converting the varchar value to smallint

    I thought that would be relatively starightforward but ?I can't figure it our (also too tired).

    Code:
    declare @TicketSeq VARCHAR(MAX)
    set @TicketSeq= '1,2,3,4,5,6,7'
    
    CREATE TABLE #tmphh(valu smallint)
    	INSERT INTO #tmphh (valu)
    	values(@TicketSeq)
    How can i do this?
    Thanks.
    Slow as hell.

  2. #2

    Thread Starter
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,545

    Re: Conversion failed when converting the varchar value to smallint

    I just thought of 2 ways but I'm not sure if it's ideal.
    1)I can loop the @TicketSeq somehow, haven't look in it
    2)There is a "trick" using '' '' that you can fix an IN value to accept @parameters . Again haven't checked as I'm leaving for a couple of days.

    If anything else do share.
    Thanks.
    Slow as hell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width