Roja-Sql Server
Home
ASP.NET
VB.NET
C#
JQuery
SQL
Interview Questions
Find me on Facebook
Find me on Twitter
SQL SERVER Ranking Functions - RANK, DENSE_RANK, NTILE, ROW_NUMBER SQL query to delete duplicate rows SQL Server CTE(Common Table Expression) and Recursive Queries CTE Recursive query for data hierarchy(Parent Child hierarchy) Different methods of SQL queries to insert data in tables SQL query to display all columns with datatypes for a given Table name SQL query to check two tables have identical data SQL query to search a string in database Schema SQL query to display total number of rows for each table in database SQL query to delete duplicate rows
Create a table EmpDtl1 with some duplicate rows as shown below to to understand different methods of delete duplicate rows
create table EmpDup(empid int,name varchar(20))
Continue the Post » » » » » » » » »"
How To Delete a null record
The code below will show you how exactly you delete a row with a NULL value. You can not use =NULL but you have to use IS NULL
CREATE TABLE
#TestDeleteNull (id
INT
identity, SomeDate
DATETIME
)
INSERT
#TestDeleteNull
VALUES
(
GETDATE
())
Continue the Post » » » » » » » » »"
Delete Duplicate rows from the table.
Delete Duplicate rows from the table.
Suppose there is a table called "EmployeeTable" which have some duplicate records.
There is a three way to delete the duplicate rows.First way to delete duplicate rows :
Continue the Post » » » » » » » » »"
How To Copy Data and Structure of One Table To Another New Tables
select * into newtable from originaltable where 1=1
Continue the Post » » » » » » » » »"
Write a SQL Query to find first day of month?
SELECT DATENAME(dw, DATEADD(dd, - DATEPART(dd, GETDATE()) + 1, GETDATE())) AS FirstDay
Continue the Post » » » » » » » » »"
Write a query to convert all the letters in a word to upper case
SELECT UPPER('test')
Write a query to round up the values of a number. For example even if the user enters 7.1 it should be rounded up to 8.
Continue the Post » » » » » » » » »"
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)