SQL SERVER – Search Text Field – CHARINDEX vs PATINDEX

We can use either CHARINDEX or PATINDEX to search in TEXT field in SQL SERVER. The CHARINDEX and PATINDEX functions return the starting position of a pattern you specify. Both functions take two arguments. With PATINDEX, you must include percent signs before and after the pattern, unless you are looking…
Read More

SQL SERVER – Fix: Sqllib error: OLEDB Error encountered calling IDBInitialize::Initialize. hr = 0x80004005. SQLSTATE: 08001, Native Error: 17

Error received: Sqllib error: OLEDB Error encountered calling IDBInitialize::Initialize. hr = 0x80004005. SQLSTATE: 08001, Native Error: 17 Error state: 1, Severity: 16 Source: Microsoft OLE DB Provider for SQL Server Error message: [DBNETLIB]SQL Server does not exist or access denied The simple fix: Microsoft SQL Server 2005 >> Configuration Tools…
Read More

SQL SERVER – What is New in SQL Server Agent for Microsoft SQL Server 2005

I came across this interesting and detailed article ‘What’s New in SQL Server Agent for Microsoft SQL Server 2005‘ on Microsoft TechNet. This article describes Security Improvements, New Roles in the msdb Database, Multiple Proxy Accounts, Performance Improvements, Performance Counters, New SQL Server Agent Subsystems, Shared Schedules, WMI Event Alerts,…
Read More

SQL SERVER – Restore Database Backup using SQL Script (T-SQL)

In this blog post we are going to learn how to restore database backup using T-SQL script. We have already database which we will use to take a backup first and right after that we will use it to restore to the server. Taking backup is an easy thing, but I have seen many times when a user tries to restore the database, it throws an error.

Read More

SQL SERVER – Query Analyzer Shortcuts

Download Query Analyzer Shortcuts (PDF) Shortcut Function Shortcut Function ALT+BREAK Cancel a query CTRL+SHIFT+F2 Clear all bookmarks ALT+F1 Database object information CTRL+SHIFT+INSERT Insert a template ALT+F4 Exit CTRL+SHIFT+L Make selection lowercase CTRL+A Select all CTRL+SHIFT+M Replace template parameters CTRL+B Move the splitter CTRL+SHIFT+P Open CTRL+C Copy CTRL+SHIFT+R Remove comment CTRL+D…
Read More