Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    1

    Unanswered: Problem with Stored Procedure in SQL Server 2000

    Hi everyone,

    I am new to the forum and I have a problem with a stored procedure in SQL Server 2000. I use a stored procedure that returns a string but the problem is that my variable is empty at least I think it's empty.

    With the code below the variable is not empty:
    set @Ssql = 'select Cust_Company_id, fix_price from GEC_FixPrice where priority > 0 and cust_company_id like ' + char(39) + @InvoiceLine_CustCompanyid + char(39) + ''

    But when I use the code below it's empty

    - set @sSql = 'select Cust_Company_id, fix_price from GEC_FixPrice where priority > 0 '
    - set @sSql = @sSql + ' and cust_company_id like ' + char(39) + @InvoiceLine_CustCompanyid + char(39) + ''


    I also tried this :

    - set @Start = 'select Cust_Company_id, fix_price from GEC_FixPrice where priority > 0 '
    - set @End = ' and cust_company_id like ' + char(39) + @InvoiceLine_CustCompanyid + char(39) + ''
    - set @sSql = @Start + @End

    This works also, so I don't get why the second example won't work and the second example is the one I want to use.

    So does anyone has a clue

    thx in advance,

    grtz

    Loki2600

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Posted in wrong forum.

  3. #3
    Join Date
    May 2004
    Location
    Moscow, Russia
    Posts
    29
    set @sSql = @Start + isnull(@End, '')

Posting Permissions

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