declare @table table
(
[Paid Date] date
)
insert into @table
values('20150102'),('20150512'),('20150830'),('20151231'),('20141230')
;WITH Quarters AS (
SELECT Q = 'Q1', MonthBegin = 1, MonthEnd = 3 UNION
SELECT Q = 'Q2',...
2015-03-19 (first published: 2015-03-11)
7,778 reads
There are many different ways to accomplish this tasks.
Download Link https://gallery.technet.microsoft.com/T-SQL-How-to-Search-String-a1704fc6
The below examples uses undocumented sp’s to loop through all the...
2015-03-06 (first published: 2015-02-24)
6,984 reads
We can directly access a CSV file using T-SQL.
Input file
Configure server to run Ad Hoc Distributed Queries
sp_configure 'Ad Hoc Distributed...
2015-02-17 (first published: 2015-02-09)
15,610 reads
CREATE TABLE #temp(name char(3))
INSERT INTO #temp VALUES ('CD')
,('AB')
,('LM')
,('BC')
,('GH')
,('KJ')
,('AB')
DECLARE @cols AS NVARCHAR(MAX);
SELECT @COLS = substring(list, 1, len(list) - 1)
FROM (SELECT list =
(SELECT DISTINCT...
2015-02-10 (first published: 2015-02-02)
10,404 reads
Read XML column attributes in to two columns DimType and Dimvalue from the below example also retrieve the data matching...
2015-01-29 (first published: 2015-01-22)
37,433 reads
There are many methods to find next business day. One common way is to use of calendar table. This post is to...
2015-01-19 (first published: 2015-01-12)
8,208 reads