Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 28th, 2005, 06:07 AM
h-kay h-kay is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 34 h-kay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 58 sec
Reputation Power: 5
Unhappy Timing Issues with Stored Procedures


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?

Reply With Quote
  #2  
Old July 28th, 2005, 03:45 PM
kcconnor's Avatar
kcconnor kcconnor is offline
Evil Republican...
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Location: Probably running over your cat right now...
Posts: 250 kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level)kcconnor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 21 h 35 m 23 sec
Reputation Power: 37
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.

Reply With Quote
  #3  
Old August 15th, 2005, 03:51 AM
h-kay h-kay is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 34 h-kay User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 58 sec
Reputation Power: 5
Red face stored procedure

Thanx for the advice

sorry for not responding sooner-been working on other projects

will give this a try

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Timing Issues with Stored Procedures


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT