how do i dyamically create a temporary table with a stored procedure?
i have a datasource on a page which returns all rows from 'type'. columns are url, b1,b2,b3
after this has been returned, i want a stored procedure to make a table with a row for each of the rows returned from sqldatasource1, where b1d,b2d,b3d = b1 -(subtraction) value of 'b1' querystring, b2 -(subtract) value of 'b2' querystring, b3 -(subtract) value of 'b3' querystring, all results to be shown as positive, even though results may sometimes be negative numbers.
then i want another column on this table to be called 'dif' and it is the total each row, (b1d,b2d and b3d)
then i want the row with the lowest 'dif' (random of the lowest if there are multiple with the same lowest dif) be selected (not from this table, but the row it was calculated from/refering from on the 'type' table).
is this possible? can someone help me with this? i have never creted a stored procedure before.. thanks so much if you can help