<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dba activity &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/dba-activity/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 21 Jan 2019 07:09:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server: Script to find a list of Weekends between two Dates</title>
		<link>https://www.dbrnd.com/2019/01/sql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work/</link>
					<comments>https://www.dbrnd.com/2019/01/sql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 21 Jan 2019 07:09:51 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dba activity]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[EOMONTH]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[weekend]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4067</guid>

					<description><![CDATA[In this post, I am sharing one script to find a list of Weekends between given two Dates in SQL Server. If you are a database developer and reading this post, you should know about the life of DBA. Database Administrator life is for 24*7 and they have to also set few maintenance tasks over [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&amp;linkname=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2019%2F01%2Fsql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work%2F&#038;title=SQL%20Server%3A%20Script%20to%20find%20a%20list%20of%20Weekends%20between%20two%20Dates" data-a2a-url="https://www.dbrnd.com/2019/01/sql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work/" data-a2a-title="SQL Server: Script to find a list of Weekends between two Dates"></a></p><p>In this post, I am sharing one script to find a list of Weekends between given two Dates in SQL Server.</p>
<blockquote><p>If you are a database developer and reading this post, you should know about the life of DBA.<br />
Database Administrator life is for 24*7 and they have to also set few maintenance tasks over the weekends and holidays. </p></blockquote>
<blockquote><p>This script helps to DBA for finding available weekends between the dates so they can set auto-schedule for database maintenance.</p></blockquote>
<p><strong>Please access few related articles:</strong></p>
<blockquote class="wp-embedded-content" data-secret="VRCL4CschW"><p><a href="https://www.dbrnd.com/2016/07/a-day-in-the-life-of-a-dba-database-administrator/">A Day in the life of a DBA !</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/07/a-day-in-the-life-of-a-dba-database-administrator/embed/#?secret=VRCL4CschW" data-secret="VRCL4CschW" width="600" height="338" title="&#8220;A Day in the life of a DBA !&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="Fdmay8AehU"><p><a href="https://www.dbrnd.com/2016/01/sql-server-2012-find-first-sunday-of-next-month-using-eomonth/">SQL Server 2012: Find First Sunday of Next Month using EOMONTH</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/01/sql-server-2012-find-first-sunday-of-next-month-using-eomonth/embed/#?secret=Fdmay8AehU" data-secret="Fdmay8AehU" width="600" height="338" title="&#8220;SQL Server 2012: Find First Sunday of Next Month using EOMONTH&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<pre class="crayon-plain-tag">DECLARE @beginDate DATE = '20161201'
DECLARE @endDate DATE = '20161231'  
 
DECLARE @Weekend TABLE
(
	Weekend DATE PRIMARY KEY
	,IsWeekend BIT
)
 
WHILE @beginDate &lt;= @endDate 
BEGIN 
INSERT INTO @Weekend 
SELECT 
	@beginDate AS Weekend 
	,(CASE WHEN DATEPART(WEEKDAY, @beginDate) In (7, 1) THEN 1 ELSE 0 END) AS IsWeekend 
	SET @beginDate = DateAdd(Day, 1, @beginDate) 
END
 
SELECT Weekend FROM @Weekend WHERE IsWeekend = 1</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2019/01/sql-server-script-to-find-a-list-of-weekends-between-two-dates-dba-maintenance-work/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
