⌘BABAKOV.NET Let's code!
100% [light] [ru]
~/databases/mssql $

MSSQL

38 total · page 3 / 4

Deleting Temporary Tables in MSSQL

Sometimes there is a need to delete a temporarily created table during a procedure, which may or may not exist. Simply writing, for example, drop table #myTempTable is not enough, because if the table does not exist, the query will not execute and will return an error. The example below shows how to correctly delete temporary tables in such cases:

37 views 0 comments 0 likes ./Read →

Курсоры в MSSQL - перебор выборки в цикле.

Команды манипулирования данными SELECT , UPDATE , DELETE работают сразу с группами строк. Эти группы, вплоть до отдельных строк, можно выбрать с помощью опции WHERE. А если надо перебрать строки некоторой таблицы последовательно, одну за др…

525 views 0 comments 0 likes ./Read →

Way to set date in MSSQL to be independent of server regional settings.

Here is an example of how you can make a script in MSSQL work correctly with dates regardless of regional settings and date format. I personally implemented it in the following way: In the script, write the date as follows: Where data is a string of the following type: - This is the format of the date indicated by the number 120. Therefore, the server will not confuse the month with the day, etc.

24 views 0 comments 0 likes ./Read →