<?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>BlogmyQuery - BMQ &#187; MySql</title>
	<atom:link href="http://blogmyquery.com/index.php/category/db/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogmyquery.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Sep 2010 13:03:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Update Multiple Tables with one Statement</title>
		<link>http://blogmyquery.com/index.php/2009/07/update-multiple-tables-with-one-statement/</link>
		<comments>http://blogmyquery.com/index.php/2009/07/update-multiple-tables-with-one-statement/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 21:02:22 +0000</pubDate>
		<dc:creator>kranthi</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Sqlserver]]></category>
		<category><![CDATA[Update Multiple Tables]]></category>

		<guid isPermaLink="false">http://blogmyquery.com/?p=605</guid>
		<description><![CDATA[In real time applications there might be situation where you need update details of one table using details of another [...]]]></description>
			<content:encoded><![CDATA[<p>In real time applications there might be situation where you need update details of one table using details of another or update two or tables using one statement. Below is Example of how you can do that in SQL Server </p>
<pre class="brush: plain;">
Update t1 Set t1.col1 = t2.col1 from Table t1 inner join Table t2 on t1.col = t2.col where Condtn
</pre>
<p>Below is MYSql Example</p>
<pre class="brush: plain;">
Update Table t1 inner join Table t2 on t1.col = t2.col Set t1.col1 = t2.col1 where Condtn
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogmyquery.com/index.php/2009/07/update-multiple-tables-with-one-statement/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating from MS SQL Server to MYSQL</title>
		<link>http://blogmyquery.com/index.php/2009/02/migrating-from-ms-sql-server-to-mysql/</link>
		<comments>http://blogmyquery.com/index.php/2009/02/migrating-from-ms-sql-server-to-mysql/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 17:04:26 +0000</pubDate>
		<dc:creator>kranthi</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Sqlserver]]></category>

		<guid isPermaLink="false">http://blogmyquery.com/index.php/2009/02/migrating-from-ms-sql-server-to-mysql/</guid>
		<description><![CDATA[Migrating from MS SQL to MYSQL is a big pain. there are no good tools to use for migration of [...]]]></description>
			<content:encoded><![CDATA[<p>Migrating from MS SQL to MYSQL is a big pain. there are no good tools to use for migration of the all the datbase objects, right from tables , data to stored procedures. We all know that Microsoft SQL server has a very good User Interface but when we come back to MYSQL we donot enjoy the same previlages as we do in SQL server. </p>
<p>Coming to the tools available to download for a good GUI, we have very less options, MYSQL query , PHPadmin are some of them. There are some tools which can be used to migrate the tables and data from the MSSQL to MYSQL. The MYSQL migration tool is also available to migrate the tables. But iam not sure that we can also migrate the stored procedures, but when i tried to migrate a small application i totally failed to shift the stored procedures to MYSQL. I have to migrate them manually. I have to check the syntax manually for each and every line and then execute the procedure.<br />
There are some points which we have to keep in mind while migrating the database from MSSQL to MYSQL. The MYSQL statements has to end with semi-colon , even the ending of the for loop has to closed by a semi-colon.  </p>
<p>When we migrate the tables from MSSQL to MYSQL we do not get the perfect script which defines the primary keys and the default values. We have to turn them on manually.</p>
<p>So please be carefull while doing the application and choosing the database, the migration of the database is same as a small project. <img src='http://blogmyquery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>wish you happy programmin</p>
]]></content:encoded>
			<wfw:commentRss>http://blogmyquery.com/index.php/2009/02/migrating-from-ms-sql-server-to-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Number of Days in a Month Function</title>
		<link>http://blogmyquery.com/index.php/2009/01/get-number-of-days-in-a-month-function/</link>
		<comments>http://blogmyquery.com/index.php/2009/01/get-number-of-days-in-a-month-function/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 03:35:40 +0000</pubDate>
		<dc:creator>kranthi</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Sqlserver]]></category>
		<category><![CDATA[Number of days in month]]></category>

		<guid isPermaLink="false">http://blogmyquery.com/?p=89</guid>
		<description><![CDATA[This article shows the ways to get the number of days in a month in both sqlserver and mysql.
Getting the [...]]]></description>
			<content:encoded><![CDATA[<p>This article shows the ways to get the number of days in a month in both sqlserver and mysql.</p>
<p>Getting the number of days in a month is quite easy because it is going to be either 30 or 31 days, with the exception of February, which can either have 28 or 29 days depending if it is a leap year or not.</p>
<ul>
<li> January,March,May,July,August,October,December &#8212; 31 Days</li>
<li> April,June,September,November &#8211; 30 Days</li>
<li> February &#8211; 28 Days (Non Leap Year), 29 (Leap Year)</li>
</ul>
<p>Leap year should be divisible by 4, should not be divisible by 100 or should be divisible by 400.</p>
<p><span id="more-89"></span></p>
<pre class="brush: css;">
CREATE FUNCTION [dbo].[udf_GetDaysInMonth] ( @pDate    DATETIME )
RETURNS INT
AS
BEGIN

RETURN CASE WHEN MONTH(@pDate) IN (1, 3, 5, 7, 8, 10, 12) THEN 31
WHEN MONTH(@pDate) IN (4, 6, 9, 11) THEN 30
ELSE CASE WHEN (YEAR(@pDate) % 4    = 0 AND
YEAR(@pDate) % 100 != 0) OR
(YEAR(@pDate) % 400  = 0)
THEN 29
ELSE 28
END
END

END
GO
</pre>
<p>Here&#8217;s yet another way of determining the number of days in a month without knowing if it is a leap year.  It is computed by getting the lastday of the month.</p>
<pre class="brush: css;">
CREATE FUNCTION [dbo].[udf_GetDaysInMonth] ( @pDate    DATETIME )
RETURNS INT
AS
BEGIN
SET @pDate = @pDate - DAY(@pDate) + 1 -- Get the first date of the month
RETURN day(dateadd(dd,-1,@pDate))
END
GO
</pre>
<p>Get the number of days in month in <strong>MYSQL</strong></p>
<pre class="brush: css;">

select DAY(LAST_DAY('2004-02-05'))
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogmyquery.com/index.php/2009/01/get-number-of-days-in-a-month-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A few maximum limitations for Sqlserver and MySql</title>
		<link>http://blogmyquery.com/index.php/2009/01/sqlmaximums/</link>
		<comments>http://blogmyquery.com/index.php/2009/01/sqlmaximums/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 04:50:46 +0000</pubDate>
		<dc:creator>jvanamali</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[Sqlserver]]></category>

		<guid isPermaLink="false">http://blogmyquery.com/?p=23</guid>
		<description><![CDATA[Often people in newsgroups ask about maximum size of various objects defined in databases.
The following tables shows the maximum sizes [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Verdana; font-size: x-small;">Often people in newsgroups ask about maximum size of various objects defined in databases.</span></p>
<p><span style="font-family: Verdana; font-size: x-small;">The following tables shows the maximum sizes and numbers of various objects defined in MYSql, SQL Server.<br />
</span></p>
<p><span style="font-family: Verdana; font-size: x-small;"><br />
</span></p>
<div>
<table id="tbl" border="0" width="100%">
<caption>MySql Maximums</caption>
<tbody>
<tr>
<td>Char</td>
<td>255 Bytes</td>
</tr>
<tr>
<td>Varchar</td>
<td>65,535 Bytes</td>
</tr>
<tr>
<td>Binary</td>
<td>255 Bytes</td>
</tr>
<tr>
<td>Varbinary</td>
<td>65,535 Bytes</td>
</tr>
<tr>
<td>TinyBlob</td>
<td>255 Bytes</td>
</tr>
<tr>
<td>TinyText</td>
<td>255 Bytes</td>
</tr>
<tr>
<td>Blob</td>
<td>65,535 Bytes (2^16 -1)</td>
</tr>
<tr>
<td>Text</td>
<td>65,535 Bytes (2^16 -1)</td>
</tr>
<tr>
<td>Medium Blob</td>
<td>16,777,215 Bytes (2^24 -1)</td>
</tr>
<tr>
<td>Medium Text</td>
<td>16,777,215 Bytes (2^24 -1)</td>
</tr>
<tr>
<td>LongBlog</td>
<td>4,294,967,295 Bytes (2^32 -1)</td>
</tr>
<tr>
<td>LongText</td>
<td>4,294,967,295 Bytes (2^32 -1)</td>
</tr>
<tr>
<td>Bit</td>
<td>Range from 1 to 64</td>
</tr>
<tr>
<td>Tinyint</td>
<td>The signed range is -128 to 127. The unsigned range is 0 to 255.</td>
</tr>
<tr>
<td>BOOL, BOOLEAN</td>
<td>true or false</td>
</tr>
<tr>
<td>SmallInt</td>
<td>The signed range is -32768 to 32767. The unsigned range is 0 to 65535.</td>
</tr>
<tr>
<td>MediumInt</td>
<td>The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.</td>
</tr>
<tr>
<td>Int/Integer</td>
<td>The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.</td>
</tr>
<tr>
<td>BigInt</td>
<td>The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range<br />
is 0 to 18446744073709551615.</td>
</tr>
<tr>
<td>Float</td>
<td>Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38<br />
to 3.402823466E+38.</td>
</tr>
<tr>
<td>Double</td>
<td>Allowable values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and<br />
2.2250738585072014E-308 to 1.7976931348623157E+308.</td>
</tr>
</tbody>
</table>
</div>
<p><span id="more-23"></span></p>
<div>
<table id="tbl" border="0" width="100%">
<caption>Sqlserver Maximums </caption>
<tbody>
<tr>
<td>char</td>
<td>8,000 Char</td>
</tr>
<tr>
<td>nchar</td>
<td>4,000 char</td>
</tr>
<tr>
<td>varchar</td>
<td>8,000 char</td>
</tr>
<tr>
<td>nvarchar</td>
<td>8,000 char</td>
</tr>
<tr>
<td>varchar(max)</td>
<td>1,073,741,824 char</td>
</tr>
<tr>
<td>nvarchar(max)</td>
<td>536,870,912 char</td>
</tr>
<tr>
<td>Tinyint</td>
<td>The range is 0 to 255.</td>
</tr>
<tr>
<td>SmallInt</td>
<td>The signed range is -32768 to 32767.</td>
</tr>
<tr>
<td>BigInt</td>
<td>The signed range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.</td>
</tr>
<tr>
<td>Int</td>
<td>The signed range is -2,147,483,648 to 2,147,483,647.</td>
</tr>
<tr>
<td>money</td>
<td>The signed range is -922,337,203,685,477.5808 to 922,337,203,685,477.5807.</td>
</tr>
<tr>
<td>smallmoney</td>
<td>Allowable values are -214,748.3648 to 214,748.3647.</td>
</tr>
<tr>
<td>bit</td>
<td>single bit.</td>
</tr>
<tr>
<td>binary</td>
<td>8,000 bytes.</td>
</tr>
<tr>
<td>varbinary</td>
<td>8,000 bytes.</td>
</tr>
<tr>
<td>varbinary(max)</td>
<td>2 GB Data.</td>
</tr>
<tr>
<td>image</td>
<td>2 GB Data.</td>
</tr>
</tbody>
</table>
</div>
<div>
<table id="tbl" border="0" width="100%">
<caption>Other Helpful Sql Maximums</caption>
<tbody>
<tr>
<td align="left">Bytes per short string column</td>
<td align="left">8,000</td>
</tr>
<tr>
<td align="left">Bytes per GROUP BY, ORDER BY</td>
<td align="left">8,060</td>
</tr>
<tr>
<td align="left">Columns in GROUP BY, ORDER BY</td>
<td align="left">Limited only by number of bytes</td>
</tr>
<tr>
<td align="left">Bytes per index key</td>
<td align="left">900</td>
</tr>
<tr>
<td align="left">Bytes per foreign key</td>
<td align="left">900</td>
</tr>
<tr>
<td align="left">Bytes per primary key</td>
<td align="left">900</td>
</tr>
<tr>
<td align="left">Bytes per row</td>
<td align="left">8,060</td>
</tr>
<tr>
<td align="left">Bytes per varchar(max), varbinary(max), xml, text, or image column</td>
<td align="left">2^31-1</td>
</tr>
<tr>
<td align="left">Characters per ntext or nvarchar(max) column</td>
<td align="left">2^30-1</td>
</tr>
<tr>
<td align="left">Clustered indexes per table</td>
<td align="left">1</td>
</tr>
<tr>
<td align="left">Columns per index key</td>
<td align="left">16</td>
</tr>
<tr>
<td align="left">Columns per foreign key</td>
<td align="left">16</td>
</tr>
<tr>
<td align="left">Columns per primary key</td>
<td align="left">16</td>
</tr>
<tr>
<td align="left">Columns per base table</td>
<td align="left">1,024</td>
</tr>
<tr>
<td align="left">Columns per SELECT statement</td>
<td align="left">4,096</td>
</tr>
<tr>
<td align="left">Columns per INSERT statement</td>
<td align="left">1,024</td>
</tr>
<tr>
<td align="left">Connections per client</td>
<td align="left">32,767</td>
</tr>
<tr>
<td align="left">Database size</td>
<td align="left">1,048,516 terabytes</td>
</tr>
<tr>
<td align="left">Databases per instance of SQL Server</td>
<td align="left">32,767</td>
</tr>
<tr>
<td align="left">Filegroups per database</td>
<td align="left">32,767</td>
</tr>
<tr>
<td align="left">Files per database</td>
<td align="left">32,767</td>
</tr>
<tr>
<td align="left">File size (data)</td>
<td align="left">16 terabytes</td>
</tr>
<tr>
<td align="left">File size (log)</td>
<td align="left">2 terabytes</td>
</tr>
<tr>
<td align="left">Foreign key table references per table</td>
<td align="left">253</td>
</tr>
<tr>
<td align="left">Identifier length (in characters)</td>
<td align="left">128</td>
</tr>
<tr>
<td align="left">Instances per computer</td>
<td align="left">50 (Workgroup Edition only 16)</td>
</tr>
<tr>
<td align="left">Locks per connection</td>
<td align="left">Maximum locks per server</td>
</tr>
<tr>
<td align="left">Locks per instance of SQL Server</td>
<td align="left">Up to 2,147,483,647</td>
</tr>
<tr>
<td align="left">Nested stored procedure levels</td>
<td align="left">32</td>
</tr>
<tr>
<td align="left">Nested subqueries</td>
<td align="left">32</td>
</tr>
<tr>
<td align="left">Nested trigger levels</td>
<td align="left">32</td>
</tr>
<tr>
<td align="left">Nonclustered indexes per table</td>
<td align="left">249</td>
</tr>
<tr>
<td align="left">Parameters per stored procedure</td>
<td align="left">2,100</td>
</tr>
<tr>
<td align="left">Parameters per user-defined function</td>
<td align="left">2,100</td>
</tr>
<tr>
<td align="left">REFERENCES per table</td>
<td align="left">253</td>
</tr>
<tr>
<td align="left">Rows per table</td>
<td align="left">Limited by available storage</td>
</tr>
<tr>
<td align="left">Tables per database</td>
<td align="left">Limited by number of objects in a database</td>
</tr>
<tr>
<td align="left">Partitions per partitioned table or index</td>
<td align="left">1,000</td>
</tr>
<tr>
<td align="left">Statistics on non-indexed columns</td>
<td align="left">2,000</td>
</tr>
<tr>
<td align="left">Tables per SELECT statement</td>
<td align="left">256</td>
</tr>
<tr>
<td align="left">Triggers per table</td>
<td align="left">Limited by number of objects in a database</td>
</tr>
<tr>
<td align="left">UNIQUE indexes or constraints per table</td>
<td align="left">249 nonclustered and 1 clustered</td>
</tr>
<tr>
<td align="left">User connections</td>
<td align="left">32,767</td>
</tr>
<tr>
<td align="left">XML indexes</td>
<td align="left">249</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blogmyquery.com/index.php/2009/01/sqlmaximums/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
