Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can this be done?

Status
Not open for further replies.

nuct

Programmer
Sep 5, 2001
103
Hi,

I am creating a helpdesk system with a web front end and an SQL Server back end, and my current problem is this:

Each request made the the helpdesk can consist of more than one task. First you enter the request, and then it lets you add more tasks on a different page, then finally you go back to the first page and add the request and all its tasks together.

I want to make it so that each request along with all its tasks is added in its entirety or not at all. Obviously I need to use a stored procedure with some explicit transaction statements in it so that things can be rolled back etc, but how on earth do I get all the requests and tasks into the same stored procedure. Can structures be passed into stored procedures, or arrays of structures?

Sorry if im rambling but its late. Any help would be most appreciated.

Cheers,
Simon.
 
you dont necessarily need to use stored procs for this, you can just make a simple transaction history table for rollbacks. all that entails is a replication of the rollback worthy tables, just in structure.. then before update, you copy the existing row to the "backup" table, and leave it there.. if you do a rollback you delete the row used for the rollback. then every so often when you establish a solid state status ( everything in the DB checks, sums etc. ) you can make a backup, and clear the logg/backup table of entries, but yet still have a db wide backup so you stil have transaction histories to fall back on in case of emergencies.

that way you have little stored proceedure hell / admin tools to deal with. and all the logic is simplistic enough for other coders to understand/pickup/fix what's already there.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
That might just work. I could individually write the request and each task to temporary tables, at different times, keeping the request ID in a global variable. Then use this to copy the request and tasks to the live tables all at the same time. Why didn't I think of that.

Cheers,
Simon.
 
That might just work. I could individually write the request and each task to temporary tables, at different times, keeping the request ID in a global variable. Then use this to copy the request and tasks to the live tables all at the same time. Why didn't I think of that.

Cheers for that.

Simon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top