-3

I got an epic problem about my datas that in my tables. I insert some data into a table and I wait 5 or 10 mins and table clears itself. I don't know why. My application doesn't have a code bug, but I think SQL Server has a bug. PLease help...

braX
  • 11,506
  • 5
  • 20
  • 33
Ahmet Tezcan
  • 119
  • 1
  • 1
  • 4
  • 2
    I think if SQL server would have a bug that would clear tables without any visible reason it would have made news already... – JJJ Jul 27 '12 at 12:36
  • 4
    [The First Rule of Programming: It's Always Your Fault](http://www.codinghorror.com/blog/2008/03/the-first-rule-of-programming-its-always-your-fault.html) – Andomar Jul 27 '12 at 12:36
  • 2
    It is more likely that _your application_ has a bug. Did you close connection after inserts? – Nikola Markovinović Jul 27 '12 at 12:36
  • 1
    Use SQL Server profiler and record what is happening with your database right after you have added your rows. – Mikael Eriksson Jul 27 '12 at 12:37
  • i dont insert datas on my application, im inserting as manually. – Ahmet Tezcan Jul 27 '12 at 12:39
  • Can you explain to us what you're doing exactly? Eg. are you inserting, then checking by a SELECT if the insert was succesful, then waiting for 5 minutes (doing absolutely nothing else in your DB) and then checking again by running a SELECT? Tell us more :-) – Josien Jul 27 '12 at 12:43
  • table clean itself while my application is not working, and if its a code bug, i would see that bug before because i use same method and same codes everytime, but i have never seen a bug like this. – Ahmet Tezcan Jul 27 '12 at 12:44
  • Im just inserting datas manually, i select them with my application and i close application. Then i wait 5 or 10 mins and table clean itself – Ahmet Tezcan Jul 27 '12 at 12:45
  • Could it be that you're accidentally creating tables in several spots (master / YourDB) and then querying the wrong one? – Josien Jul 27 '12 at 12:45
  • i use my application for weeks but i have never seen a bug like this. I mean, this cannot be a code bug – Ahmet Tezcan Jul 27 '12 at 12:48

2 Answers2

3

My best guess is that your code creates the database or the table each time it runs, thus seemingly deleting the data inserted.

Code Bunny
  • 447
  • 1
  • 5
  • 23
  • If this is not the case you need to give some code that interacts with the database. – Code Bunny Jul 27 '12 at 12:44
  • 1
    definitely more likely than a bug in SQL Server ..... :-)) – marc_s Jul 27 '12 at 12:50
  • 1
    @marc_s apparently this was the case. I did some thing like this once. I scratched my head for about 15 minutes before looking at the query. no SQL bug that's for sure : ) – Code Bunny Jul 27 '12 at 12:54
2

Make sure you commit your changes. It is my guess that the tool you are using is not committing your changes automatically because of its settings.