<?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-231653091796010968</id><updated>2011-11-28T05:46:43.702+05:00</updated><category term='Database Users'/><category term='Distributed Transaction Coordinator'/><category term='Transact Sql'/><category term='Primary Data file'/><category term='Encryption - Decryption'/><category term='Dynamic Management View'/><category term='Alter Database'/><category term='Dynamic Management Function'/><category term='Object Level Information'/><category term='Replication'/><category term='Moving Database files'/><category term='SQL Server Logins'/><category term='Partitions'/><category term='Secondary Data file'/><category term='Log File Space'/><category term='Security'/><category term='Data File Space'/><category term='Tempdb Space usage'/><category term='System Tables'/><category term='Maintenance'/><category term='Database Space'/><category term='Log file'/><category term='SQL Server Sessions'/><category term='Extened Stored Procedure'/><category term='System Stored Procedures'/><category term='General'/><category term='MS DTC'/><category term='Server Level Information'/><category term='System Functions'/><category term='Joins'/><category term='T-SQL Running Requests'/><category term='String Manipulation'/><category term='Indexes'/><category term='Linked Server'/><category term='Free Downloads'/><category term='Database Level Information'/><category term='News'/><title type='text'>MS SQL Server Solutions</title><subtitle type='html'>master your setup, master yourself.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-6101245573293469836</id><published>2011-08-07T18:10:00.001+05:00</published><updated>2011-08-07T18:13:13.526+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Playing with NULL</title><summary type='text'>
A NULL values is an unknown value, different from a zero or an empty value.There are few points that must be remembered when you are dealing with NULL values:1.       No two NULL values are equal.2.       Comparison between two NULL values or between one NULL and any other values results in an UNKNOWN value.3.       Logical (e.g. AND, OR etc.) and Comparison (e.g. =, &gt;, &lt; etc.) Operators can </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/6101245573293469836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=6101245573293469836&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6101245573293469836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6101245573293469836'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2011/08/playing-with-null.html' title='Playing with NULL'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-xJJf4Ncws9Q/Tj6OcZKRlSI/AAAAAAAAABY/rnopGujX_yk/s72-c/Playing+with+NULL.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-5178178910374463265</id><published>2010-12-15T19:13:00.001+05:00</published><updated>2010-12-15T19:15:08.105+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='News'/><title type='text'>Microsoft® SQL Server® code-named 'Denali' - Community Technology Preview 1 (CTP1)</title><summary type='text'>OverviewSQL Server code-named  'Denali' helps empowers organizations to be more agile in today’s competitive  market. Customers will more efficiently deliver mission-critical solutions  through a highly scalable and available platform. Industry-leading tools help  developers quickly build innovative applications while data integration and  management tools help deliver credible data reliably to </summary><link rel='related' href='http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6a04f16f-f6be-4f92-9c92-f7e5677d91f9' title='Microsoft® SQL Server® code-named &apos;Denali&apos; - Community Technology Preview 1 (CTP1)'/><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/5178178910374463265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=5178178910374463265&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5178178910374463265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5178178910374463265'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/12/microsoft-sql-server-code-named-denali.html' title='Microsoft® SQL Server® code-named &apos;Denali&apos; - Community Technology Preview 1 (CTP1)'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-6261658057452775042</id><published>2010-12-14T23:09:00.001+05:00</published><updated>2010-12-14T23:11:59.222+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Monitoring Transactional Replication Status - SQL Server 2005, 2008, 2008 R2</title><summary type='text'>USE DISTRIBUTIONGOSELECT       s.agent_id      ,a.id      ,s.article_id      ,a.subscriber_id      ,ar.Source_owner      ,ar.Source_object      ,ar.destination_owner      ,ar.destination_object      ,s.undelivcmdsindistdb      ,a.publisher_db      ,a.subscriber_db      ,a.publicationFROM distribution.dbo.msdistribution_status s with (nolock) INNER JOIN (SELECT * FROM msdistribution_agents with (</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/6261658057452775042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=6261658057452775042&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6261658057452775042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6261658057452775042'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/12/monitoring-replication-status-sql.html' title='Monitoring Transactional Replication Status - SQL Server 2005, 2008, 2008 R2'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-130462958312919052</id><published>2010-11-01T21:54:00.003+05:00</published><updated>2010-11-01T22:19:32.899+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Server Level Information'/><title type='text'>DDL EVENTS List - SQL Server 2008/R2</title><summary type='text'>Below are the all events with their hierarchy and scope that you can use to implement DDL triggers at both Server or Database Level.
You can create trigger to fire on all events defined under a group, then you can create trigger for that particular group like "DDL_TABLE_EVENTS", this trigger will fire on all three sub-events defined under this group; these are CREATE_TABLE, ALTER_TABLE and </summary><link rel='related' href='http://technet.microsoft.com/en-us/library/bb510452.aspx' title='DDL EVENTS List - SQL Server 2008/R2'/><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/130462958312919052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=130462958312919052&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/130462958312919052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/130462958312919052'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/11/ddl-events-sql-server-2008r2.html' title='DDL EVENTS List - SQL Server 2008/R2'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TM7yVQVd2DI/AAAAAAAAABM/i6bgXodOsR4/s72-c/Bb510452.db_EventGroups_Event_Notes_ktm(en-us,SQL.105).gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-2250882938674162022</id><published>2010-10-29T18:48:00.000+05:00</published><updated>2010-10-29T18:51:29.791+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='Server Level Information'/><title type='text'>Script: view information of currently running SQL Server Jobs</title><summary type='text'>Below script returns five (5) columns result set as output. You can further enhance this query to accommodate your requirement.
Job_Name: This is job’s registered name on the server’s instance.
Last_Executed_Step_ID: This is the ID of the last executed step in the job. E.g. if a job has 4 steps, and currently it is running 3rd step, so last executed step will be 2 and it will be populated with 2 </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/2250882938674162022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=2250882938674162022&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2250882938674162022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2250882938674162022'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/10/script-view-information-of-currently.html' title='Script: view information of currently running SQL Server Jobs'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-1692336786905993525</id><published>2010-10-25T22:49:00.000+05:00</published><updated>2010-10-25T22:49:44.470+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Compound Operators - SQL SERVER 2008/R2</title><summary type='text'>You are aware about arithmetic, bitwise and assignment operators, don’t worry if you are not, see below you will get an idea about them.
Arithmetic Operators: There are 5 arithmetic operators that are Plus (+), Minus (-), Divide (/), Multiply (*) and Modulo (%)
Bitwise Operators: There are three bitwise operators that are Bitwise AND (&amp;), Bitwise OR (|) and Bitwise Exclusive OR (^).
Assignment </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/1692336786905993525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=1692336786905993525&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1692336786905993525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1692336786905993525'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/10/compound-operators-sql-server-2008r2.html' title='Compound Operators - SQL SERVER 2008/R2'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-8474618569611147161</id><published>2010-10-20T00:52:00.000+05:00</published><updated>2010-10-20T01:36:54.703+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Enhanced VALUES Clause (ROW Constructor) – SQL SERVER 2008 / R2</title><summary type='text'> Old Style:If you see at previous versions of SQL Server (Older than 2008), you were able to insert only a single row by using values clause.
INSERT INTO dbo.mytable(id, val) VALUES(1, 'First Value');
Or
If you were inserting through SELECT statement, you were able to specify a single row values or by combining multiple rows by using UNION/UION ALL operator.
INSERT INTO dbo.mytable(id, val)SELECT</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/8474618569611147161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=8474618569611147161&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8474618569611147161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8474618569611147161'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/10/enhanced-values-clause-sql-server-2008.html' title='Enhanced VALUES Clause (ROW Constructor) – SQL SERVER 2008 / R2'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-22302615971352322</id><published>2010-10-15T18:44:00.001+05:00</published><updated>2011-08-07T12:06:03.060+05:00</updated><title type='text'>SQL Server 2008 SP2 Release (download link)</title><summary type='text'>What's New:
15K partitioning Improvement. Introduced support for a maximum of 15,000 partitions in tables and indexes in Microsoft SQL Server 2008 Service Pack 2 in the Enterprise, Developer and Evaluation Editions.

Reporting Services in SharePoint Integrated Mode. SQL Server 2008 SP2 provides updates for Reporting Services integration with SharePoint products. SQL Server 2008 SP2 report servers</summary><link rel='related' href='http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8fbfc1de-d25e-4790-88b5-7dda1f1d4e17&amp;displaylang=en' title='SQL Server 2008 SP2 Release (download link)'/><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/22302615971352322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=22302615971352322&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/22302615971352322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/22302615971352322'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/10/sql-server-2008-r2-sp2-release.html' title='SQL Server 2008 SP2 Release (download link)'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-4372143808486108054</id><published>2010-10-11T18:44:00.000+05:00</published><updated>2010-10-11T18:54:17.102+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving Database files'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><title type='text'>Moving User Database Files in SQL Server 2000</title><summary type='text'>0. Take Full backup before moving files   1. Set database in single user modeuse mastergo  exec sp_dboption testdb2000,'single user','true'go  2. Get path of database files  Exec sp_helpdb testdb2000go     3. Save location of all files   C:\Program Files\Microsoft SQL Server\MSSQL$INS2000\data\TestDB2000_Data.MDFC:\Program Files\Microsoft SQL Server\MSSQL$INS2000\data\TestDB2000_Log.LDF</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/4372143808486108054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=4372143808486108054&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4372143808486108054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4372143808486108054'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2010/10/moving-user-database-files-in-sql.html' title='Moving User Database Files in SQL Server 2000'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3069125004748548937</id><published>2009-04-25T02:03:00.000+06:00</published><updated>2009-05-01T15:23:57.078+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Free Downloads'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Logins'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Users'/><title type='text'>Utility to see Logins and users on an instance</title><summary type='text'>Use below link to download it:http://cid-2512e6af14d229c4.skydrive.live.com/self.aspx/SQL%20Server%20Utilities/Instance%20Users%20and%20Logins%20Details.zipDescription: You can see available logins on an instance and users list in a databases, their fixed roles at server and database level, categorized as server login and database user, Object level permission details.Pre-requistes:.Net Framwork </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3069125004748548937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3069125004748548937&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3069125004748548937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3069125004748548937'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2009/04/utility-to-see-logins-and-users-on.html' title='Utility to see Logins and users on an instance'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3971701124865476928</id><published>2009-04-15T01:13:00.001+06:00</published><updated>2009-05-01T15:25:21.077+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Free Downloads'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Sessions'/><category scheme='http://www.blogger.com/atom/ns#' term='T-SQL Running Requests'/><title type='text'>List of Running Sessions and their Requests on an Instance</title><summary type='text'>Download this free utility by clicking below link:http://cid-2512e6af14d229c4.skydrive.live.com/self.aspx/SQL%20Server%20Utilities/Running%20Requests%20on%20an%20Instance.zipPre-requists:.Net Framwork 2.0 or +Only for SQL Server 2005+Developed using VB .NetDescription:This is an executable file that is available in zip formate at above link.You can view all logins sessions and their running </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3971701124865476928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3971701124865476928&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3971701124865476928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3971701124865476928'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2009/04/list-of-running-sessions-and-their.html' title='List of Running Sessions and their Requests on an Instance'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-273291179732795434</id><published>2009-02-18T16:56:00.000+05:00</published><updated>2009-05-01T15:30:01.389+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance'/><category scheme='http://www.blogger.com/atom/ns#' term='Secondary Data file'/><category scheme='http://www.blogger.com/atom/ns#' term='Moving Database files'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Primary Data file'/><category scheme='http://www.blogger.com/atom/ns#' term='Log file'/><category scheme='http://www.blogger.com/atom/ns#' term='Server Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Alter Database'/><title type='text'>Moving database files</title><summary type='text'>We have three kinds of database files: log files (*.ldf), primary data files (*.mdf) and secondary data files (*.ndf).Primary data file is the starting point for a database and points to all other files in it. Each database has one primary data file. There can be 0 or &gt;0 secondary data files in a database to make up data files other than primary data file. Log files hold all log information that </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/273291179732795434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=273291179732795434&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/273291179732795434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/273291179732795434'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2009/02/moving-database-files.html' title='Moving database files'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-1141661389410219867</id><published>2009-02-10T13:43:00.000+05:00</published><updated>2009-05-01T15:33:17.035+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS DTC'/><category scheme='http://www.blogger.com/atom/ns#' term='Distributed Transaction Coordinator'/><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>Preliminary checks for MS DTC</title><summary type='text'>To dig further to evaluate MS DTC error, check below things is in place.You are able to ping both server from each other. If not then define them in their host files and try to ping them again, till it resolves.All MS DTC configurations should be same on both servers.a) NETWORK DTC Accessb) Client and Administration (Allow remote clients, Allow remote administration)c) Transaction Communication </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/1141661389410219867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=1141661389410219867&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1141661389410219867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1141661389410219867'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2009/02/preliminary-checks-for-ms-dtc.html' title='Preliminary checks for MS DTC'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-2524624818619864649</id><published>2009-01-14T02:52:00.000+05:00</published><updated>2009-05-01T15:38:52.831+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data File Space'/><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='System Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='Log File Space'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Space'/><title type='text'>Database &amp; Disk space analysis</title><summary type='text'>BEGIN CREATE TABLE #LOGSPACE(DBNAME VARCHAR(100),LOGSIZE DECIMAL(30,10),LOGSPACE DECIMAL(30,10),STATUS INT)CREATE TABLE #DRIVESPACE(DRIVE VARCHAR(2),DRIVESPACE BIGINT)INSERT INTO #LOGSPACEEXEC ('DBCC SQLPERF(LOGSPACE)')INSERT INTO #DRIVESPACEEXEC ('MASTER.SYS.XP_FIXEDDRIVES') SELECT F.TYPE_DESC DBFILES,LEFT(F.PHYSICAL_NAME,1) DRIVE,F.STATE_DESC DBSTATE,((F.[SIZE]*8)/1024.00)/1024.00 DBCURRENTSIZE</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/2524624818619864649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=2524624818619864649&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2524624818619864649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2524624818619864649'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2009/01/database-disk-space-analysis.html' title='Database &amp; Disk space analysis'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-4762807029587671521</id><published>2009-01-14T02:37:00.000+05:00</published><updated>2009-05-01T15:35:22.104+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Tempdb Space usage'/><category scheme='http://www.blogger.com/atom/ns#' term='Object Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='Dynamic Management View'/><title type='text'>Space used in tempdb by each Session</title><summary type='text'>SELECT DB_NAME(DATABASE_ID) DBNAME,SP.SESSION_ID,S.LOGIN_NAME,S.HOST_NAME,(SUM(USER_OBJECTS_ALLOC_PAGE_COUNT)*8)/1024.00 ALLOCATED_SPACE_MB,(SUM(USER_OBJECTS_DEALLOC_PAGE_COUNT)*8)/1024.00 DEALLOCATED_SPACE_MBFROM TEMPDB.SYS.DM_DB_SESSION_SPACE_USAGE SPINNER JOIN TEMPDB.SYS.DM_EXEC_SESSIONS &lt;?xml:namespace prefix = st1 /&gt;S ON S.SESSION_ID = SP.SESSION_ID AND S.HOST_NAME IS NOT NULLGROUP BY </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/4762807029587671521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=4762807029587671521&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4762807029587671521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4762807029587671521'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2009/01/space-used-in-tempdb-by-each-session.html' title='Space used in tempdb by each Session'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3086499579355053460</id><published>2008-12-16T15:46:00.000+05:00</published><updated>2008-12-16T15:48:41.959+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Extened Stored Procedure'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Reading Sql Server and Sql Agent log files using T-SQL</title><summary type='text'>xp_readerrrorlog  It is an undocumented extended stored procedure with at least 7 parameters (default null), that calls a dll to show results.  Parameters details as:    Value of error log file you      want to read: 0 = current, 1 = Archive #1,      2 = Archive #2, etc...  Log file type: 1 or NULL = error log, 2 = SQL Agent log  Search string 1: String one you want to search      for  Search </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3086499579355053460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3086499579355053460&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3086499579355053460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3086499579355053460'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/12/reading-sql-server-and-sql-agent-log.html' title='Reading Sql Server and Sql Agent log files using T-SQL'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-2752195937001927374</id><published>2008-12-04T00:47:00.000+05:00</published><updated>2008-12-04T00:56:41.100+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Server Level Information'/><title type='text'>Script to get Login's Server and Database level permissions</title><summary type='text'>We have two levels for login  Server LevelDatabase Level  We can further divide them into Fixed roles and Permissions for a single login as:   Server Level PermissionsServer Level Fixed RolesDatabase Level PermissionsDatabase Level Fixed Roles  I developed a script to get such details in current environment or on current instance for all databases. Let me know if you find any issue in it.below </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/2752195937001927374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=2752195937001927374&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2752195937001927374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2752195937001927374'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/12/script-to-get-logins-server-and.html' title='Script to get Login&apos;s Server and Database level permissions'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-8074016703430175834</id><published>2008-11-02T15:40:00.000+05:00</published><updated>2008-11-02T15:47:12.327+05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Encryption - Decryption'/><title type='text'>Encryption by using Pass Phrase Keys (independent from database or database keys)</title><summary type='text'>It is not necessary to create and use a key persisted in the database for encryption. If you are willing to manage the key yourself—and take responsibility for keeping the secret secret—use the EncryptByPassPhrase and DecryptByPassPhrase functions. These functions require only a pass phrase as the first parameter and either clear text or ciphertext as the second, and they do not let you select </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/8074016703430175834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=8074016703430175834&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8074016703430175834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8074016703430175834'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/11/encryption-by-using-pass-phrase-keys.html' title='Encryption by using Pass Phrase Keys (independent from database or database keys)'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-4435984862332192344</id><published>2008-10-29T05:49:00.000+06:00</published><updated>2008-10-29T06:06:20.826+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Partitions'/><title type='text'>INSERTION and DELETION Using Partition</title><summary type='text'>/*Steps to follow1. Add filegroup2. Create Partition Functions3. Create Partition Scheme4. Create Staging, Main and Dummy table with same structure and indexes on same parition scheme5. Create Procedures to add, emptry, move and merge parition6. Create Main Procedure to execute the above implemenations7. Test Case execution*/      --- * Add Filegroup in the current DatabaseALTER DATABASE TEST ADD</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/4435984862332192344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=4435984862332192344&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4435984862332192344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4435984862332192344'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/10/insertion-and-deletion-using-partition.html' title='INSERTION and DELETION Using Partition'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3612578203062440993</id><published>2008-10-29T03:29:00.000+06:00</published><updated>2008-10-29T03:37:52.506+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Partitions'/><title type='text'>Create Partition Function and Partition Scheme</title><summary type='text'>Below partition functions and scheme created to use data as argument or base. First of all you need to add a file group in your current database and then you have to create this partition function and scheme on the base of partition function.          --- * Add Filegroup in the current DatabaseALTER DATABASE TEST ADD FILEGROUP FG1        -- * Create Partition FunctionCREATE PARTITION FUNCTION </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3612578203062440993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3612578203062440993&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3612578203062440993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3612578203062440993'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/10/create-partition-function-and-partition.html' title='Create Partition Function and Partition Scheme'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-7940562220396235289</id><published>2008-10-19T04:06:00.000+06:00</published><updated>2008-10-19T04:14:10.708+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='System Functions'/><title type='text'>Current Identity value, Identity usage and other identity information</title><summary type='text'>SELECTQUOTENAME(SCHEMA_NAME(T.SCHEMA_ID)) + '.' +  QUOTENAME(T.NAME) AS TABLENAME,C.NAME AS COLUMNNAME,CASE C.SYSTEM_TYPE_ID  WHEN 127 THEN 'BIGINT' WHEN 56 THEN 'INT'WHEN 52 THEN 'SMALLINT' WHEN 48 THEN 'TINYINT' END AS 'DATATYPE',            IDENT_CURRENT(SCHEMA_NAME(T.SCHEMA_ID)  + '.' + T.NAME) AS CURRENTIDENTITYVALUE,IDENT_INCR(SCHEMA_NAME(T.SCHEMA_ID)  + '.' + T.NAME) AS IDENTITYINCREMENT,</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/7940562220396235289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=7940562220396235289&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/7940562220396235289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/7940562220396235289'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/10/current-identity-value-identity-usage.html' title='Current Identity value, Identity usage and other identity information'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-8926300433625847207</id><published>2008-08-30T20:38:00.000+06:00</published><updated>2008-08-30T20:45:23.955+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>How to use Output Clause?</title><summary type='text'>It returns information from each row affected by any DML operation [INSERT/UPDATE/DELETE], it means you can use it with only DML statements. These results can be retuned to the processing application as confirmation message or archiving purpose, and they can be inserted into a physical or temporary or memory table.     You can get all columns [*] or you can specify the columns to be returned by </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/8926300433625847207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=8926300433625847207&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8926300433625847207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8926300433625847207'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/how-to-use-output-clause.html' title='How to use Output Clause?'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-4812826720288840823</id><published>2008-08-29T05:44:00.000+06:00</published><updated>2008-08-29T05:47:45.994+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication'/><title type='text'>Programming Replication Distribution Agent Executable</title><summary type='text'>Distribution replication agent can be controlled by programmatically described below,You can copy and paste below code in a batch file and then execute that batch file after replacing the required information with your actual parameters. It will execute the Distribution agent.                  Required Parameters:Distributor: Distributor instance nameDistributorSecurityMode: 0 for SQL Server </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/4812826720288840823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=4812826720288840823&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4812826720288840823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4812826720288840823'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/programming-replication-distribution.html' title='Programming Replication Distribution Agent Executable'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3817615120437104785</id><published>2008-08-29T04:56:00.000+06:00</published><updated>2008-08-29T05:00:17.513+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication'/><title type='text'>Programming Replication Snapshot Agent Executable</title><summary type='text'>Snapshot replication agent can be controlled by programmatically described below,You can copy and paste below code in a batch file and then execute that batch file after replacing the required information with your actual parameters. It will execute the snapshot agent.                Required Parameters:Publisher: instance namePublicationDB: publisher database namePublication: publicaion </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3817615120437104785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3817615120437104785&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3817615120437104785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3817615120437104785'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/programming-replication-snapshot-agent.html' title='Programming Replication Snapshot Agent Executable'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-7214267311868115317</id><published>2008-08-19T03:54:00.000+06:00</published><updated>2008-08-19T04:28:01.163+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Functions'/><title type='text'>Ranking rows of a result set...</title><summary type='text'>Rows can be ranked in a result set [Selection from one table or multiple tables by using joins] by using Rank() function. If two or more rows tie for a rank, tied rows will get the same rank.Example:Two temporary tables created, and populated with test data, two queries created one for single table selection and second query to show the results from two tables by using joins.           CREATE </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/7214267311868115317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=7214267311868115317&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/7214267311868115317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/7214267311868115317'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/ranking-rows-of-result-set.html' title='Ranking rows of a result set...'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-7331416063483897821</id><published>2008-08-16T20:11:00.000+06:00</published><updated>2008-08-16T20:30:19.041+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Joins'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>comparing current row with previos and next row in a table</title><summary type='text'>you must define identity column or there should be an integer column to keep the sequence of the rows, or you can import the data into a temporary table with an additional identity column.here is the script:       Create Table #Temp(I_Col int identity(1,1) ,val1 int)             Insert into #Temp values(10)Insert into #Temp values(25)Insert into #Temp values(67)Insert into #Temp values(98)Insert </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/7331416063483897821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=7331416063483897821&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/7331416063483897821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/7331416063483897821'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/comparing-current-row-with-previos-and.html' title='comparing current row with previos and next row in a table'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-8285670447595048332</id><published>2008-08-12T02:58:00.000+06:00</published><updated>2008-08-12T03:02:52.055+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='Indexes'/><title type='text'>how to view association among File Groups, System Logical and Physical Files and Tables</title><summary type='text'>You can use this code to view file group, logical filename and physical filename associated to a table. It can be beneficial if you have large number of database files and want to see objects (tables) in a file or to view the file associated to a table.        To see whole list of tables in each data fileA table can have only one value at a time in index table (0 or 1), 1 for clustered index and </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/8285670447595048332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=8285670447595048332&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8285670447595048332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8285670447595048332'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/how-to-view-association-among-file.html' title='how to view association among File Groups, System Logical and Physical Files and Tables'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-8168605263785611775</id><published>2008-08-09T17:12:00.000+06:00</published><updated>2008-08-09T17:23:48.207+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Getting All Disks Free Space information on an instance</title><summary type='text'>you must define linked servers on the instance executing this code if it has to calculate the free disk space information from remote servers.BEGINSET NOCOUNT ONDECLARE @TOTALCOUNT INT            ,@I INT            ,@SERVER_NAME NVARCHAR(100)            ,@DESCR NVARCHAR(100)            ,@STMT NVARCHAR(200)            /* Temporary Table holding Server names */CREATE TABLE #SERVERS(PID INT IDENTITY</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/8168605263785611775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=8168605263785611775&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8168605263785611775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/8168605263785611775'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/getting-all-disks-free-space.html' title='Getting All Disks Free Space information on an instance'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-5054517656583034510</id><published>2008-08-07T22:33:00.000+06:00</published><updated>2008-08-07T22:37:51.755+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>How to get list of all stored procedures?</title><summary type='text'>You can use following stored procedure with four optional input parameters to get a list of all stored procedures in the current environment.          EXEC SP_STORED_PROCEDURES @sp_name = 'procedure name'                         , @sp_owner = 'schema name'                         , @sp_qualifier = 'database name'                         , @fUsePattern =  'fUsePattern'  Note:   All      parameters</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/5054517656583034510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=5054517656583034510&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5054517656583034510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5054517656583034510'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/how-to-get-list-of-all-stored.html' title='How to get list of all stored procedures?'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3541010221173944353</id><published>2008-08-07T13:21:00.000+06:00</published><updated>2008-08-07T13:25:14.364+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='System Tables'/><title type='text'>Moving database files to another new location</title><summary type='text'>You can move database data and log files to any other location by following the below steps, these come under Planned Relocation.  Check if there is any user connected to DB by      executing the below query.         SELECT SPID,LOGINAME,HOSTNAME,PROGRAM_NAME FROM SYS.SYSPROCESSES WHERE DBID=DB_ID('database_name')         If there is any replication agent [Log Reader Agent] is running, stop      </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3541010221173944353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3541010221173944353&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3541010221173944353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3541010221173944353'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/moving-database-files-to-another-new.html' title='Moving database files to another new location'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-856577182687832875</id><published>2008-08-06T23:29:00.000+06:00</published><updated>2008-08-07T23:56:47.728+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Object Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='Indexes'/><title type='text'>Table's rows count without using COUNT() function</title><summary type='text'>You can get table's total number of rows as: SELECT SUM(ROWS) AS Total_Rows FROM SYS.SYSINDEXESWHERE ID=OBJECT_ID('Table1')AND INDID IN (0,1)OBJECT_ID('Table1'):This function will return the object id for table "Table1" or any other specified table.INDID:It can be 0 for heap and 1 for clustered index, and it will have only one value at a time 0 or 1, greater than 1 values are for non-clustered </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/856577182687832875/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=856577182687832875&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/856577182687832875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/856577182687832875'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/08/tables-rows-count-without-using-count.html' title='Table&apos;s rows count without using COUNT() function'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-1499402806949779383</id><published>2008-07-26T09:54:00.000+06:00</published><updated>2008-09-15T04:29:24.016+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dynamic Management Function'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Object Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Indexes'/><title type='text'>Determining Index fragmentation / when to rebuild / when to reorganize</title><summary type='text'>Index fragmentation:When data is inserted, updated or deleted in a table, if clustered or non-clustered indexes exist on that table, they must be maintained to reflect the changes. The maintenance of these indexes eventually will cause the indexes less efficient. This inefficiency leads to index fragmentation.&lt;?xml:namespace prefix = o /&gt;We have two types of index fragmentation:Internal </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/1499402806949779383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=1499402806949779383&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1499402806949779383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1499402806949779383'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/determining-index-fragmentation-when-to.html' title='Determining Index fragmentation / when to rebuild / when to reorganize'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-2023948353897576904</id><published>2008-07-25T23:47:00.000+06:00</published><updated>2008-07-26T00:13:54.542+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Finding total / available / used space by transactional log file</title><summary type='text'>DBCC SQLPERF(LOGSPACE)    It provides statistics that how much transactional log space was used by each database in the current server. So, you can monitor the amount of space used and can decide when to take backup or to truncate the transactional log file.    Its result set consists of:        Database Name – Name of the databaseLog Size (MB) – Actual amount of log file size, it is less than </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/2023948353897576904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=2023948353897576904&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2023948353897576904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/2023948353897576904'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/finding-total-available-used-space-by.html' title='Finding total / available / used space by transactional log file'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-9204847199095314006</id><published>2008-07-25T05:42:00.000+06:00</published><updated>2008-07-25T06:08:04.609+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dynamic Management View'/><category scheme='http://www.blogger.com/atom/ns#' term='Indexes'/><title type='text'>Determining indexes utilization Or unused indexes</title><summary type='text'>You can use following DMV to check index utilization or to see unused indexes.  SYS.DM_DB_INDEX_USAGE_STATS    By determining the stats, you can see what indexes are mostly used by the queries and what indexes are unused and overhead for the system from maintenance point of view. These stats/counters will be initialized to empty whenever SQL Server restarts, database is de-attached, or database </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/9204847199095314006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=9204847199095314006&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/9204847199095314006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/9204847199095314006'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/determining-indexes-utilization-or.html' title='Determining indexes utilization Or unused indexes'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-5968817317132608018</id><published>2008-07-24T06:56:00.000+06:00</published><updated>2008-07-24T08:16:49.398+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Object Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Change the name of a Database, Table or Column</title><summary type='text'>You can use the following procedure to change database, table, index or column name.SP_RENAME 'Object_Old_Name','Object_New_Name','Object_Type'Object Type can be DATABASE, OBJECT, INDEX, COLUMN and USERDATATYPE.To Change Database name:It will change the database name from DB1 to DB1_New.EXEC SP_RENAME 'DB1','DB1_New','DATABASE'To change Table name:It will update the table name from Table1 to </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/5968817317132608018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=5968817317132608018&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5968817317132608018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5968817317132608018'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/change-name-of-database-table-or-column.html' title='Change the name of a Database, Table or Column'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-6782706921399770495</id><published>2008-07-23T22:45:00.000+06:00</published><updated>2008-07-23T22:55:55.549+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='Server Level Information'/><title type='text'>Scalar Configuration Functions</title><summary type='text'>All configuration functions are nondeterministic. This means these functions do  not always return the same results every time they are called, even with the  same set of input values.The following scalar functions return information about current configuration  option settings,@@DATEFIRSTReturns the current value, for the session, of SET DATEFIRST.e.g. SELECT @@DATEFIRSTyou can change first day </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/6782706921399770495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=6782706921399770495&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6782706921399770495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6782706921399770495'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/scalar-configuration-functions.html' title='Scalar Configuration Functions'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-4686499485046550243</id><published>2008-07-23T21:04:00.000+06:00</published><updated>2008-07-23T21:18:52.790+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>Searching a Table in all databases on Current Server</title><summary type='text'>You can use Information_Schema view Tables to see the table list in the current DB as:Select * From DB1.Information_Schema.Tableswe will use the above Sql query with the following stored procedure to search a table.Procedure: dbo.sp_MSforeachdbDescription: This procedure will execute the attached string as a command against every database on the server. Any question mark(?) , within the string </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/4686499485046550243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=4686499485046550243&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4686499485046550243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4686499485046550243'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/searching-table-in-all-databases-on.html' title='Searching a Table in all databases on Current Server'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-1999563265675736207</id><published>2008-07-22T20:07:00.000+06:00</published><updated>2008-07-23T21:25:14.120+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='Dynamic Management View'/><title type='text'>Calcualting estimated time for any running SQL command</title><summary type='text'>you can use the following SQL statement to calculate estimated time for any sql command. This script is applicable for Sql Server 2005 and above.1) you can get the command label by executing below procedures or sql statement, that you will use in estimated time calculation query.Exec sp_WhoOrExec sp_Who2OrSelect * From sys.sysprocessesOrSelect * From sys.dm_exec_requests2) script for estimated </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/1999563265675736207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=1999563265675736207&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1999563265675736207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/1999563265675736207'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/calcualting-estimated-time-for-any-sql.html' title='Calcualting estimated time for any running SQL command'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-5039704556078387760</id><published>2008-07-22T19:48:00.000+06:00</published><updated>2008-07-22T20:02:16.415+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Dynamic Management View'/><title type='text'>How to get Sql text without using dbcc inputbuffer</title><summary type='text'>You can use a dynamic management view for this purpose, details given below:Dynamic Management View:sys.dm_exec_sql_text(sql_handle)sql_handle SQL handle of the text to be looked up.It retruns:dbid - Database ID, you can get database name by using DB_Name(dbid) function.Objectid - Object ID, you can get Object name by using Object_Name(objectid) funciton.number - store procedures number if </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/5039704556078387760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=5039704556078387760&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5039704556078387760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5039704556078387760'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/how-to-get-sql-text-without-using-dbcc.html' title='How to get Sql text without using dbcc inputbuffer'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-5071683393555694833</id><published>2008-07-22T19:14:00.000+06:00</published><updated>2008-07-22T20:28:30.733+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><category scheme='http://www.blogger.com/atom/ns#' term='System Functions'/><category scheme='http://www.blogger.com/atom/ns#' term='Server Level Information'/><title type='text'>List of Permission granted to caller [Calling User]</title><summary type='text'>Following statements returns the permission details for the user who is executing the statement.-- List of Permission at Server LevelSELECT * FROM fn_my_permissions(NULL, 'SERVER')-- List of Permission at Database LevelSELECT * FROM fn_my_permissions('DB1', 'DATABASE')-- List of Permission at Object LevelSELECT * FROM fn_my_permissions('Object1', 'OBJECT')ORDER BY subentity_name, </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/5071683393555694833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=5071683393555694833&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5071683393555694833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5071683393555694833'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/list-of-permission-granted-to-caller.html' title='List of Permission granted to caller [Calling User]'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-6845478067731564078</id><published>2008-07-22T18:18:00.000+06:00</published><updated>2008-07-22T18:21:57.758+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Linked Server'/><title type='text'>Test the connection to a Linked Server</title><summary type='text'>Procedure: SP_TESTLINKEDSERVERSyntax:sp_testlinkedserver @servername = servername@Servername: Linked servernameNote: Caller must have appropriate login mapping.e.g.Exec sp_testlinkedserver SQL1</summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/6845478067731564078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=6845478067731564078&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6845478067731564078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/6845478067731564078'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/test-connection-to-linked-server.html' title='Test the connection to a Linked Server'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-5747491066017543206</id><published>2008-07-22T17:58:00.000+06:00</published><updated>2008-07-22T18:07:56.746+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Linked Server'/><title type='text'>Get List of Linked Servers on Curent/Local Server</title><summary type='text'>Procedure: SP_LINKEDSERVERSDescription: Returns the list of linked servers defined in the local server.It returns:Column name - Description SRV_NAME - Name of the linked server.SRV_PROVIDERNAME - Friendly name of the OLE DB provider managing access to the specified linked server.SRV_PRODUCT - Product name of the linked server.SRV_DATASOURCE - OLE DB data source property corresponding to the </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/5747491066017543206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=5747491066017543206&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5747491066017543206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/5747491066017543206'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/get-list-of-linked-servers-on.html' title='Get List of Linked Servers on Curent/Local Server'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-3265049042158381533</id><published>2008-07-22T16:10:00.000+06:00</published><updated>2008-07-22T16:38:26.800+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='System Stored Procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Level Information'/><title type='text'>Database Level Principals List : System Stored Procedure</title><summary type='text'>Procedure Name: sp_helpuserDefinition: Reports information about database-level principals in the current database.Syntax: sp_helpuser [ [ @name_in_db = ] 'security_account' ][ @name_in_db = ] 'security_account' Is the name of database user or database role in the current database.  security_account must exist in the current database.  security_account is sysname, with a default of NULL. If  </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/3265049042158381533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=3265049042158381533&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3265049042158381533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/3265049042158381533'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/database-level-principals-list-system.html' title='Database Level Principals List : System Stored Procedure'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-231653091796010968.post-4870443712091763691</id><published>2008-07-22T15:51:00.000+06:00</published><updated>2008-07-22T16:41:14.818+06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='String Manipulation'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact Sql'/><title type='text'>case sensitive selection by using Collation Clause</title><summary type='text'>1) Create temporary table to insert values to check the implemenationCreate Table #temp( ID int identity(1,1)  , val1 varchar(50))2) Values insertionInsert into #temp values('abc')Insert into #temp values('ABC')Insert into #temp values('aBc')3) Selection by using collation functionselect * from #temp where val1 like 'abc%'collate SQL_Latin1_General_CP1_CS_AS4) above collation is only for general </summary><link rel='replies' type='application/atom+xml' href='http://mssqlsolutions.blogspot.com/feeds/4870443712091763691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=231653091796010968&amp;postID=4870443712091763691&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4870443712091763691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/231653091796010968/posts/default/4870443712091763691'/><link rel='alternate' type='text/html' href='http://mssqlsolutions.blogspot.com/2008/07/case-sensitive-selection-by-using.html' title='case sensitive selection by using Collation Clause'/><author><name>Muhammad Tariq</name><uri>http://www.blogger.com/profile/16150461471279568272</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_Cn6Zk3UUkRU/TL9-zqzgGhI/AAAAAAAAAAQ/KZU2lrnuK5k/S220/displaypicture.JPG'/></author><thr:total>0</thr:total></entry></feed>
