|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
hi I have a Form on an asp page that inserts a record into a table on a SQL Server. The database has several stored procedures that are meant to run when a new record is inserted via the form.The stored procedures result in values which are calculated from the fields of the inserted record. For example, a new record will be inserted with the following fields; UFirstName, ULastName, CFirstName, CLastName, Job Title, Company, etc.. The stored procedure sp_UserName calculates UserName based on both of the UFirstName and ULastName fields, the sp_CUserName is based on the CFirstName and CLast Name fields, the sp_CompID calculates Company ID based on the Company Field and so on. I also have sp's based on the date and time of when the record was sent. These procedures do work, but I want them to run as soon as a new record is inserted. Currently they only work after an additional record has been added. So first record inserted, the sp's do not run. I add in another record and the sp's work for the first record, but not for the second. can anyone help? |
|
#2
|
||||
|
||||
|
try using a trigger rather than a stored proc. Check out books online for more info on triggers. You could also use a default. The default could perform some function on user-entered data for the first couple of fields and populate a 3rd field based on some guidelines you give it.
|
|
#3
|
|||
|
|||
|
Thanx for the advice
sorry for not responding sooner-been working on other projects will give this a try ![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Timing Issues with Stored Procedures |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|