Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009
    Posts
    168

    Unanswered: stored procedure problem

    hi,

    I want to set a variable to an sql statement like this in a stored procedure:

    set @residentialID = select dataTypeID from Datatype where name like 'residential'

    it does not work in Visual Web Developer 2008 but was working fine in 2005. How can i set this variable please? thanks

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote the string?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jul 2009
    Posts
    168
    incorrect syntax near the keyword 'select' when saving the stored procedure.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Even when youi quote it?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Jul 2009
    Posts
    168
    the syntax is different on VWD 2008 i think, i used this syntax and it worked:

    set @residentialID = (select dataTypeID from Datatype where name like 'residential')

    so annoying when syntax changes from one version to another. can be quite frustrating sometimes. There need to be some other ways of dealing with it i suppose.
    Last edited by kpeeroo; 11-15-09 at 10:27.

Posting Permissions

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