SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast jamespwalters's Avatar
    Join Date
    May 2001
    Location
    Georgia
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy SQL 2000 Store Procedure

    Hello,

    Help!

    I'm working with a stored procedure in SQL 2000 and I am passing 2 parameters into the function.

    If either of the parameters has a space or / or % or any other character that might separate a word (text) I get an error.

    Examlpe:
    @CompanyTitle = Auto Body Shop"

    Error Message: Line 1: Incorrect syntax near 'Body'.

    Any ideas as to how to fix this problem?
    James P. Walters
    Sr. Developer
    james@jenesistech.com
    http://jamespwalters.com

  2. #2
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to enclose strings in quotes, e.g.
    @CompanyTitle = 'Don''t Forget to escape quotes!'

  3. #3
    SitePoint Enthusiast jamespwalters's Avatar
    Join Date
    May 2001
    Location
    Georgia
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking THANK YOU

    Ha ha! your the man.
    James P. Walters
    Sr. Developer
    james@jenesistech.com
    http://jamespwalters.com


Bookmarks

Posting Permissions

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