Click here to Skip to main content
15,894,825 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Server Command Line Compile Pin
PIEBALDconsult29-Mar-12 12:12
mvePIEBALDconsult29-Mar-12 12:12 
GeneralRe: SQL Server Command Line Compile Pin
Kevin Marois29-Mar-12 12:17
professionalKevin Marois29-Mar-12 12:17 
GeneralRe: SQL Server Command Line Compile Pin
PIEBALDconsult29-Mar-12 14:53
mvePIEBALDconsult29-Mar-12 14:53 
AnswerRe: SQL Server Command Line Compile Pin
Bernhard Hiller29-Mar-12 22:36
Bernhard Hiller29-Mar-12 22:36 
GeneralRe: SQL Server Command Line Compile Pin
PIEBALDconsult30-Mar-12 3:08
mvePIEBALDconsult30-Mar-12 3:08 
QuestionHow do you lock records in Access 2007 Pin
Richard.Berry10029-Mar-12 9:34
Richard.Berry10029-Mar-12 9:34 
AnswerRe: How do you lock records in Access 2007 Pin
David Mujica29-Mar-12 9:51
David Mujica29-Mar-12 9:51 
GeneralRe: How do you lock records in Access 2007 Pin
Richard.Berry10029-Mar-12 10:18
Richard.Berry10029-Mar-12 10:18 
Hi David

What you describe above is pretty much exactly the situation, except...

A Sales Order typically has about 20 lines (I display the lines in a datagrid, they fill in the qty despatched for each item, and click confirm despatch. Two users can definitely try to despatch the same item at the same time.

Then it gets worse. After they confirm the despatch...

a) I update the Sales Order Header table - Status changes from Awaiting Despatch to Despatched
b) For each row in the datagrid:
i) See how much stock there is of the item in the stock table(Select query)
ii) Update the Stock Table with new Qty (Update Query)
ii) Write the qty despatched to the Sales Order Detail Table (Update Query)
iii) Write a transaction to a stock History Table (Insert Query)
iv) Write batch information to a Batch table

Both your suggestions may help (i.e. instead of first running a select query to get the stock qty, calculating the new qty in the app, then doing a second query to update the table with the new value, to rather do the calculation in the query)
This is a bit of a problem because of the way I store the stock qty - they have about 1000 stock items, that can exist in any of 10 warehouses. I only keep items that have stock in a warehouse in this table - kind of hard to explain here - perhaps i need to load every stock item in every warehouse in this table.

Second I like the idea of a transaction rollback, but I need to rollback all the other table writes and updates as well? Is this possible.

I can post code, but its long and would be much more than a snippet - can try to shorten it if this would help?
AnswerRe: How do you lock records in Access 2007 Pin
Mycroft Holmes29-Mar-12 13:09
professionalMycroft Holmes29-Mar-12 13:09 
QuestionXML data import to SQL Pin
milenalukic29-Mar-12 6:21
milenalukic29-Mar-12 6:21 
AnswerRe: XML data import to SQL Pin
jschell29-Mar-12 8:08
jschell29-Mar-12 8:08 
AnswerRe: XML data import to SQL Pin
PIEBALDconsult29-Mar-12 12:24
mvePIEBALDconsult29-Mar-12 12:24 
GeneralRe: XML data import to SQL Pin
milenalukic30-Mar-12 11:46
milenalukic30-Mar-12 11:46 
QuestionNew User. Pin
Abhishek kumar12129-Mar-12 4:24
Abhishek kumar12129-Mar-12 4:24 
AnswerRe: New User. Pin
Simon_Whale29-Mar-12 4:46
Simon_Whale29-Mar-12 4:46 
QuestionWhere .. IN ... Pin
eyalle27-Mar-12 20:47
eyalle27-Mar-12 20:47 
AnswerRe: Where .. IN ... Pin
Vipin_Arora27-Mar-12 20:57
Vipin_Arora27-Mar-12 20:57 
AnswerRe: Where .. IN ... Pin
Mycroft Holmes27-Mar-12 23:14
professionalMycroft Holmes27-Mar-12 23:14 
AnswerRe: Where .. IN ... Pin
Blue_Boy27-Mar-12 23:24
Blue_Boy27-Mar-12 23:24 
AnswerRe: Where .. IN ... Pin
Eddy Vluggen28-Mar-12 7:29
professionalEddy Vluggen28-Mar-12 7:29 
QuestionSQL query with multiples values(same column) Pin
OsiKosi27-Mar-12 15:47
professionalOsiKosi27-Mar-12 15:47 
AnswerRe: SQL query with multiples values(same column) Pin
Luc Pattyn27-Mar-12 16:18
sitebuilderLuc Pattyn27-Mar-12 16:18 
AnswerRe: SQL query with multiples values(same column) Pin
OsiKosi27-Mar-12 16:34
professionalOsiKosi27-Mar-12 16:34 
AnswerRe: SQL query with multiples values(same column) Pin
Luc Pattyn27-Mar-12 17:37
sitebuilderLuc Pattyn27-Mar-12 17:37 
GeneralRe: SQL query with multiples values(same column) Pin
Vipin_Arora27-Mar-12 21:06
Vipin_Arora27-Mar-12 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.