SQL - A question to experts ( HTML & store procedure)

 
Vista:

A question to experts ( HTML & store procedure)

Publicado por Roberto (3 intervenciones) el 22/08/2002 17:55:16
Hallo Friends:

Please, I need some guidance to accomplish a task.

I have a single HTML page, with two textboxs: Date and Cost, and this page must activate a SQL Server store procedure to insert data in a table named Statistics.
Any idea about the code , in the page, and in the store procedure, how to pass data , how to report operation status?

Thanks very much. My best regards.

Rob

I
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:A question to experts ( HTML & store procedure)

Publicado por EDELRIO (540 intervenciones) el 22/08/2002 20:32:08
Create Procedure SpSelTest
@date datetime,
@cost money
As
if not exists (Select * From Statistics Where Fecha = @Date)
Begin
Insert Into Statistics Values (@Date, @Cost)
Select Result = 1
End
Else
Begin
Result = 0
End

If your result = 0 Result Exists
If you result = 1 Result Not Exists

The variable Result (0/1) you send to page web....

regards...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar