Although this isn&#039t really an ASP question it is pretty advanced. Well at least in my opinion it is. <BR><BR>I am creating an articles page. Where someone will write articles online via a form and put the articles into a database.<BR><BR>Here is simplified database schema for the articles.<BR><BR>Name of Table: ArticleInfo<BR>field Name: articledate - datetime<BR>field Name: articlenumber - auto-incremented field<BR>field Name: articletitle - varchar<BR>field Name: articlemessage - text<BR><BR>I am developing this using SQL Server as a backend. What my question is about creating the auto-increment field.<BR><BR>I want to have two primary keys together that will identify a single row, namely articledate and articlenumber.<BR>ArticleNumber is basically the count of that article for that date.<BR><BR>For example a sample database would look like this:<BR>no articletext and articletitle&#039s displayed here but just the other two columns:<BR><BR>articledate articlenumber<BR><BR>1/1/2000 1<BR>1/1/2000 2<BR>1/2/2000 1<BR>1/3/2000 1<BR>1/4/2000 1<BR>1/4/2000 2<BR>1/4/2000 3<BR><BR>As you can see I want the articlenumber field to start over auto-incrementing with each new unique articledate inserted into the table. I hope you understand what I am trying to do.<BR><BR>How do I create this schema in SQL Server? Using triggers?<BR>I have thought about trying to write a stored procedure with the following code<BR><BR>-check if that date exists already in the record<BR>-then use the identity function which allows you to specify a beginning increment value if the date does not exist<BR><BR>but I would need to lock the table so that concurrent articles wouldn&#039t mess up the articlenumber. what i mean is if no articles existed for that date and I have two seperate authors entering information for that date then it is possible the stored procedure might give both articles the articlenumber of 1 since none existed before and they are simutaenously entering data.<BR><BR>is there a better way to do this? can it be done at all? i hope you understand my database schema and my problem!<BR>