• sandro977 (4/11/2011)


    ... because in a Function you can't use a temporal table to reduce the universe, and this is something very important...

    For that you need: DBCC SHRINKUNIVERSE 😛

    sandro977 (4/11/2011)[hrBy other side, I see a deep problem of concurrency. If I have several users calling the store procedure, the last win.

    I mean, if I have 3 users calling the store procedure to select customers, and this customers should be in the resulting table.

    If first need customers with customer name like '%jho%'

    the second user need customers with customer name like '%Mik%'

    the third user need customers with customer name like '%Mij%'

    and three users ask at same time the resulset, the 3 users will get the same results in the table, the data matching with last user where.

    Is there some way to avoid it?

    Temporary tables (not temporal) are unique to each session. The problem you describe is what would happen if you used Global Temporary Tables.

    Steve.