Rajanand Ilangovan

@rajanand

145 Points 1 Followers

57 Posts

0 Answers

Business Intelligence Developer.

Rajanand Ilangovan · 1 week ago

SQL Server Performance tuning and troubleshooting checklist

I have recently come across a wonderful Video on SQL Server performance tuning and troubleshooting checklist by Kevin Kline. and created the notes below for my reference. Troubleshooting Che...
2

Rajanand Ilangovan · 1 week ago

Dashboard Inspirations

1. Geckoboard Executive CEO dashboard CMO dashboard CFO dashboard Management dashboard SaaS company dashboard Company dashboard Startup dashboard Pirate metrics (AARRR) dashb...

Rajanand Ilangovan · 2 months ago

How to search for a table or column in all the databases in a server

To search for a table across databases in a server EXEC sp_MSforeachdb <span class="hljs-string">'SELECT "?" AS DB, * FROM [?].sys.tables WHERE name like '...

Rajanand Ilangovan · 3 months ago

How to fix the error of dynamically generated T-SQL query when the syntax is correct?

Problem: I was generating a query using dynamic SQL and copied the result from grid and pasted into a query window and executed the same. This resulted in error. This is the error I got when...

Rajanand Ilangovan · 3 months ago

How to fix SQL Server SQL authentication login issue when the user name and password is correct?

Problem: I have logged in to the SQL Server using winodws authentication and created a new login with SQL authentication. Then tried login with the new login and got the error as login faile...

Rajanand Ilangovan · 3 months ago

How to fix Log reader agent login failure in SQL Server replication?

Error: Log reader agent has failed with an error Login failed for user 'sql-user-account'. Solution: Right click on the publication name and open properties window. Go to Agent Security p...

Rajanand Ilangovan · 3 months ago

How to fix "This database is not enabled for publication" issue when the replication option is already enabled in SQL Server?

Error Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addpublication, Line 188 This database is not enabled for publication. I have used the below script to enable the database for repli...

Rajanand Ilangovan · 3 months ago

How to fix SQL Server Integration Services could not be started issue?

Error: The request failed or the service didn't respond in a timely fashion consult the event log or other applicable error logs for details. Solution: Go to Administrative Tools and cl...

Rajanand Ilangovan · 4 months ago

List of indexes on a table with column details in SQL Server

List out all the indexes defined on a table and column details. USE test_db; GO SELECT OBJECT_NAME(i.object_id) AS table_name ,i.type_desc AS index_type ,i.<span class="h...

Rajanand Ilangovan · 4 months ago

How to get the TCP / IP Settings of a SQL Server?

This query gets tcp/ip settings of the SQL Server from registry. <span class="hljs-keyword">SELECT</span> registry_key, value_name, value_data <span class="h...

Rajanand Ilangovan · 4 months ago

How to find a SQL Server agent jobs last executed and next scheduled date time?

You can execute the below query to get the list of SQL Server agents jobs and when it was last executed and time it took to complete the job and when it is scheduled to run next. <span cl...

Rajanand Ilangovan · 4 months ago

How to rename a database without an error in SQL Server?

Problem Unable to rename the database in SQL Server. Msg 5030, Level 16, State 2, Line 17 The database could not be exclusively locked to perform the operation. Solution This error occur...

Rajanand Ilangovan · 4 months ago

How to split a string into a list of values in SQL?

I have created a function to split a string based on the delimiter value and return the result as a single column of values in a table. <span class="hljs-keyword">CREATE</...

Rajanand Ilangovan · 4 months ago

How to fix "Can not find path" error in PowerShell?

Problem: When executing a SQL script file, I have got the below error in PowerShell. I was using PowerShell v5 in Windows 10. Short Error message: Get-ChildItem : Can not find path 'file pa...

Rajanand Ilangovan · 5 months ago

How to check database restore history and backup file used for restore in SQL Server?

SELECT rs.destination_database_name, rs.restore_date, bs.backup_start_date, bs.backup_finish_date, bs.database_name <span class="hljs-keyword">a...

Rajanand Ilangovan · 5 months ago

How to generate numbers table in SQL?

Generate Number table with cross join and row_number function <span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">TABLE</span>...

Rajanand Ilangovan · 5 months ago

How to find customers who never placed an order in SQL?

Write a SQL query to find the list of customers who never placed an order. There are two tables. customers orders Sample data: <span class="hljs-keyword">USE</span>...

Rajanand Ilangovan · 5 months ago

How to split a string into a list of values

I have created a function to split a string based on the delimiter value and return the result as a single column of values in a table. <span class="hljs-keyword">CREATE</...

Rajanand Ilangovan · 5 months ago

How to search for a list of words contains in a string column?

To search whether the list of words contains in a column, you can implement it using a series of conditions with LIKE and OR operators. But to search for additional word, you need to add ano...

Rajanand Ilangovan · 6 months ago

How to undo the last git commit in local repository?

Undo last local commit but keep files changes. git <span class="hljs-keyword">reset</span> <span class="hljs-keyword">HEAD</span>~<span class=&...

Rajanand Ilangovan · 6 months ago

SQL Replication - Post Tracer Token error due to no active subscriptions

I was trying to get all the SQL Server replication's publication that has subscriptions. Then for each publication, post a tracer token thru cursor. I encountered the below error. Error: Ms...

Rajanand Ilangovan · 6 months ago

How to replace the first instance of the string in T-SQL?

You can use the combination of stuff, charindex and len function to replace the first occurrence of the string. <span class="hljs-keyword">declare</span> @database_nam...

Rajanand Ilangovan · 7 months ago

Table Variable in SQL Server

Table variable syntax:``` declare @my_table_variable table( id int, name varchar(50) ); select * from @my_table_variable; go 2. Table variable is a local variable with a special data type...

Rajanand Ilangovan · 7 months ago

How to enable SQL Server database for publication

Problem: I have configured the distributor and then trying to create a publication on the publication server using sp_addpublication stored procedures with respective parameters. I have got...

Rajanand Ilangovan · 8 months ago

What is the difference between stored procedure and function in SQL?

Stored procedure can call a function. But function can not call a stored procedure. Stored procedure can use temporary tables and table variables. Function can use table variable but not te...

Rajanand Ilangovan · 8 months ago

How to concatenate multiple rows into a single string in SQL?

Write a SQL query to concatenate multiple rows into a single string? <span class="hljs-keyword">USE</span> TestDB; GO <span class="hljs-keyword">DRO...

Rajanand Ilangovan · 8 months ago

How to get nth highest salary in SQL Server?

You have an employee table with employee details. You need to get 3rd highest salary get the employee details with 3rd highest salary. Here is the sample data from employees table. You ca...

Rajanand Ilangovan · 8 months ago

How to find out frequent credit card spender in SQL?

You have joined a bank as their data analyst and you have received the below requirement and need to provide an ad-hoc report to the management. There is an ETL job which loads the data into...

Rajanand Ilangovan · 8 months ago

How to de-group the data in SQL?

Write a SQL query to de-group the data and provide the output as below. Let us first create the test data to demo <span class="hljs-keyword">USE</span> TestDB; GO &...

Rajanand Ilangovan · 8 months ago

How to find which command has failed in SQL Server Replication?

To find out the list of replicated transaction, query the MSrepl_transactions table in distribution database. Copy the sequence number of the transaction (i.e., xact_seqno ) which entered th...

Loading More Content