<?xml version="1.0" ?><rss version="2.0" xmlns:ec="http://www.eggheadcafe.com"><channel><title>eggheadcafe.com SQL Server FAQs</title><link>http://www.eggheadcafe.com</link><pubDate>Fri, 26 Apr 2013 15:26:21 GMT</pubDate><description>EggHeadCafe - The .NET developer's portal of choice</description><language>en-us</language><item><title><![CDATA[Generate Full Bank ABA Routing Number given the Federal Reserve Routing Symbol and ABA Institution Identifier]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/4f04344c-06b7-4a23-a23b-1ab83a974769/generate-full-bank-aba-routing-number-given-the-federal-reserve-routing-symbol-and-aba-institution-identifier.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/4f04344c-06b7-4a23-a23b-1ab83a974769/generate-full-bank-aba-routing-number-given-the-federal-reserve-routing-symbol-and-aba-institution-identifier.aspx]]></link><description><![CDATA[A bank ABA number our routing number is made up of three numbers, the federal reserve routing symbol (4 digits), the ABA institution indentifier (4 digits) and a check digit (1 digit).  This SQL stored procedure returns the full bank routing number given the first two parts.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/4f04344c-06b7-4a23-a23b-1ab83a974769/generate-full-bank-aba-routing-number-given-the-federal-reserve-routing-symbol-and-aba-institution-identifier.aspx" target="_self">read more</a>]]></description><pubDate>Thu, 16 Aug 2012 12:55:12 GMT</pubDate></item><item><title><![CDATA[Send authenticated SMTP email from SSIS]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/59893c73-fc5a-4ac1-af8a-c306c211f22e/send-authenticated-smtp-email-from-ssis.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/59893c73-fc5a-4ac1-af8a-c306c211f22e/send-authenticated-smtp-email-from-ssis.aspx]]></link><description><![CDATA[SSIS has a 'Send Mail Task', but it wont send via a SMTP server that requires authentication.  By using the Script Task it is fairly simple to write some .NET code that will send an email via an authenticate STMP connection.  Here is some sample VB.NET to send an email, it pulls all relavent information from variables that should be sent into the script from the SSIS package.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/59893c73-fc5a-4ac1-af8a-c306c211f22e/send-authenticated-smtp-email-from-ssis.aspx" target="_self">read more</a>]]></description><pubDate>Tue, 17 Apr 2012 20:51:37 GMT</pubDate></item><item><title><![CDATA[Create an array of strings in SSIS]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/269c2a6d-fe47-4628-ba26-3401ee304b9e/create-an-array-of-strings-in-ssis.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/269c2a6d-fe47-4628-ba26-3401ee304b9e/create-an-array-of-strings-in-ssis.aspx]]></link><description><![CDATA[If you need to use an array of strings in SSIS it is a little difficult to create it as a variable in the package.  It takes defining the package variable as a system.object and calling a script task, either VB or C# (example is VB.NET).  In my example I set System:Package name as a ReadOnly variable and User:Categories as ReadWrite, this is also the one defined as the system.object.  The sample Main procedure sets the first element of the string array to the package name.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/269c2a6d-fe47-4628-ba26-3401ee304b9e/create-an-array-of-strings-in-ssis.aspx" target="_self">read more</a>]]></description><pubDate>Wed, 11 Apr 2012 22:24:03 GMT</pubDate></item><item><title><![CDATA[How to display date difference in Days:Hours:Minutes format using TSQL]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/b8eb8a1f-c215-4f78-af23-42104bf443db/how-to-display-date-difference-in-dayshoursminutes-format-using-tsql.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/b8eb8a1f-c215-4f78-af23-42104bf443db/how-to-display-date-difference-in-dayshoursminutes-format-using-tsql.aspx]]></link><description><![CDATA[Often times on reports from Microsoft SQL server it is nice to display the difference between two datetime fields in something other than just the number of minutes, or days.  This code snippet shows how to format the datediff output for minutes into hours, days, minutes format.  It could easily be placed in a user defined function as well as have logic added to it for seconds and milliseconds if necessary.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/b8eb8a1f-c215-4f78-af23-42104bf443db/how-to-display-date-difference-in-dayshoursminutes-format-using-tsql.aspx" target="_self">read more</a>]]></description><pubDate>Wed, 15 Feb 2012 23:25:06 GMT</pubDate></item><item><title><![CDATA[View print statements in your stored procedures in C# via ADO.NET]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/a199eaf7-9418-46ff-b780-997d9513edf9/view-print-statements-in-your-stored-procedures-in-c-via-adonet.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/a199eaf7-9418-46ff-b780-997d9513edf9/view-print-statements-in-your-stored-procedures-in-c-via-adonet.aspx]]></link><description><![CDATA[You may have "print" statements in your stored procedures or function in SQL Server for informational purposes.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/a199eaf7-9418-46ff-b780-997d9513edf9/view-print-statements-in-your-stored-procedures-in-c-via-adonet.aspx" target="_self">read more</a>]]></description><pubDate>Sat, 31 Dec 2011 14:30:42 GMT</pubDate></item><item><title><![CDATA[SQL Server - block execution of a sql command for a certain period of time]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/f0614767-3ad4-4ab2-8614-8ac6aa2fb36e/sql-server--block-execution-of-a-sql-command-for-a-certain-period-of-time.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/f0614767-3ad4-4ab2-8614-8ac6aa2fb36e/sql-server--block-execution-of-a-sql-command-for-a-certain-period-of-time.aspx]]></link><description><![CDATA[SQL Server provides you the WAITFOR DELAY clause that helps you to delay the execution of a command for certain amount of time.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/f0614767-3ad4-4ab2-8614-8ac6aa2fb36e/sql-server--block-execution-of-a-sql-command-for-a-certain-period-of-time.aspx" target="_self">read more</a>]]></description><pubDate>Thu, 27 Oct 2011 13:52:01 GMT</pubDate></item><item><title><![CDATA[SQL Server - Quick way to find the rowcount in a table.]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/6ce1ff33-196a-47f2-ae48-1bbfe313ac08/sql-server--quick-way-to-find-the-rowcount-in-a-table.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/6ce1ff33-196a-47f2-ae48-1bbfe313ac08/sql-server--quick-way-to-find-the-rowcount-in-a-table.aspx]]></link><description><![CDATA[Use the Sysindexes table to find the number of rows in a table.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/6ce1ff33-196a-47f2-ae48-1bbfe313ac08/sql-server--quick-way-to-find-the-rowcount-in-a-table.aspx" target="_self">read more</a>]]></description><pubDate>Thu, 27 Oct 2011 11:56:09 GMT</pubDate></item><item><title><![CDATA[What is the difference between Stored Procedure and User defined funtion]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/fdc62aaf-cca4-4e58-8b6d-6008d47468b3/what-is-the-difference-between-stored-procedure-and-user-defined-funtion.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/fdc62aaf-cca4-4e58-8b6d-6008d47468b3/what-is-the-difference-between-stored-procedure-and-user-defined-funtion.aspx]]></link><description><![CDATA[The user defined function provides a mechanism for extending the functionality of the database server by adding a function that can be evaluated in SQL statements. A stored procedure is a subroutine available to applications accessing a relational database system&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/fdc62aaf-cca4-4e58-8b6d-6008d47468b3/what-is-the-difference-between-stored-procedure-and-user-defined-funtion.aspx" target="_self">read more</a>]]></description><pubDate>Wed, 03 Aug 2011 11:12:58 GMT</pubDate></item><item><title><![CDATA[SQL Server - What data type should I use to store binary data?]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/54669b9a-dee5-430b-93a6-f934355610bc/sql-server--what-data-type-should-i-use-to-store-binary-data.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/54669b9a-dee5-430b-93a6-f934355610bc/sql-server--what-data-type-should-i-use-to-store-binary-data.aspx]]></link><description><![CDATA[Use Binary or VarBinary fields to store fixed or variable length. These were available in 2005 and 2008 versions only.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/54669b9a-dee5-430b-93a6-f934355610bc/sql-server--what-data-type-should-i-use-to-store-binary-data.aspx" target="_self">read more</a>]]></description><pubDate>Tue, 24 May 2011 23:32:20 GMT</pubDate></item><item><title><![CDATA[SQL Server - Change the datatype of a Timestamp column.]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/6dc8d4c2-3a43-4f0d-b010-b5db61b0c5ef/sql-server--change-the-datatype-of-a-timestamp-column.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/6dc8d4c2-3a43-4f0d-b010-b5db61b0c5ef/sql-server--change-the-datatype-of-a-timestamp-column.aspx]]></link><description><![CDATA[There is no workaround to change the datatype of a Timestamp column. You will have to drop the column and recreate it.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/6dc8d4c2-3a43-4f0d-b010-b5db61b0c5ef/sql-server--change-the-datatype-of-a-timestamp-column.aspx" target="_self">read more</a>]]></description><pubDate>Tue, 24 May 2011 23:32:48 GMT</pubDate></item><item><title><![CDATA[SQL Server - What is the difference between Varchar and NVarchar]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/88c2cde7-b0a3-473e-a020-8b4371c083c5/sql-server--what-is-the-difference-between-varchar-and-nvarchar.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/88c2cde7-b0a3-473e-a020-8b4371c083c5/sql-server--what-is-the-difference-between-varchar-and-nvarchar.aspx]]></link><description><![CDATA[Varchar can store non-Unicode character data where as nvarchar can store Unicode character data.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/88c2cde7-b0a3-473e-a020-8b4371c083c5/sql-server--what-is-the-difference-between-varchar-and-nvarchar.aspx" target="_self">read more</a>]]></description><pubDate>Wed, 18 May 2011 17:49:49 GMT</pubDate></item><item><title><![CDATA[SQL Server Determine how many rows were operated on in previous query]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/9d333971-0ee9-40bb-b070-d07fa21b1e3f/sql-server-determine-how-many-rows-were-operated-on-in-previous-query.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/9d333971-0ee9-40bb-b070-d07fa21b1e3f/sql-server-determine-how-many-rows-were-operated-on-in-previous-query.aspx]]></link><description><![CDATA[Sometimes in a stored procedure or other T-SQL process you need to figure out how many rows were operated on by the last statement.  Using the @@RowCount variable makes it quite easy.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/9d333971-0ee9-40bb-b070-d07fa21b1e3f/sql-server-determine-how-many-rows-were-operated-on-in-previous-query.aspx" target="_self">read more</a>]]></description><pubDate>Tue, 12 Apr 2011 16:36:45 GMT</pubDate></item><item><title><![CDATA[List MS SQL Tables with columns and data types]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/d5a75937-e6e9-448a-91ba-963050964952/list-ms-sql-tables-with-columns-and-data-types.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/d5a75937-e6e9-448a-91ba-963050964952/list-ms-sql-tables-with-columns-and-data-types.aspx]]></link><description><![CDATA[Here's a quick query to list all the tables in a database joined with their columns and displaying the column types and sizes.  Works in MS SQL 2000, 2005 and 2008.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/d5a75937-e6e9-448a-91ba-963050964952/list-ms-sql-tables-with-columns-and-data-types.aspx" target="_self">read more</a>]]></description><pubDate>Thu, 07 Apr 2011 12:00:12 GMT</pubDate></item><item><title><![CDATA[Difference between cross join and Full outer join]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/f43ba249-aa36-497c-8c0a-cc307b5280e2/difference-between-cross-join-and-full-outer-join.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/f43ba249-aa36-497c-8c0a-cc307b5280e2/difference-between-cross-join-and-full-outer-join.aspx]]></link><description><![CDATA[The difference between cross join and full outer join.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/f43ba249-aa36-497c-8c0a-cc307b5280e2/difference-between-cross-join-and-full-outer-join.aspx" target="_self">read more</a>]]></description><pubDate>Thu, 07 Apr 2011 12:12:34 GMT</pubDate></item><item><title><![CDATA[What is a SQL Server Trace flag? Where do we use it?]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/26893279-78eb-436a-a5ea-7615a73f628e/what-is-a-sql-server-trace-flag-where-do-we-use-it.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/26893279-78eb-436a-a5ea-7615a73f628e/what-is-a-sql-server-trace-flag-where-do-we-use-it.aspx]]></link><description><![CDATA[the trace flag and where do we use it&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/26893279-78eb-436a-a5ea-7615a73f628e/what-is-a-sql-server-trace-flag-where-do-we-use-it.aspx" target="_self">read more</a>]]></description><pubDate>Tue, 05 Apr 2011 17:56:12 GMT</pubDate></item><item><title><![CDATA[what is buffer cache and log Cache in sql server]]></title><guid isPermaLink="true"><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/085030fa-6c38-4e7c-9a4f-4f2f982a14f6/what-is-buffer-cache-and-log-cache-in-sql-server.aspx]]></guid><link><![CDATA[http://www.eggheadcafe.com/sample-code/SQLServer/085030fa-6c38-4e7c-9a4f-4f2f982a14f6/what-is-buffer-cache-and-log-cache-in-sql-server.aspx]]></link><description><![CDATA[buffer cache and memory cachje in sql server.&nbsp;&nbsp;<a href="http://www.eggheadcafe.com/sample-code/SQLServer/085030fa-6c38-4e7c-9a4f-4f2f982a14f6/what-is-buffer-cache-and-log-cache-in-sql-server.aspx" target="_self">read more</a>]]></description><pubDate>Tue, 05 Apr 2011 17:55:24 GMT</pubDate></item></channel></rss>