Skip to content
Advertisement

add sql WHERE statement to select new ID:s in database (asp / sql)

I’m trying to update a website where there’s new ID’s for different damage groups. All the new ID’s start after ID 139. In SQL the statement to get the new groups are simply:

However, I want to implement the same statement in my ASP code and in the method that fetches the current damage groups. Here’s the current method for it:

Basically: I want to update this method and add some a statement similar to the SQL statement, so that i["ID"] only will fetch ID’s after number 139.

Any ideas on how to do this directly in this method?

I’ve tried adding a new sql similar to:

But, I am unsure where to use the query later in the method.

Advertisement

Answer

The solution was to change to stored procedure

in the database and alter the procedure to only show ID where ID >= 139 , this is much simpler than to change the whole method

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement