hi liste -

ich m�chte eine stored procedure schreiben, die werte aus einer anderen
tabelle ausliest und �bernimmt...
nur habe ich keine ahnung, wie ich das anstellen soll..

bsp:

tabelle zimmer:

id    preis  zimmerart
1    50        einzel
2    65        doppel
3    90       doppelDeluxe


neuer eintrag in tabelle "Kontingent" durch eine stored procedure:

id    datum    preis_Einzel    preis_Doppel    preis_DoppelDeluxe


eingetragen werden soll von Datum1 bis Datum2. Jeder Tag ist ein Eintrag mit
den Standard-Preiswerten aus Tabelle Zimmer.

oder um es in pseudocode zu verdeutlichen:

CREATE PROCEDURE createKontingent
     @Datum1 datetime, @Datum2 datetime
 AS
    do while (@Datum1 <= @Datum2)
            INSERT INTO kontingent VALUES
(@Datum1,ZimmerTabelle.preis_Einzel,ZimmerTabelle.preis_Doppel ...)
            @Datum1 = @Datum1.Add(1Tag)
    loop
GO

hoffe, das kam verst�ndlich r�ber ...


Thomas Beckert - SitePoint GbR

Vorstadtstr.57
66117 Saarbr�cken

Tel.: 0681 / 9 47 26 27
Fax: 0681 / 9 47 26 28

_______________________________________________
Database.asp mailing list
[EMAIL PROTECTED]
http://www.glengamoi.com/mailman/listinfo/database.asp

Antwort per Email an