T
Tommy Malone
I'm using MSSQL and VB.
I want to pull an item from an "Inventory" table and assign it a
"TransactionID", then insert it into (or insert with a default value in the
TransactionID column) a "Transactions" table.
It would be easier to have the TransactionID before the item is written to
the "Transactions" table, but I'll take any help I can get.
My questions are:
1. How do I create a number formatted as 10 digits (say starting 0000000001)
and incrementing with each transaction to be inserted into "TransactionID"
and written to the "Transactions" table?
2. How do I ensure that "TransactionID" is unique across the "Transactions"
table, regardless of the inventory item? In other words, there can never be
two (0000000001)'s.
Thanks for your help. Sorry for such a poorly framed question.
I want to pull an item from an "Inventory" table and assign it a
"TransactionID", then insert it into (or insert with a default value in the
TransactionID column) a "Transactions" table.
It would be easier to have the TransactionID before the item is written to
the "Transactions" table, but I'll take any help I can get.
My questions are:
1. How do I create a number formatted as 10 digits (say starting 0000000001)
and incrementing with each transaction to be inserted into "TransactionID"
and written to the "Transactions" table?
2. How do I ensure that "TransactionID" is unique across the "Transactions"
table, regardless of the inventory item? In other words, there can never be
two (0000000001)'s.
Thanks for your help. Sorry for such a poorly framed question.