April 11, 2012 at 6:12 am
in a table i have a field called po no.i want to update the table when user places a order....every time he place order there is different po no.so plz help me to write the querry for this...
thanks in advance......
April 11, 2012 at 6:24 am
You can help those who wish to help you by posting the table definition, sample input data and desired results. To do this quickly and easily please click on the first link in my signature block to learn how to do this. The link contains sample T-SQL statements to allow you to do this quickly and easily.
April 11, 2012 at 8:23 am
This article explains why we need the ddl and sample data.
http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
In short, you have not provided the entire question.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
April 12, 2012 at 1:17 am
Please post your DDL and sample data.
Without that, from what I understand, you should create the po no field as an identity. So, every time a new order is placed ie: new order data is inserted, a new/distinct id will be generated for the new order.
Hope this helps.
Vinu Vijayan
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply