Hi Bob,
Thanks for your excellent posting....I'm currently looking into Stored
Procedures and utilising them in my web application.
I've got a further couple of questions if you don't mind!
Firstly, the web application I'm building is for an estate agents. Using
your example, I am trying to update a table with information about a
property. The table has lot's of fields and I've come up with this
stored procedure to update it:
CREATE PROCEDURE bookings_INS
(
@property_id int output,
@user_id int,
@property_address1 varchar(100),
@property_address2 varchar(100),
@property_address3 varchar(100),
@property_town varchar(100),
@property_county varchar(100),
@county_index int,
@property_postcode varchar(8),
@price int,
@property_type varchar(50),
@property_type_index int,
@tenure varchar(50),
@tenure_index int,
@property_description varchar(700),
@number_receptionrooms int,
@number_bedrooms int,
@number_bathrooms int,
@main_image varchar(100),
@entered_date datetime
)
AS
BEGIN
INSERT INTO hk_property (user_id, property_address1, property_address2,
property_address3, property_town, property_county, county_index,
property_postcode, price, property_type, property_type_index, tenure,
tenure_index, property_description, number_receptionrooms,
number_bedrooms, number_bathrooms, main_image, entered_date)
VALUES (@user_id, @property_address1, @property_address2,
@property_address3, @property_town, @property_county, @county_index,
@property_postcode, @price, @property_type, @property_type_index,
@tenure, @tenure_index, @property_description, @number_receptionrooms,
@number_bedrooms, @number_bathrooms, @main_image, @entered_date)
SET @property_id = SCOPE_IDENTITY()
END
Firstly, is this SP updating too many tables or can it cope with all of
these fields?
Secondly, @entered_date is a datetime data type.
Using the objrs.addnew method before, I could set this value using
objrs("entered_date") = Now() but I don't know how to use Now() to get
the current date and time in the @entered_date field in the new sp?
Many thanks again for your help Bob!
*** Sent via Developersdex
http://www.developersdex.com ***