Tags » SQL

SQL Month Between Two Dates

Using below query you can get months between two dates. create temporary table @tbl_Date_Range and provide from date and to date to get months between two dates.for example from jan-2016 to dec-2016. 109 more words

SQL

Create Split Function In SQL

Create table valued function as below code

SET QUOTED_IDENTIFIER ON
SET ANSI_NULLS ON
GO
CREATE FUNCTION .
(
    @RowData nvarchar(MAX),
    @SplitOn nvarchar(5)
)  
RETURNS @RtnValue table… 108 more words

SQL

Get Comma Separated Value From SQL Select Statement

By using XML PATH we can get comma separated list from SQL select statement.
For example here i am creating one demo table as below… 124 more words

SQL

SQL: find records that have been revised/updated in the new table

an old table, a new table

three fields in each table: Date, River, BargeRate

want to find records that have the same values for the first two fields, but different on the third field. 41 more words

Find Updates

How and why: Normalize your Data

When we talk about normalizing data within a database we really just mean that we’re organizing our data properly in order to make our database run more efficiently and reduce needless duplication. 530 more words

T-SQL