Click here to Skip to main content
15,904,024 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
S.No  Date    CollectionTime  Branch  Company  Rec-series    Receipt No   Receipt

SQL
1	2016-02-19	11:22:18am	   SP	  CFMS	     SP18	      SP18004315	4315

SQL
2	2016-02-19	11:39:38 am	   SP	  CFMS	     SP18	      SP18004316	4316

C#
3	2016-02-19	11:41:21 am	   SP	  CFMS	     SP18	      SP18004317	4317

C#
4	2016-02-19	12:51:12 pm	   SP     CFMS	     SP18	      SP18004319	4319


What I have tried:

In the table I have been fetching table data from sql through php code and the data in receipt column where receipt=4318 is missing. Am getting the data from server where the data is missing already.. i just need an increment in the missing receipt column alone without affecting any other columns.. is this possible ??? can anyone help me out?? thanks in advance
Posted
Updated 23-Feb-16 5:14am
Comments
ZurdoDev 23-Feb-16 8:07am    
I don't understand. Does Receipt 4318 exist in the db? Probably not, so what is your question?
alia007 25-Feb-16 2:51am    
of course not.. in that case I want to make that row to appear as empty one with 4318 as its value. This is the task scheduled to me. Is this possible??
ZurdoDev 25-Feb-16 7:29am    
You could create a temp table that stores all numbers from 1 to x. Then union against your real data. At some point though it may get too slow. Whatever the reason you want to do this, I suggest looking at alternatives instead.
alia007 25-Feb-16 23:22pm    
Thanks for your answer Ryan

1 solution

This is a repost of your other question. As answered there: You don't ever want to reuse Ids. If you delete a row then that ID is gone and it is very bad practice to use it again. Instead, if you don't really want it deleted, add a field named deleted_time and store the time it is deleted. Then filter those out when retrieving your data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900