| | |
Having Two Auto Numbers..
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2008
Posts: 25
Reputation:
Solved Threads: 0
Hi Fellows,
Well. let me start by higlighting the problem i face.I have two columns namely PID which is the primary key and also a auto number.The second is Serial No. which is also a auto number.
The problem i face is that when i submit my form spcifying a month i want my serial no. to start from one and and end with the number of records in my Datagrid.
IF i come to the same and select a different month the PID should continue from where the last auto no. is but my serial no should start from 1 again..
Is there any option to do like this.Both PID and Serial No. are in the same table.
Thanks
Well. let me start by higlighting the problem i face.I have two columns namely PID which is the primary key and also a auto number.The second is Serial No. which is also a auto number.
The problem i face is that when i submit my form spcifying a month i want my serial no. to start from one and and end with the number of records in my Datagrid.
IF i come to the same and select a different month the PID should continue from where the last auto no. is but my serial no should start from 1 again..
Is there any option to do like this.Both PID and Serial No. are in the same table.
Thanks
•
•
Join Date: May 2008
Posts: 144
Reputation:
Solved Threads: 9
You can set a trigger on Insert Button as check the month for inserting record and previous record. It both are different then reset Serial No. and then insert.
Or
Click of submit button check the month of previous record and reset the Serial No. and the execute the insert command.
Or
Click of submit button check the month of previous record and reset the Serial No. and the execute the insert command.
•
•
Join Date: Jan 2008
Posts: 25
Reputation:
Solved Threads: 0
Fellows,
I have found another option to do this(via Code).Instead of checking the month while submitting, i have found a way to count the number of rows using the dataset property
It is returning me the number of rows in my datagrid.I will write a for loop and form an ary to start from one and increment it till the last row of datagrid...Thanks for the replies..I hope some one will use this...
Thanks and Regards
I have found another option to do this(via Code).Instead of checking the month while submitting, i have found a way to count the number of rows using the dataset property
MS SQL Syntax (Toggle Plain Text)
dsEmployee.TABLES(0).Rows.Count
It is returning me the number of rows in my datagrid.I will write a for loop and form an ary to start from one and increment it till the last row of datagrid...Thanks for the replies..I hope some one will use this...
Thanks and Regards
![]() |
Similar Threads
- Networking with static IP's and auto IP's (Networking Hardware Configuration)
- Putting Auto Numbers in a File (C#)
- Java - Creating a MultiTable from User-Input Numbers (Java)
- Microsoft Access Format/Validation ??? (Windows Software)
- Need HELP IN returning an auto incriment primary key to zero (PHP)
- Giving records in MS Access unique numbers (MS Access and FileMaker Pro)
Other Threads in the MS SQL Forum
- Previous Thread: the difference between Stored procedures temporary tables
- Next Thread: Backup Transaction log and BLOG
| Thread Tools | Search this Thread |
autogrowth connectingtodatabaseinuse count cursor data database datepart dbsize deadlock delete_trigger highperformancecomputing hpc hpcserver2008 ibm iis loop maximum microsoft ms mssql multiple multithreading news number permission query reporting result server services sets source sql sqlserver sqlserver2005 supercomputing tables uniqueid update view





