MS SQL question

P

patryk78

hello , i have a table ARTICLES where are columns ID_ARTICLE and NAME, there
is also a CONTRACTOR table with ID_CONTRACTOR and many tables with prices
( group price, individual price, article price) and i found a function that
return resultset : netto_price and brutto_price, discount of article for one
contractor, function
getprice(id_article, id_contractor)
how to get prices for all articles (get all rows and put to function) for
one contractor lets say id_contractor is const = 1 using this function

there is somethin like dominant price which mean that ndividual price is
first, group price is second, and article price is last and there are
discounts too. i dont know how to write so huge slq select to get the right
price.......but the right price is returned by function getprice
i must get dominant price because that will be a order form system for
contractor based on database from sales program

maybe there is a solution using dataset or datareader ???????

i cant modify structure of that database beacuse its not mine

Pat
 
G

Guest

It would be best to study a bit of SQL, or get someone to help that knows
SQL, rather than solving this issue in ASP.NET. You can certainly loop
through the data (DataReader, DataTable) and create a bindable DataTable with
the "proper" price, but SQL will be much better performing, especially if
there is already a function to return the correct price. Add the function to
the SQL query is a better option, IMO, to writiing complex logic in your
application.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top