Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 07, 2012 07:56 AM by mishra.bhupesh
May 07, 2012 06:10 AM|LINK
i need a entry of patients in data base where the entry should be
for one year like the id number should generate by one to till the
entries inserted by end of the year in the data base when the next
year starts the id number should start again from 1 how can i do
this????? , can please help me in these tasks
May 07, 2012 07:36 AM|LINK
Create a table for patients per year. Use the Identity data type to act as your ID.
May 07, 2012 07:42 AM|LINK
i am new can you show me the steps plz
May 07, 2012 07:56 AM|LINK
CREATE TABLE new_employees
id_num int IDENTITY(1,1), --Note: You first 1 for start value second 1 is the Increment for each.
Pname varchar (20),
(Pname, gender, lname)
('Karin', 'F', 'Josephs');
(pname, gender, lname)
('Pirkko', 'O', 'Koskitalo');
//id_num will be for first 1, for second 2 and so on.......
//As much I know after 1 year if you want to reset the values of tables then you can use Trigger.But you have to take backup/remove of your old data from the table otherwise if you choose to make Primary key to that identity field then it can cause problem.