Non-performing SQL Query...

  • I am trying to execute a sql query (using a stored procedure) to retrieve lookup table data from SQL Server 2008 R2 (using an .asp page) and populate a drop down list. The procedure executes the following SQL statement (it's pretty simple):

    SELECT Id, Name from

    However, for some reason, it only returns one record and places the number 14 in the Name column.

    Has anyone run into this before?

  • pjlewis (3/29/2011)


    I am trying to execute a sql query (using a stored procedure) to retrieve lookup table data from SQL Server 2008 R2 (using an .asp page) and populate a drop down list. The procedure executes the following SQL statement (it's pretty simple):

    SELECT Id, Name from

    However, for some reason, it only returns one record and places the number 14 in the Name column.

    Has anyone run into this before?

    :hehe:

    SELECT [ID], [NAME] FROM

    You're using a bunch of reserved words, bracket them properly and my guess is this will go away.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • Have you run the stored procedure in SSMS to see what it returns?

    My guess is that is returns the right results, but that the binding in the .NET code is not done correctly. Without seeing the .NET code I can't say for sure though.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply