<?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-8929673704186254954</id><updated>2011-08-03T09:53:13.208+05:30</updated><category term='difference between union and union all'/><category term='Option Strict On disallows'/><category term='Order by in the data view'/><category term='full text index population'/><category term='truncate log for all user databases'/><category term='Arithmetic overflow'/><category term='script to find out index usage'/><title type='text'>Sql Server</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-4347562840811083771</id><published>2009-08-14T21:30:00.005+05:30</published><updated>2009-08-14T21:32:33.653+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='full text index population'/><title type='text'>Why full-text population update is necessary?</title><summary type='text'>--The below script will show why we need to regularly update full text index, if the change_tracking is not set to Auto--Creating database--There are two filegroups. The second flegroup will be used for the storing the full text objects.--But, this is not a mendetory.Createdatabase FullTextSearch on primary (name = Data, filename = 'c:\FulltextSearch\data.mdf'), FILEGROUP fulltextfilegroup (name=</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/4347562840811083771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=4347562840811083771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/4347562840811083771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/4347562840811083771'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2009/08/why-full-text-population-update-is_14.html' title='Why full-text population update is necessary?'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-346522554012119559</id><published>2009-07-13T20:11:00.007+05:30</published><updated>2009-07-13T20:18:42.826+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='truncate log for all user databases'/><title type='text'>Script to truncate log of all the user databases</title><summary type='text'>/************************************************************************************Description: This script file will truncate the log file. When we run this script for first time this can take some time. So it is advisable that we run after working hours. Though this script can be run online, it is advisable to run the script when very minimal user activity is happening.Warning : This should </summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/346522554012119559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=346522554012119559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/346522554012119559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/346522554012119559'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2009/07/script-to-truncate-log-of-all-user.html' title='Script to truncate log of all the user databases'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-5899512427481949236</id><published>2009-07-09T21:46:00.003+05:30</published><updated>2009-07-14T00:46:00.057+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Order by in the data view'/><title type='text'>Order by in the data view</title><summary type='text'>Yesterday, one of my colleagues was asking me about using order by in the view.But, when he is getting error "ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified."Another restriction is he can not add column to the data view.But this can be easily done using the top 100 percent in the select query</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/5899512427481949236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=5899512427481949236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/5899512427481949236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/5899512427481949236'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2009/07/order-by-in-data-view.html' title='Order by in the data view'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-4030687947698778316</id><published>2009-03-26T20:38:00.001+05:30</published><updated>2009-03-26T22:36:57.128+05:30</updated><title type='text'>check values in text column for lower case or upper case</title><summary type='text'>Today, I came across the situation where we need to update the text column and we want all the column text to UPPER CASE. But, we  do not want to update the rows for which this text column already contains the word in upper case.use AdventureWorksGOif object_id('tblCheckCase') is not nulldrop table tblCheckCaseGOCreate table tblCheckCase(id int identity(1,1) primary key,firstName nvarchar(10))</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/4030687947698778316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=4030687947698778316' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/4030687947698778316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/4030687947698778316'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2009/03/check-values-in-text-column-is-lower.html' title='check values in text column for lower case or upper case'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-5877383264245787670</id><published>2009-01-28T15:43:00.001+05:30</published><updated>2009-07-09T17:19:54.754+05:30</updated><title type='text'>Use of TOP WITH TIES clause in SELECT queries</title><summary type='text'>This caluse can be used to get additional rows from the base result set with the same value .That is if the last of returned result set consists the same vlaue of order by item for other rows, those rows will also be returned.- This can be only used in select statemnet.- Order by clause is necessary for using this clause- This can also be used with PERCENT clause.Example:-if object_id('test_top',</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/5877383264245787670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=5877383264245787670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/5877383264245787670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/5877383264245787670'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2009/01/use-of-top-with-ties-clause-in-select.html' title='Use of TOP WITH TIES clause in SELECT queries'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-9163776312252236310</id><published>2008-10-21T14:52:00.000+05:30</published><updated>2008-10-21T14:58:28.578+05:30</updated><title type='text'>Pattern Matching with the ESCAPE Clause</title><summary type='text'>We use % and _ in wildcard search with like clause but, some time we need to search the same chars from the string. So below example shows how to tackle this situationFor that we can use the ESCAPE caluse with like clause. we just have to define a ESCAPE char that will ESCAPE the next char from search string.if object_id('test','U') is not nulldrop table TASK_DETAILGOcreate table task_detail(id </summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/9163776312252236310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=9163776312252236310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/9163776312252236310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/9163776312252236310'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2008/10/pattern-matching-with-escape-clause.html' title='Pattern Matching with the ESCAPE Clause'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-6644091965394433691</id><published>2008-10-20T18:16:00.002+05:30</published><updated>2009-03-31T21:25:43.079+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='script to find out index usage'/><title type='text'>Script to find out index usages</title><summary type='text'>Lots of sripts available for checking index usage, but below script also list down the index key columns and included columns.We just have change the database and table name in below script.declare @databaseName nvarchar(256)declare @tableName nvarchar(256)select @databaseName = 'test'select @tableName = 'script_test'select Object_name(sys.dm_db_index_usage_stats.object_id) as tableName,</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/6644091965394433691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=6644091965394433691' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/6644091965394433691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/6644091965394433691'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2008/10/script-to-find-out-index-usages.html' title='Script to find out index usages'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-4788742398579887118</id><published>2008-10-03T17:12:00.001+05:30</published><updated>2009-03-31T21:24:59.357+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='difference between union and union all'/><title type='text'>Another difference between union and union all</title><summary type='text'>Another difference between union and union allAs we know the difference between union and union all is that, if not specify ALL keyword duplicate rows are removed.Today while writing a script, I found another interesting difference regarding the order of returned result set. Union use to change the order of result set based on first column in result set in ascending order, while union all does </summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/4788742398579887118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=4788742398579887118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/4788742398579887118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/4788742398579887118'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2008/10/another-difference-between-union-and.html' title='Another difference between union and union all'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-3348734503230384667</id><published>2008-09-16T11:37:00.000+05:30</published><updated>2009-01-29T10:54:32.675+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Option Strict On disallows'/><title type='text'>"Option Strict On disallows late binding" in SSIS Script task</title><summary type='text'>"Option Strict" is a compiler option that's there to help you from introducing logic errors.We can set this option to off at the beggining on the script task to remove such error.for example,Option Strict OffImports SystemImports System.DataImports System.MathImports Microsoft.SqlServer.Dts.Runtime</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/3348734503230384667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=3348734503230384667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/3348734503230384667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/3348734503230384667'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2008/09/option-strict-on-disallows-late-binding.html' title='&quot;Option Strict On disallows late binding&quot; in SSIS Script task'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8929673704186254954.post-1944716995941231181</id><published>2008-09-04T16:38:00.000+05:30</published><updated>2008-09-04T16:40:21.235+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Arithmetic overflow'/><title type='text'>Arithmetic overflow error converting expression to data type int</title><summary type='text'>Sometimes we get error "Arithmetic overflow" while working with bigger vlauesWhen you execute query: “select 99999*99999”, it will generate the same error “Arithmetic overflow error converting expression to data type int”. This is occurring because SQL server tries to calculate result in terms if INT, but INT can store max value of 2,147,483,647.But when you execute query: “select convert(bigint,</summary><link rel='replies' type='application/atom+xml' href='http://discretesql.blogspot.com/feeds/1944716995941231181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8929673704186254954&amp;postID=1944716995941231181' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/1944716995941231181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8929673704186254954/posts/default/1944716995941231181'/><link rel='alternate' type='text/html' href='http://discretesql.blogspot.com/2008/09/arithmetic-overflow-error-converting.html' title='Arithmetic overflow error converting expression to data type int'/><author><name>Chintak</name><uri>http://www.blogger.com/profile/17556337819366435284</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
