Is there an option how to log various SQL Server error messages to SQL Server Error Log and to Windows Error Log? There is one and very simple: we can use system stored procedure sp_altermessage to alter system (message_id < 50 000) messages or user defined messages to be forwarder…
Jednoduché testování výkonu dotazu
Ochrana databáze před smazáním
Extracting data from XML
Getting data from XML is much easier with native support of XML in SQL Server. But it still requires solid knowledge of XML specific things like XPATH or XQUERY. The goal of this article is to collect some useful examples of how to extract values from XML and save time…
Dočasné uložené procedury
IDENTITY column with negative increment
Identity sloupce a práce s nimi
Dnes se podíváme na stručný přehled všech důležitých funkcí, globálních proměnných a DBCC příkazů pro práci s IDENTITY hodnotami v SQL Serveru. Programátoři často chybují, kdy použít kterou z nich, zejména pak z neznalosti toho, jak se jednotlivé funkce chovají v rámci kontextu, ve kterém jsou volány (tělo uložené procedury,…
Why it matters if COLLATE is used in WHERE
Spojení řetězců pomocí FOR XML PATH
Why to avoid functions in WHERE?
It’s well known that we should use functions in the WHERE clause because they can have a negative impact or query execution because of the suboptimal execution plan is generated. I have prepared a really simple example of how to demonstrate this. It also demonstrates one rule that we should…