Let's go invent tomorrow instead of worrying about what happened yesterday|mail@jankowskimichal.pl


SQL unit tests – coverage report

Nowadays, it is quite common to write unit tests for code that we are creating, but not for all programming languages. When we are writing code for www, desktop or mobile application we get used to write unit test for code that is related to application. Together with that we are not testing database code. It is correct when we are using some ORM tools because such tools generate code for us. Situation looks quite different when we are writing SQL code by our own. Then this code should be unit tested similar to other production code. To do that [...]

By |2016-09-09T21:48:17+02:0012 September 2016 |Categories: Testing|Tags: , , , |0 Comments

Tabel index reset in SQL

Today I needed to do a very unusual operation - reset the index in the table in MS SQL. I honestly did not think, that makes it so easy to. To do this, use the command: DBCC CHECKIDENT (nazwa_tabeli, reseed, ostatni_indeks) In the command, give the name of the table, where we want to reset the index and the number of the last index in the table. If you want to automatically generate numbers that began with the 1 it must use this command in the following manner: DBCC CHECKIDENT (nazwa_tabeli, reseed, 0) It should be remembered, that [...]

By |2012-06-15T22:29:46+02:0010 December 2010 |Categories: Uncategorized|Tags: , , |1 Comment
Go to Top