<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>intellectually constipated : SQL Function</title><link>http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx</link><description>Tags: SQL Function</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to drop all tables, all views, and all stored procedures from a SQL 2005 DB...</title><link>http://blogs.msdn.com/patrickgallucci/archive/2008/04/29/how-to-drop-all-tables-all-views-and-all-stored-procedures-from-a-sql-2005-db.aspx</link><pubDate>Tue, 29 Apr 2008 23:00:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8439011</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/8439011.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=8439011</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=8439011</wfw:comment><description>This is a follow-up to the blog entry from Jasper Jugan . This is a modification to the script to allow for schema specific deletes of the SP's, Views and I added Functions. &amp;#160; create procedure usp_DropSPFunctionsViews as &amp;#160; -- variable to object...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2008/04/29/how-to-drop-all-tables-all-views-and-all-stored-procedures-from-a-sql-2005-db.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8439011" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Script/default.aspx">SQL Script</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Server+Stored+Procedure/default.aspx">SQL Server Stored Procedure</category></item><item><title>SQL Server Function to merge a date with a time</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/11/18/sql-server-function-to-merge-a-date-with-a-time.aspx</link><pubDate>Mon, 19 Nov 2007 05:03:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6385343</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/6385343.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=6385343</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=6385343</wfw:comment><description>I use this when I need to join two fields. One has a date, the other has a time. &amp;#160; IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N '[util].[uf_MergeDate2Time]' ) AND type in (N 'FN' , N 'IF' , N 'TF' , N 'FS' , N 'FT' )) DROP...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/11/18/sql-server-function-to-merge-a-date-with-a-time.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6385343" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/Business+Intelligence/default.aspx">Business Intelligence</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/Katmai/default.aspx">Katmai</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/Data+Warehouse/default.aspx">Data Warehouse</category></item><item><title>SQL Server Function to get the Hour of the Year</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/09/25/sql-server-function-to-get-the-hour-of-the-year.aspx</link><pubDate>Tue, 25 Sep 2007 23:32:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5129083</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/5129083.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=5129083</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=5129083</wfw:comment><description>This function returns an integer of the hour of the year passed as a variable. IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N '[util].[uf_GetHourOfYear]' ) AND type IN (N 'FN' , N 'IF' , N 'TF' , N 'FS' , N 'FT' )) DROP FUNCTION [util].[uf_GetHourOfYear]...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/09/25/sql-server-function-to-get-the-hour-of-the-year.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5129083" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/Katmai/default.aspx">Katmai</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/Data+Warehouse/default.aspx">Data Warehouse</category></item><item><title>SQL Server Function to get the Hour of the Month</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/09/25/sql-server-function-to-get-the-hour-of-the-month.aspx</link><pubDate>Tue, 25 Sep 2007 23:30:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5128979</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/5128979.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=5128979</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=5128979</wfw:comment><description>This function returns an integer of the hour of the month passed as a variable. IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N '[util].[uf_GetHourOfMonth]' ) AND type IN (N 'FN' , N 'IF' , N 'TF' , N 'FS' , N 'FT' )) DROP FUNCTION...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/09/25/sql-server-function-to-get-the-hour-of-the-month.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5128979" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/Data+Warehouse/default.aspx">Data Warehouse</category></item><item><title>SQL Server Function to return half year number of days.</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/09/24/sql-server-function-to-return-half-year-number-of-days.aspx</link><pubDate>Mon, 24 Sep 2007 17:29:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5098631</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/5098631.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=5098631</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=5098631</wfw:comment><description>This function returns an integer of the number of days in the half year. &amp;#xA0; IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N '[util].[uf_GetHalfYearDays]' ) AND type IN (N 'FN' , N 'IF' , N 'TF' , N 'FS' , N 'FT' )) DROP FUNCTION...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/09/24/sql-server-function-to-return-half-year-number-of-days.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5098631" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>SQL Server Function to Return DateName</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/08/01/sql-server-function-to-return-datename.aspx</link><pubDate>Wed, 01 Aug 2007 16:21:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4167875</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/4167875.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=4167875</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=4167875</wfw:comment><description>This function will return the date name for a given date time. 1: USE [DW_SharedDimensions]; 2: GO 3: IF EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N '[util].[uf_GetDateName]' ) AND type in (N 'FN' , N 'IF' , N 'TF' , N 'FS' , N 'FT'...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/08/01/sql-server-function-to-return-datename.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4167875" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category></item><item><title>SQL Server Function to Return Date from Numeric Value</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/07/31/sql-server-function-to-return-date-from-numeric-value.aspx</link><pubDate>Tue, 31 Jul 2007 16:31:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4148415</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/4148415.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=4148415</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=4148415</wfw:comment><description>This function will return a datetime for a numeric value. This is using the 1900 date system, the same as used by Excel. See http://office.microsoft.com/en-us/excel/HP100791811033.aspx for more examples. 1: IF EXISTS ( SELECT * FROM sys.objects WHERE...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/07/31/sql-server-function-to-return-date-from-numeric-value.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4148415" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category></item><item><title>SQL Server Function to Return Numeric Value for DateTime</title><link>http://blogs.msdn.com/patrickgallucci/archive/2007/07/31/sql-server-function-to-return-numeric-value.aspx</link><pubDate>Tue, 31 Jul 2007 14:49:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4146961</guid><dc:creator>Patrick Gallucci</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/patrickgallucci/comments/4146961.aspx</comments><wfw:commentRss>http://blogs.msdn.com/patrickgallucci/commentrss.aspx?PostID=4146961</wfw:commentRss><wfw:comment>http://blogs.msdn.com/patrickgallucci/rsscomments.aspx?PostID=4146961</wfw:comment><description>Technorati Tags: SQL Server , SQL , Function , Intellectually Constipated This function will return a numeric value for a given date. This is using the 1900 date system, the same as used by Excel. See http://office.microsoft.com/en-us/excel/HP100791811033.aspx...(&lt;a href="http://blogs.msdn.com/patrickgallucci/archive/2007/07/31/sql-server-function-to-return-numeric-value.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4146961" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/sql+server+2005/default.aspx">sql server 2005</category><category domain="http://blogs.msdn.com/patrickgallucci/archive/tags/SQL+Function/default.aspx">SQL Function</category></item></channel></rss>