<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-741136129346231464</id><updated>2012-02-16T14:38:04.818+08:00</updated><category term='Row Data to Column Data'/><category term='Add Serial Number to Our Query Result'/><category term='What Are The Backgroud Files of Your Database?'/><category term='Conditional Where Clause'/><category term='Joining to the Next Sequential Row'/><category term='Display Different Values In Respective Columns'/><category term='Get All Dates'/><category term='Constant Column and Stock or Service Discount Setup'/><category term='Databases and Performance We Should Consider'/><category term='Constant Table'/><category term='Why This Blog'/><category term='Formatting Characters In SQL'/><title type='text'>MS SQL Whatever</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-2892945523876746131</id><published>2008-09-03T21:56:00.002+08:00</published><updated>2008-09-03T22:00:07.520+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Conditional Where Clause'/><title type='text'>Conditional Where Clause</title><summary type='text'>I didn’t write any post on my blog for quite long time. Today, I spend some times to write a post. Actually, this topic is saved in my draft for quite long also. :) And I received one topic from SQL Server Central which is same as my topic. We know last time that we cannot put conditional filter in where clause of T-SQL statements. But that’s not true that I find out one thing which can use </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/2892945523876746131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=2892945523876746131' title='39 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/2892945523876746131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/2892945523876746131'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/09/conditional-where-clause.html' title='Conditional Where Clause'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>39</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-2324578184223147047</id><published>2008-06-14T15:02:00.001+08:00</published><updated>2008-06-14T15:03:50.900+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Constant Column and Stock or Service Discount Setup'/><title type='text'>Constant Column and Stock or Service Discount Setup</title><summary type='text'>I didn’t update my blog for quite long time. Today, let me share some knowledge on T-SQL Programming. Last time, I posted constant table. This time, I wanna post constant fields and joining 2 tables without having any relationship.  Interesting, right? Sometimes, our customer request to generate setup data for their promotion and discount. And that time, both their services or stocks table and </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/2324578184223147047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=2324578184223147047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/2324578184223147047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/2324578184223147047'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/06/constant-column-and-stock-or-service.html' title='Constant Column and Stock or Service Discount Setup'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-7884239656492626344</id><published>2008-05-01T22:50:00.002+08:00</published><updated>2008-05-01T22:55:55.732+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Formatting Characters In SQL'/><title type='text'>Formatting Characters In SQL</title><summary type='text'>If you want to format result values in SQL, you can use the following methods:Let assume we have integer value variable.DECLARE @DataValue AS intSET @DataValue = 2and wanna format as '00002'There're 2 ways to format:SELECT REPLICATE('0', 5 - LEN(@DataValue)) + CAST(@DataValue AS VARCHAR(MAX))ORSELECT RIGHT('00000' + CAST(@DataValue AS VARCHAR(max)), 5)</summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/7884239656492626344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=7884239656492626344' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/7884239656492626344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/7884239656492626344'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/05/formatting-characters-in-sql.html' title='Formatting Characters In SQL'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-4221570936202343002</id><published>2008-05-01T13:59:00.004+08:00</published><updated>2008-05-01T14:03:20.768+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Row Data to Column Data'/><title type='text'>Row Data to Column Data</title><summary type='text'>This is also one of my question in Experts-Exchange forum. I wanna display row data to in a columnar format. I’ve one tables which include three columns such as Sr, StartDate and EndDate. I wanna display count of Sr group by month depending on the StartDate and the resulted format is as follow:Sr|Jan|Feb|Mar|..to..|DecThe solution for this problem is as follow:SELECT Sr, Jan = SUM(CASE WHEN MONTH</summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/4221570936202343002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=4221570936202343002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/4221570936202343002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/4221570936202343002'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/05/row-data-to-column-data.html' title='Row Data to Column Data'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-8968874655955610126</id><published>2008-05-01T13:44:00.001+08:00</published><updated>2008-05-01T13:46:11.964+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Display Different Values In Respective Columns'/><title type='text'>Display Different Values In Respective Columns</title><summary type='text'>I haven’t updated my blog for quite long time. But today I’ve times to post some information related to the SQL query. When I prepare reports for one of the hospital in Myanmar, I’m facing some difficulties to display data and raised question in Experts-Exchange. This post is my re-collection of solutions from Experts-Exchange. And also thanks for the expert, angellll, who answer this solution </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/8968874655955610126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=8968874655955610126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/8968874655955610126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/8968874655955610126'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/05/display-different-values-in-respective.html' title='Display Different Values In Respective Columns'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-8273626014925683599</id><published>2008-04-11T21:57:00.007+08:00</published><updated>2008-04-11T22:16:10.379+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Joining to the Next Sequential Row'/><title type='text'>Joining to the Next Sequential Row</title><summary type='text'>Because of the format problem, please see this article here. Sorry for this inconvenience. ;(</summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/8273626014925683599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=8273626014925683599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/8273626014925683599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/8273626014925683599'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/04/joining-to-next-sequential-row.html' title='Joining to the Next Sequential Row'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-5979301999808206647</id><published>2008-03-29T17:19:00.001+08:00</published><updated>2008-03-29T17:28:20.397+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Get All Dates'/><title type='text'>Get All Dates</title><summary type='text'>When we develop application, we need all the days from the month sometimes. We are thinking of the way to create StoreProcedure to generate days using temp table and cursor. But using cursor will slow down our application process and we want faster way to get all days. So we think of another way to create one table which store all the days from 1-Jan of current year to 31-Dec. That’s also not </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/5979301999808206647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=5979301999808206647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/5979301999808206647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/5979301999808206647'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/03/get-all-dates.html' title='Get All Dates'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-5343442973034386539</id><published>2008-03-29T09:05:00.002+08:00</published><updated>2008-03-29T09:15:11.052+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Constant Table'/><title type='text'>Constant Table</title><summary type='text'>In database development, sometimes we really need to display some constant data and don’t wanna let user change that constant data. But those data are not so many and don’t wanna create table. For this situation, we’ve one alternative way in SQL to create constant table. The trick is not so advanced but it’s really easy and we already know those statements. We just create one simple view using </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/5343442973034386539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=5343442973034386539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/5343442973034386539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/5343442973034386539'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/03/constant-table.html' title='Constant Table'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-1192093806554459810</id><published>2008-03-29T08:52:00.000+08:00</published><updated>2008-03-29T09:01:50.991+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Add Serial Number to Our Query Result'/><title type='text'>Add Serial Number to Our Query Result</title><summary type='text'>Sometimes, we need to add serial number in our query result to show on the report. I’m not sure SQL 2000 has this feature or not but I never use that feature in SQL 2000. :D In SQL 2005, we’ve one function call ROW_NUMBER(). So we can display serial number in our query result. The example for that function is as follow:SELECT ROW_NUMBER() OVER(ORDER BY customername) FROM customer WHERE </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/1192093806554459810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=1192093806554459810' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/1192093806554459810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/1192093806554459810'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/03/add-serial-number-to-our-query-result.html' title='Add Serial Number to Our Query Result'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-7013329459970142615</id><published>2008-03-28T21:45:00.000+08:00</published><updated>2008-03-29T08:43:36.813+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What Are The Backgroud Files of Your Database?'/><title type='text'>What Are The Backgroud Files of Your Database?</title><summary type='text'>If you are boring on reading long text in my previous post, here’s some little text for you. Do you know how many data file type created from SQL 2005 after you created your database? You didn’t notice or forgot, right? If you didn’t create partition(s), there’re two files created which are .MDF file and .LDF file. .MDF for your primary data file and .LDF for your log file. If you created </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/7013329459970142615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=7013329459970142615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/7013329459970142615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/7013329459970142615'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/03/what-are-backgroud-files-of-your.html' title='What Are The Backgroud Files of Your Database?'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-5539203853485511319</id><published>2008-03-28T20:44:00.000+08:00</published><updated>2008-03-29T08:04:02.902+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Databases and Performance We Should Consider'/><title type='text'>Databases and Performance We Should Consider</title><summary type='text'>I’m sure most of us are happy with wizards which Microsoft provide in SQL and forget what is happening behind the wizards. This is one example for our ignorance in SQL 2005. Normally we right-click on the database node in Enterprise Manager, click New Database, type the database name and click OK to create new database in 2005 Version. But we forget about options from the wizard and ignore what </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/5539203853485511319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=5539203853485511319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/5539203853485511319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/5539203853485511319'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/03/databases-and-performance-we-should.html' title='Databases and Performance We Should Consider'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-741136129346231464.post-2317211099215995848</id><published>2008-03-28T20:19:00.001+08:00</published><updated>2008-03-29T09:21:46.671+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Why This Blog'/><title type='text'>Why This Blog</title><summary type='text'>I’ve created one blog called “My First Blog” which I posted some of jokes and information related to my personal life. But I also wanna create blog which support technical person and also note book for myself as in technical difficulties or some tricks. Actually, I’m not very good in technology that’s why finding tips and tricks from other developers from any web-site for my reference. While </summary><link rel='replies' type='application/atom+xml' href='http://alberttnt-sql.blogspot.com/feeds/2317211099215995848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=741136129346231464&amp;postID=2317211099215995848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/2317211099215995848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/741136129346231464/posts/default/2317211099215995848'/><link rel='alternate' type='text/html' href='http://alberttnt-sql.blogspot.com/2008/03/why-this-blog.html' title='Why This Blog'/><author><name>TNT @ Albert Sun</name><uri>http://www.blogger.com/profile/11637752884132566512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='http://bp2.blogger.com/_iJ4bwdw82p0/R7rpo8vbf2I/AAAAAAAAAHY/VTFeIQDeLW4/S220/31972682.jpg'/></author><thr:total>0</thr:total></entry></feed>
