Save dynamic query output in a variable in sql server

In this article we are going to learn save dynamic query output in a variable. For that first i need to create a table. So you can find script of creating table. Table Name : InvoiceLocations CREATE TABLE [dbo].[InvoiceLocations]( [Id]… Continue Reading →

How can i list foreign key in sql server

In this article we are trying to find how many ways that we can find foreign key sql server. There are so many ways to find out but currently i am going to talking about only 3 ways. I am… Continue Reading →

While loop in sql server

declare @i int=10 while(@i<=20) begin print @i set @i=@i+1 end I hope this code is helpful. Happy coding 🙂

Count word in sql server

In this blog i am going to write a function which returns word count in sql server. Sql server does not provide inbuilt function for calculating word count. So we have to write a custom function in sql. CREATE FUNCTION… Continue Reading →

Function, function in sql

System defined functions are provided by SQL itself.
User defined function are two type. First is Scalar and second is Table value.

What is output when we write null = null in where clause

What is output when we write null = null in where clause

Cannot connect to local database in SQL Server

In this article we learn how to resolve the problem while connecting local sql database. Problem: Yesterday, When i was trying to connect my local SQL server database. I found an error called “Cannot connect to PRAMODTHAKUR”.   Solution:  … Continue Reading →

How to find column name within all tables in sql server

Problem I was trying write a procedure with some logic and in that scenario have to find out that how many table contain column-name like “sales” in my database. In my view there is two solution for this may be… Continue Reading →

Toggle in sql server

update NewTable set status= case status when 1 then 0 when 0 then 1 end

Delete duplicate row in sql

In this article we learn that how to delete duplicate row in sql. Let’s create a table and name it NewTable. Create table NewTable ( Name varchar(30), Age int ) Now i am going to insert some demo record in… Continue Reading →