<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4552592939910167609</atom:id><lastBuildDate>Thu, 13 Mar 2025 05:55:53 +0000</lastBuildDate><category>FAQ&#39;s</category><category>General</category><category>Interview Questions</category><category>SQL Videos</category><category>SQL Functions</category><category>queries</category><category>Q.A Tips and Tricks</category><category>MyQueries</category><category>Usefull</category><category>SEO</category><category>CubeProcessingErrors</category><category>OLAP</category><category>SSAS</category><category>Vbscript</category><category>ASP</category><category>RUN Commands</category><category>Sharepoint</category><title>You can find everything about SQL Server here...</title><description>you can find any thing related to sqlserver,&#xa;sql server faq&#39;s, sql server quires, sql server interview questions, clients requirements ..etc</description><link>http://sqlpool.blogspot.com/</link><managingEditor>noreply@blogger.com (Anonymous)</managingEditor><generator>Blogger</generator><openSearch:totalResults>214</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-7616750699422025250</guid><pubDate>Sat, 18 Apr 2020 01:50:00 +0000</pubDate><atom:updated>2010-01-06T01:59:14.857-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FAQ&#39;s</category><category domain="http://www.blogger.com/atom/ns#">Interview Questions</category><title>What is Database Architecture ?</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5mzuRwWS7cbTeiM5EV7-hc_u7-i-2tB1xR3xaUDnaoQvUL7P3n3zg0ycesOj3ekjk7pAWVm7PTzoS4fTt_0zjOdWDvjGQgN1GihLwdX0wDFSqt4V1QYR2VRsNY4JMMUFNoGXEiKkmzNa/s1600-h/DB_Arch.gif&quot;&gt;&lt;img style=&quot;float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 225px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5mzuRwWS7cbTeiM5EV7-hc_u7-i-2tB1xR3xaUDnaoQvUL7P3n3zg0ycesOj3ekjk7pAWVm7PTzoS4fTt_0zjOdWDvjGQgN1GihLwdX0wDFSqt4V1QYR2VRsNY4JMMUFNoGXEiKkmzNa/s320/DB_Arch.gif&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5321443402701775154&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Each database will be divided into two types of implementations&lt;br /&gt;•&lt;b&gt;Logical implementation&lt;/b&gt;&lt;br /&gt;   Tables, views, procedures ..etc&lt;br /&gt;•&lt;b&gt;Physical implementation&lt;/b&gt;&lt;br /&gt;   .LDF, .MDF and NDF files&lt;br /&gt;&lt;br /&gt;When using a database, you work primarily with the logical components such as tables, views, procedures ..etc The physical implementation of files is largely transparent. Typically, only the database administrator needs to work with the physical implementation.</description><link>http://sqlpool.blogspot.com/2009/04/database-architecture.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU5mzuRwWS7cbTeiM5EV7-hc_u7-i-2tB1xR3xaUDnaoQvUL7P3n3zg0ycesOj3ekjk7pAWVm7PTzoS4fTt_0zjOdWDvjGQgN1GihLwdX0wDFSqt4V1QYR2VRsNY4JMMUFNoGXEiKkmzNa/s72-c/DB_Arch.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-3385284837256133657</guid><pubDate>Sat, 18 Apr 2020 00:50:00 +0000</pubDate><atom:updated>2010-01-06T01:59:35.344-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">FAQ&#39;s</category><category domain="http://www.blogger.com/atom/ns#">Interview Questions</category><title>What is Physical Data Base ?</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Px0rGaGn6HiABwbuxBySYtYaH_R-_s38V0ghXQiZUC8e11p0W9Alr0Sctha8sI31y8cbJcdpeLV46Qz5d4tBSiqaMgXCyq1Wo7hXb3DBUJPIaMod0VfEoUcQN3XopO_FqHKtpXAoKwlh/s1600-h/DB_Phy.GIF&quot;&gt;&lt;img style=&quot;float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 209px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Px0rGaGn6HiABwbuxBySYtYaH_R-_s38V0ghXQiZUC8e11p0W9Alr0Sctha8sI31y8cbJcdpeLV46Qz5d4tBSiqaMgXCyq1Wo7hXb3DBUJPIaMod0VfEoUcQN3XopO_FqHKtpXAoKwlh/s320/DB_Phy.GIF&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5321436912716516178&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Physical Db will be divided in to 3 types:&lt;br /&gt;1) .MDF 2) .LDF 3) .NDF&lt;br /&gt;&lt;br /&gt;MDF is a file extension associated with Microsoft SQL Server primary data file.&lt;br /&gt;LDF is a file extension associated with SQL Server Secondary Transaction log file.&lt;br /&gt;NDF is a file extension associated with SQL Server Secondary Data file.&lt;br /&gt;.MDF &amp; .NDF having DB related data&lt;br /&gt;.LDF having logs related data&lt;br /&gt;&lt;br /&gt;On Physical Database contains File Groups and Transaction log&lt;br /&gt;In File Group Contains &lt;b&gt;&lt;i&gt;Data Files&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;Data File contains &lt;b&gt;&lt;i&gt;Tables&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;Tables contains &lt;b&gt;&lt;i&gt;Extents&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;Extents contains &lt;b&gt;&lt;i&gt;Pages&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;pages Contains &lt;b&gt;&lt;i&gt;Rows&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Transaction log is User defined file group by default it&#39;s &lt;br /&gt;&lt;br /&gt;Logical - database objects like view,Sp,functions,Triggers,Indexes and roles etc..</description><link>http://sqlpool.blogspot.com/2009/04/what-is-physical-data-base.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Px0rGaGn6HiABwbuxBySYtYaH_R-_s38V0ghXQiZUC8e11p0W9Alr0Sctha8sI31y8cbJcdpeLV46Qz5d4tBSiqaMgXCyq1Wo7hXb3DBUJPIaMod0VfEoUcQN3XopO_FqHKtpXAoKwlh/s72-c/DB_Phy.GIF" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-2214294230695399499</guid><pubDate>Fri, 17 Apr 2020 08:49:00 +0000</pubDate><atom:updated>2010-01-06T02:00:02.084-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SEO</category><title>What is DEP(Data Execution Prevention) ? How to configure DEP settings?</title><description>&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;What is Data Execution Prevention&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Data Execution Prevention (DEP) helps prevent damage from viruses and other security threats &lt;br /&gt;that attack by running (executing) malicious code from memory locations that only Windows and &lt;br /&gt;other programs should use. This type of threat causes damage by taking over one or more memory &lt;br /&gt;locations in use by a program. Then it spreads and harms other programs, files, and even your e-mail contacts.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;To configure DEP settings for Windows Server 2003 &amp; ....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Need to modify Boot.ini file to prevent from this type of issues.&lt;br /&gt;&lt;br /&gt;Physical Path of Boot.ini &lt;br /&gt; 1. Go to C: Drive&lt;br /&gt; 2. Click on Tools &gt;&gt; Folder Options &gt;&gt; view &gt;&gt; Uncheck &quot;Hide protected operationg system files (Recommended)&quot;  &gt;&gt; Click OK&lt;br /&gt; 3. Now you can see the Boot.ini file&lt;br /&gt;&lt;br /&gt;Change from /noexecute=####### to /noexecute=AlwaysOn and restart the computer.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;To configure DEP settings for Windows and later &amp; ....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   1. Click Start, click Control Panel, and then double-click System.&lt;br /&gt;&lt;br /&gt;   2. Click the Advanced tab. Then, under Performance, click Settings.&lt;br /&gt;&lt;br /&gt;   3. Click the Data Execution Prevention tab.&lt;br /&gt;&lt;br /&gt;   4. Click Turn on DEP for essential Windows programs and services only to select the OptIn policy.&lt;br /&gt;&lt;br /&gt;   5. Click Turn on DEP for all programs and services except those I select to select the OptOut policy.&lt;br /&gt;&lt;br /&gt;   6. If you selected the OptOut policy, click Add and add the applications that you do not want to use DEP with.&lt;br /&gt;&lt;br /&gt;Ref:&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/875352#5&quot;&gt;http://support.microsoft.com/kb/875352#5&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://channel9.msdn.com/forums/TechOff/227400-What-is-Data-Execution-Prevention-and-why-does-it-shut-down-IIS/&quot;&gt;http://channel9.msdn.com/forums/TechOff/227400-What-is-Data-Execution-Prevention-and-why-does-it-shut-down-IIS/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc738483%28WS.10%29.aspx&quot;&gt;http://technet.microsoft.com/en-us/library/cc738483%28WS.10%29.aspx&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;Actual error is &lt;br /&gt;Unexpectedly my website giving &quot;Service Unavailable&quot; message&lt;br /&gt;&lt;br /&gt;&quot;To help protect your computer, Windows has closed this program.&lt;br /&gt;Name: IIS Worker Process&lt;br /&gt;Publisher: Microsoft Corporation&lt;br /&gt;[Change Settings] [Close Message]&quot; &lt;br /&gt;&lt;br /&gt;To avoid this error please read above information&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Note: Please configure DEP settings at your server.&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;/span&gt;&lt;/span&gt;</description><link>http://sqlpool.blogspot.com/2010/01/what-is-depdata-execution-prevention.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-1106021430743941498</guid><pubDate>Fri, 11 Oct 2019 07:14:00 +0000</pubDate><atom:updated>2019-10-11T00:14:02.967-07:00</atom:updated><title>Get the list of tables with row count in sql server</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
CREATE TABLE #COUNTS&lt;br /&gt;
(&lt;br /&gt;
&amp;nbsp; &amp;nbsp; TABLE_NAME VARCHAR(255),&lt;br /&gt;
&amp;nbsp; &amp;nbsp; ROW_COUNT INT&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
EXEC &lt;span style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;SP_MSFOREACHTABLE &lt;/b&gt;&lt;/span&gt;@COMMAND1=&#39;INSERT #COUNTS (TABLE_NAME, ROW_COUNT) SELECT &#39;&#39;?&#39;&#39;, COUNT(*) FROM ?&#39;&lt;br /&gt;
&lt;br /&gt;
SELECT TABLE_NAME, ROW_COUNT FROM #COUNTS&lt;br /&gt;
WHERE&amp;nbsp; TABLE_NAME LIKE &#39;%_SNAPSHOT%&#39; AND ROW_COUNT &amp;lt; 3&lt;br /&gt;
ORDER BY ROW_COUNT ASC,TABLE_NAME&lt;br /&gt;
&lt;br /&gt;
--DROP TABLE #COUNTS&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2019/10/get-list-of-tables-with-row-count-in.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-6188274182369033524</guid><pubDate>Mon, 27 Mar 2017 10:56:00 +0000</pubDate><atom:updated>2017-03-26T23:18:46.563-07:00</atom:updated><title>How to get the Month Names and total days in that month of a year</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;How to get the Month Names and total days in that month of a year&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
SET ANSI_NULLS ON&lt;br /&gt;
GO&lt;br /&gt;
SET QUOTED_IDENTIFIER ON&lt;br /&gt;
GO&lt;br /&gt;
-- =============================================&lt;br /&gt;
-- Author:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Venkat Thogati&lt;br /&gt;
-- Description:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;How to get the Month Names and total days in that month of a year&lt;br /&gt;
-- =============================================&lt;br /&gt;
Create&lt;br /&gt;
&lt;br /&gt;
ALTER PROCEDURE [dbo].[usp_PrintCalenderMonths_TVN]&lt;br /&gt;
@Year VARCHAR (4) AS&lt;br /&gt;
BEGIN&lt;br /&gt;
&amp;nbsp;SET NOCOUNT ON;&lt;br /&gt;
&amp;nbsp;DECLARE @YearStartDate VARCHAR (20)&lt;br /&gt;
&amp;nbsp;DECLARE @YearEndDate VARCHAR (20)&lt;br /&gt;
&amp;nbsp;SET @YearStartDate = @Year+&#39;0101&#39; --instead of static one you may get by query also&lt;br /&gt;
&amp;nbsp;SET @YearEndDate = @Year+&#39;1231&#39;&lt;br /&gt;
&amp;nbsp;;with CTE1 as&lt;br /&gt;
&amp;nbsp;(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; SELECT CAST(@YearStartDate as DateTime) + 0 AS d&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; UNION all&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; SELECT DATEADD(day , 1,d) from CTE1 where DATEADD(day , 1,d) &amp;lt;= CAST(@YearEndDate as DateTime)&lt;br /&gt;
&amp;nbsp;)&lt;br /&gt;
&amp;nbsp;SELECT datepart(month , d) AS &#39;S.no&#39;, datename(month , d) AS MonthName , count(*) AS NoOfDays from CTE1&lt;br /&gt;
&amp;nbsp;GROUP BY datename(month , d), datepart(month , d) OPTION (MAXRECURSION 0);&lt;br /&gt;
END&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Now execute the below one&lt;br /&gt;
--Exec usp_PrintCalenderMonths_TVN&amp;nbsp;2017&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjw4zguUi6IXv96O6qdZmzYVab_zExPMdKEMULceDTKmvrUrSiTKsMNEK-KNK31F2F-h8TziZ3U95ppREYrwHcGm0ZNDYVjvuZ7K6aHqqA1wvKxj2SChQj7N872Xcr1Vf7FWIH1APg3_UF6/s1600/How+to+get+the+Month+Names+and+total+days+in+that+month+of+a+year.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2014/03/how-to-get-month-names-and-total-days.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-5468896644510750146</guid><pubDate>Fri, 26 Feb 2016 06:13:00 +0000</pubDate><atom:updated>2016-02-25T22:27:36.932-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CubeProcessingErrors</category><category domain="http://www.blogger.com/atom/ns#">OLAP</category><category domain="http://www.blogger.com/atom/ns#">SSAS</category><title>Errors in the OLAP storage engine: The slice specified for the Year attribute is incorrect.</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;u&gt;&lt;b&gt;OLAP Cube Processing Error&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
Errors in the OLAP storage engine: The slice specified for the Year attribute is incorrect. Errors in the OLAP storage engine:&lt;br /&gt;
An error occurred while processing the indexes for the 2005_11 - _CubeName - MeasureGroupName partition of the&amp;nbsp;MeasureGroupName measure group of the&amp;nbsp;_CubeName&amp;nbsp;cube from the StudentOLAPDB database.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Solution -&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Remove the code from slice text box and process it again (because it may have the data before 2005 or make sure that 2005 partition should have 2005 data only)&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxk_dnVJzxqtc2sosXc2HUiLFTrpi3O0_7cn8SpYwd8tVgdOhVKcdyN-0Yw71UMp0Ct4WJWSpjC9M26OwTGTVewlPTgzCykc1Jh6qb9rhzY3pJZU_tCXCJGmLzFuyKvsJ74rFWkXKv8zy5/s1600/Errors+in+the+OLAP+storage+engine-+The+slice+specified+for+the+Year+attribute+is+incorrect.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img alt=&quot;Errors in the OLAP storage engine: The slice specified for the Year attribute is incorrect.&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxk_dnVJzxqtc2sosXc2HUiLFTrpi3O0_7cn8SpYwd8tVgdOhVKcdyN-0Yw71UMp0Ct4WJWSpjC9M26OwTGTVewlPTgzCykc1Jh6qb9rhzY3pJZU_tCXCJGmLzFuyKvsJ74rFWkXKv8zy5/s1600/Errors+in+the+OLAP+storage+engine-+The+slice+specified+for+the+Year+attribute+is+incorrect.png&quot; title=&quot;Errors in the OLAP storage engine: The slice specified for the Year attribute is incorrect.&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuLYK7Ryh8CItefKRYAIbI8dgdTfh4g_IazPLdOMjW2uO2To-GJow-RlqspgO5PwIwheJIsgT5h5lugxrKZoV8X-S44QhEpgZVwJI2nKzmYsa5QP5HZrJTiMGF0_6X8AoksyNYOcSSJkJJ/s1600/Errors+in+the+OLAP+storage+engine-+The+slice+specified+for+the+Year+attribute+is+incorrect.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2016/02/errors-in-olap-storage-engine-slice.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxk_dnVJzxqtc2sosXc2HUiLFTrpi3O0_7cn8SpYwd8tVgdOhVKcdyN-0Yw71UMp0Ct4WJWSpjC9M26OwTGTVewlPTgzCykc1Jh6qb9rhzY3pJZU_tCXCJGmLzFuyKvsJ74rFWkXKv8zy5/s72-c/Errors+in+the+OLAP+storage+engine-+The+slice+specified+for+the+Year+attribute+is+incorrect.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-5021928977043457329</guid><pubDate>Mon, 16 Nov 2015 07:46:00 +0000</pubDate><atom:updated>2015-11-15T23:51:18.623-08:00</atom:updated><title>What is DBCC FREESYSTEMCACHE</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;DBCC FREESYSTEMCACHE&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Releases all unused cache entries from all caches. The SQL Server Database Engine proactively cleans up unused cache entries in the background to make memory available for current entries.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: 13px; line-height: 18px;&quot;&gt;However, you can use this command to manually remove unused entries from all caches or from a specified Resource Governor pool cache.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &amp;quot;segoe ui&amp;quot; , &amp;quot;lucida grande&amp;quot; , &amp;quot;verdana&amp;quot; , &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;u&gt;Ex:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;-- Clean all the caches with entries specific to the resource pool named &quot;default&quot;.&lt;br /&gt;&lt;b&gt;&lt;i&gt;DBCC FREESYSTEMCACHE (&#39;ALL&#39;, default);&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;overflow: auto; padding: 5px; word-wrap: normal;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;-- The following example uses the MARK_IN_USE_FOR_REMOVAL clause to release entries from all current caches once the entries become unused&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;DBCC FREESYSTEMCACHE (&#39;ALL&#39;) WITH MARK_IN_USE_FOR_REMOVAL;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;Below query will return all the caches available :&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;--- ONLY for Educational purpose. Don&#39;t attempt to run on PROD Servers !!&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;select &#39;DBCC freesystemcache (&#39;+&#39;&#39;&#39;&#39;+name+&#39;&#39;&#39;&#39;+&#39;)&#39;&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;from sys.dm_os_memory_clerks group by name&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;-- clears cache for specific user database&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;DBCC FREESYSTEMCACHE (&#39;userdatabase&#39;)&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;-- clears cache for tempdb&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;DBCC FREESYSTEMCACHE (&#39;tempdb&#39;) &amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;-- clears all the temp table and variables&amp;nbsp;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: courier new, courier, monospace;&quot;&gt;&lt;b&gt;&lt;i&gt;DBCC FREESYSTEMCACHE (&#39;Temporary Tables &amp;amp; Table Variables&#39;)&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2015/11/what-is-dbcc-freesystemcache.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-8144068371662922779</guid><pubDate>Tue, 05 May 2015 10:07:00 +0000</pubDate><atom:updated>2015-05-05T03:07:44.305-07:00</atom:updated><title>Best articles for &quot;SQL SERVER – Fundamentals of Columnstore Index&quot; / &quot;Columnstore Indexes in SQL Server 2012&quot;</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Hi guys, while I am searching for&amp;nbsp;&lt;span style=&quot;background-color: yellow; color: #333333; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;Columnstore Indexes in SQL Server 2012 /&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;SQL SERVER – Fundamentals of Columnstore Index&lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: arial; font-size: x-small;&quot;&gt;i found the below best articles&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: arial; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: arial;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;1.&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.simple-talk.com/sql/database-administration/columnstore-indexes-in-sql-server-2012/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;https://www.simple-talk.com/sql/database-administration/columnstore-indexes-in-sql-server-2012/&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2.&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://blog.sqlauthority.com/2011/10/29/sql-server-fundamentals-of-columnstore-index/&quot; target=&quot;_blank&quot;&gt;OCTOBER 29, 2011 BY PINAL DAVE SQL SERVER – Fundamentals of Columnstore Index&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: arial; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: arial; font-weight: normal; margin: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: arial; font-weight: normal; margin: 0px; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2015/05/best-articles-for-sql-server.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-1775499742102179156</guid><pubDate>Thu, 09 Apr 2015 06:20:00 +0000</pubDate><atom:updated>2015-04-08T23:21:14.905-07:00</atom:updated><title>Get the list of table names from a data base for a particular schema </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Below is the query for to get the list of table names from a data base for a particular schema&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM INFORMATION_SCHEMA.TABLES&lt;br /&gt;
WHERE &lt;i&gt;TABLE_SCHEMA&lt;/i&gt; = &#39;SchemaName&#39; AND &lt;i&gt;TABLE_TYPE&lt;/i&gt; = &#39;BASE TABLE&#39;&lt;br /&gt;
ORDER BY &lt;i&gt;TABLE_NAME&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Other use full quries&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM sys.tables;&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM INFORMATION_SCHEMA.TABLES&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM sysobjects WHERE xtype=&#39;U&#39;&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2015/04/get-list-of-table-names-from-data-base.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-3317555673372080549</guid><pubDate>Fri, 21 Nov 2014 10:49:00 +0000</pubDate><atom:updated>2014-11-21T03:18:41.171-08:00</atom:updated><title>What is Precision in SQL Server?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
&lt;ol style=&quot;background-color: white; border: 0px; margin: 0px; padding: 0px; text-align: left;&quot;&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;/li&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large; line-height: 15.6000003814697px;&quot;&gt;&lt;b&gt;What is Precision in SQL Server?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/h2&gt;
&lt;ol style=&quot;background-color: white; border: 0px; margin: 0px; padding: 0px;&quot;&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;/li&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: arial, sans-serif; line-height: 15.6000003814697px;&quot;&gt;Precision is the number of digits in a number.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.6000003814697px;&quot;&gt;Scale is the number of digits to the right of the decimal point in a number.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: arial, sans-serif; line-height: 15.6000003814697px;&quot;&gt;For example, the number 123.45 has a precision of 5 and a scale of 2.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;&lt;span style=&quot;color: #222222; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.6000003814697px;&quot;&gt;In SQL Server, the default maximum precision of numeric and decimal data types is 38.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;mod&quot; style=&quot;border: 0px; clear: none; color: #222222; font-family: arial, sans-serif; font-size: small; line-height: 1.2; list-style: none; margin: 0px; padding: 0px 20px;&quot;&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2014/11/what-is-precision-in-sql-server.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-4685165168092215757</guid><pubDate>Wed, 01 Oct 2014 11:13:00 +0000</pubDate><atom:updated>2014-10-01T04:13:38.178-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interview Questions</category><category domain="http://www.blogger.com/atom/ns#">MyQueries</category><title>sql server get identity after insert stored procedure</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
In this step by step SQL Tutorial I will show you how to using&amp;nbsp;&lt;strong&gt;SQL Server get identity after insert&lt;/strong&gt;&amp;nbsp;using&amp;nbsp;&lt;strong&gt;stored procedure.&amp;nbsp;&lt;/strong&gt;For the purpose of this tutorial I will use SQL Server 2008 R2.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
Other Versions of SQL Server:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; list-style: square inside none;&quot;&gt;
&lt;li&gt;SQL Server 2012&lt;ul style=&quot;list-style: square inside none;&quot;&gt;
&lt;li&gt;The examples we used should work in SQL Server 2012&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;SQL Server 2008 / R2&lt;ul style=&quot;list-style: square inside none;&quot;&gt;
&lt;li&gt;This blog post has been written using SQL Server 2008 R2&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;SQL Server 2005&lt;ul style=&quot;list-style: square inside none;&quot;&gt;
&lt;li&gt;We suspect that this will work in SQL Server 2005 as well&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
NOTE: The method we will use contains some bugs which we will mention so ensure you fully test your code and make appropriate research.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
Who is it for?&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
People who need to insert row and get IDENTITY value back Contents&lt;/div&gt;
&lt;ul style=&quot;background-color: white; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; list-style: square inside none;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;Introduction to get Identity&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;How to get identify after Insert&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black;&quot;&gt;Get Identity after insert in stored procedure&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 20px; line-height: 30px; margin: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Introduction to get Identity&quot; style=&quot;background: transparent;&quot;&gt;Introduction to get Identity&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
There are different way to get identity ID after insert and there are:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
NOTE: Both @@identity and Scope_identity contained a bug that apparently was fixed certain version&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; list-style: square inside none;&quot;&gt;
&lt;li&gt;&lt;strong style=&quot;color: #333333; font-family: verdana, tahoma, arial, sans-serif; line-height: 19px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;@@IDENTITY -&amp;nbsp;&lt;/strong&gt;Returns last inserted identity using current connection. This means that you get last inserted identity which might not be necessarily be after your insert.&amp;nbsp;If you have trigger that insert row and new identity inserted you might get this ID instead. Methpd below seems to be more reliable and @@identity&amp;nbsp;should be avoided.&lt;/li&gt;
&lt;li&gt;&lt;strong style=&quot;color: #333333; font-family: verdana, tahoma, arial, sans-serif; line-height: 19px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;SCOPE_IDENTITY() -&amp;nbsp;&lt;/strong&gt;Returns last identity value that was created in current connection but also the statement scope. This means it should return Identify of your statement (not affected by triggers). I will use this method in my example.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong style=&quot;color: #333333; font-family: verdana, tahoma, arial, sans-serif; line-height: 19px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;IDENT_CURRENT(‘tablename’) -&amp;nbsp;&lt;/strong&gt;Returns last inserted Identity value in a specifed table. Regardless of the conneciton and should be used only in very specific scenarios.&lt;/li&gt;
&lt;li&gt;&lt;strong style=&quot;color: #333333; font-family: verdana, tahoma, arial, sans-serif; line-height: 19px; margin: 0px; padding: 0px; text-align: justify;&quot;&gt;OUTPUT INTO -&lt;/strong&gt;&amp;nbsp;This clause can be used with INSERT and you can ouput inserted rows (with Identity) to another table or table variable and access the value. This sounds like&amp;nbsp;the&amp;nbsp;most reliable way to get exactly the ID you want, however as we don&#39;t know the limitation of this method (if any) and extra code that is required in our case we will just use SCOPE_IDENTITY.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 20px; line-height: 30px; margin: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How to get identify after Insert&quot; style=&quot;background: transparent;&quot;&gt;How to get identify after Insert&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;-- First let me create Test table&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;CREATE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;TABLE&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;dbo&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Test&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 80px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;ID&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;IDENTITY&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NOT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NULL&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 80px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;TestField&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;NVARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NOT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;NULL&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 80px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;-- Below I insert one row into my Test table. This will generate new ID&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;dbo.Test (TestField)&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;VALUES&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;test&#39;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;-- and here&#39;s how you can get the identity back from the last inserted ID&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;SCOPE_IDENTITY&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 20px; line-height: 30px; margin: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Get Identity after insert in stored procedure&quot; style=&quot;background: transparent;&quot;&gt;Get Identity after insert in stored procedure&lt;/a&gt;&lt;/h2&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;-- below is stored procedure T-SQL Script&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;CREATE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;PROCEDURE&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;dbo&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;GetIdentityAfterInsert&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 160px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;@ID&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;BEGIN&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--insert new row&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INTO&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;dbo&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Test&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;TestField&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;VALUES&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;test&#39;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;--save identity value and return using stored procedure OUTPUT parameter&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SET&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;@ID&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;SCOPE_IDENTITY&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; margin-left: 40px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;END&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;strong&gt;How it works?&lt;/strong&gt;&amp;nbsp; The stored procedure accepts one parameter @ID (this actually should always be empty when you use SP) but it uses OUTPUT to return result.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
So you can capture Identity can store it in variable using the following code&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;DECLARE&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@ID&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;EXEC&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;dbo&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;GetIdentityAfterInsert&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@ID&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@ID&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;NOTE: OUTPUT in the middle line is very important. If you don&#39;t put it than the variable won&#39;t be populated.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #444444; font-family: Verdana, Arial; font-size: 16px; line-height: 25px; padding: 5px 5px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2014/10/sql-server-get-identity-after-insert.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-433232550107234417</guid><pubDate>Mon, 26 May 2014 09:27:00 +0000</pubDate><atom:updated>2016-02-25T22:38:12.780-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CubeProcessingErrors</category><category domain="http://www.blogger.com/atom/ns#">OLAP</category><category domain="http://www.blogger.com/atom/ns#">SSAS</category><title>How to Optimizing in OLAP processing / Optimizing Cube Performance with OLAP / Tips for Optimizing SQL Server OLAP/Analysis Services / Cube Processing with ProcessData &amp; ProcessIndexes </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
We are facing the problem at Cube processing on daily schedule, 2 cubes are taking more time. on this topic we had around one week discussion with team to reduce the processing time of those cubes.&lt;br /&gt;
&lt;br /&gt;
we tried for the below procedure and we got the good result and we are following this&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;Old Process:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; Every day cube is running with ProcessFull option &lt;b&gt;&lt;i&gt;&lt;type&gt;ProcessFull&lt;/type&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;&lt;u&gt;New Process:&lt;/u&gt;&lt;/i&gt;&lt;/b&gt; Now cube processing with ProcessData &lt;b&gt;&lt;i&gt;&amp;nbsp;&lt;type&gt;ProcessData&lt;/type&gt;&lt;/i&gt;&lt;/b&gt; &amp;amp; Process&amp;nbsp;&lt;b&gt;&lt;i&gt;&lt;type&gt;ProcessIndexes&lt;/type&gt;&lt;/i&gt;&lt;/b&gt; options&lt;br /&gt;
&lt;br /&gt;
above one file is divided into two files and processing one by one&lt;br /&gt;
First need to process the&amp;nbsp;&lt;b&gt;&lt;i&gt;&amp;nbsp;&lt;type&gt;ProcessData&lt;/type&gt;&lt;/i&gt;&lt;/b&gt;&amp;nbsp; files - &lt;span style=&quot;background-color: lime;&quot;&gt;Cube is ready after completion of this step&lt;/span&gt;&lt;br /&gt;
Second process the&amp;nbsp;&lt;b style=&quot;font-style: italic;&quot;&gt;&lt;type&gt;ProcessIndexes&lt;/type&gt; &lt;/b&gt;files -&lt;span style=&quot;background-color: lime;&quot;&gt; Performance will increase after completion of this step&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please see the below old code &amp;amp; new code&lt;br /&gt;
&lt;br /&gt;
in Old Process we have only one file called with&lt;b&gt; &quot;0. _CubeName.Partition.2012&quot;&lt;/b&gt; and below is the code&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifA5mgBxP3y_Q2Es3uVMh9UR20hpWetDltGf9aIWPPsUtQl77DcnAudO4oGJVXQxhyphenhyphenYin6_xPqX4ZkSpe5dvtxLhTAPfRPNwWOdkm4UkAIE0B_76Gj3WY8d1yaOjPlVvwVe8jHOqI-i-uJ/s1600/Cube_ProcessFull_Code.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;195&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifA5mgBxP3y_Q2Es3uVMh9UR20hpWetDltGf9aIWPPsUtQl77DcnAudO4oGJVXQxhyphenhyphenYin6_xPqX4ZkSpe5dvtxLhTAPfRPNwWOdkm4UkAIE0B_76Gj3WY8d1yaOjPlVvwVe8jHOqI-i-uJ/s1600/Cube_ProcessFull_Code.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;batch xmlns=&quot;http://schemas.microsoft.com/analysisservices/2003/engine&quot;&gt;&lt;/batch&gt;in the New Process there are two files&amp;nbsp;&lt;b&gt;&quot;0. _CubeName.Partition.ProcessData.2012&quot;&lt;/b&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;b&gt;&quot;0. _CubeName.Partition.ProcessIndexes.2012&quot;&lt;/b&gt;&amp;nbsp;and below is the code&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGGujYI5dCy1m8Z0Ka9wWLzRoI2C-hCs36wUO_Ys-J2OWf69k0FcJqLGooJmzdFv6i873iGTliir3R7jc61YqCLbFT2xB_7iVXZvietwDRQ09UtU_I_yyyCJLMKuiAzIjxt119a4t23VgU/s1600/Step1-Cube_ProcessData_Code.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;205&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGGujYI5dCy1m8Z0Ka9wWLzRoI2C-hCs36wUO_Ys-J2OWf69k0FcJqLGooJmzdFv6i873iGTliir3R7jc61YqCLbFT2xB_7iVXZvietwDRQ09UtU_I_yyyCJLMKuiAzIjxt119a4t23VgU/s1600/Step1-Cube_ProcessData_Code.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWajPAk2AYge6g2kcB0tx2MUUPvZG8lvikvvxC6qI36A4j0CKQKmgk6a-m_S6SkGCG4NJus1g1zkjmKB4OkDzkUyknaIHRzzWB9iGW9kte-KXLRFZzpjEv9hWLx8cj975uZtp88MyBz_53/s1600/Step2-Cube_ProcessIndexes_Code.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWajPAk2AYge6g2kcB0tx2MUUPvZG8lvikvvxC6qI36A4j0CKQKmgk6a-m_S6SkGCG4NJus1g1zkjmKB4OkDzkUyknaIHRzzWB9iGW9kte-KXLRFZzpjEv9hWLx8cj975uZtp88MyBz_53/s1600/Step2-Cube_ProcessIndexes_Code.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please find the below screen shots of processing steps&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieUNPRHEHYyeED8fJYl5vCbFUC3YjYi2QdIO6HfOi65shLbLSz8gG3RSnSqm6irtKrQFuYaC2HkHaeMV20sVoJmq3Qx0RXiyjp8NS-Wpggy2HlKVAW90r0A9QjYFkvo_w5UJXXKFL69-eP/s1600/Step1-Cube_ProcessData.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;299&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieUNPRHEHYyeED8fJYl5vCbFUC3YjYi2QdIO6HfOi65shLbLSz8gG3RSnSqm6irtKrQFuYaC2HkHaeMV20sVoJmq3Qx0RXiyjp8NS-Wpggy2HlKVAW90r0A9QjYFkvo_w5UJXXKFL69-eP/s1600/Step1-Cube_ProcessData.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrZSfKBgUJxAk7CfyqpXBZDkg2oWNpzx3uwFS5LXR_Wwa2Vy1IT75PUtUB-7KSk4ftme_N8RKgHjuihjni1meJLZNGUXEFFGuJQG84aATciIqxS4pJJUaW3RrJBiD0RbaordHBkKtMaQJ0/s1600/Step2-Cube_ProcessIndexes.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrZSfKBgUJxAk7CfyqpXBZDkg2oWNpzx3uwFS5LXR_Wwa2Vy1IT75PUtUB-7KSk4ftme_N8RKgHjuihjni1meJLZNGUXEFFGuJQG84aATciIqxS4pJJUaW3RrJBiD0RbaordHBkKtMaQJ0/s1600/Step2-Cube_ProcessIndexes.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are the list of Cube Processing Options&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdBwvdHLfOOuhLqMcWvpzp9xFfWkLmOJ3SWpPcPUp0myqwRDM1afMJhtkcc97rnzxI1nElC-_ocTMrOtjDc37z2jvVhLt53aBVqp5FLiEjhKlKymZ3rK1MeB1r_coob_asXmIRNFvJlzDL/s1600/Cube_ProcessingOptions.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdBwvdHLfOOuhLqMcWvpzp9xFfWkLmOJ3SWpPcPUp0myqwRDM1afMJhtkcc97rnzxI1nElC-_ocTMrOtjDc37z2jvVhLt53aBVqp5FLiEjhKlKymZ3rK1MeB1r_coob_asXmIRNFvJlzDL/s1600/Cube_ProcessingOptions.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2014/05/how-to-optimizing-in-olap-processing.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifA5mgBxP3y_Q2Es3uVMh9UR20hpWetDltGf9aIWPPsUtQl77DcnAudO4oGJVXQxhyphenhyphenYin6_xPqX4ZkSpe5dvtxLhTAPfRPNwWOdkm4UkAIE0B_76Gj3WY8d1yaOjPlVvwVe8jHOqI-i-uJ/s72-c/Cube_ProcessFull_Code.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-626246769246125113</guid><pubDate>Mon, 26 May 2014 08:02:00 +0000</pubDate><atom:updated>2014-05-26T01:02:17.006-07:00</atom:updated><title>Microsoft – SQL Server – xp_delete_file – error 2 ? / Maintenance Cleanup Job Task Fails but Backup Jop is successful ? / Maintenance cleanup Task does not delete files?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;b&gt;&lt;u&gt;Error Message Screen Shot&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLIXjAcCC0DyfbIbzW4vgVtJLGJigOlCgZ8QJN8cJfi5V1031WxfHnR_6AA9gb2Ff5m_B3gLTH3KCPEGZSHqxoOQA4FhYdXG_FzLFxK6y8ICT1AfwUKjV17Ue70E1yqCoRw6IdqegKB-6c/s1600/Maintenance_Cleanup_+xp_delete_file+%25E2%2580%2593+error+2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLIXjAcCC0DyfbIbzW4vgVtJLGJigOlCgZ8QJN8cJfi5V1031WxfHnR_6AA9gb2Ff5m_B3gLTH3KCPEGZSHqxoOQA4FhYdXG_FzLFxK6y8ICT1AfwUKjV17Ue70E1yqCoRw6IdqegKB-6c/s1600/Maintenance_Cleanup_+xp_delete_file+%25E2%2580%2593+error+2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;u&gt;Solution:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
DECLARE @currentdate datetime&lt;/div&gt;
&lt;div&gt;
DECLARE @olddate datetime&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
set @currentdate = CURRENT_TIMESTAMP&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
--Change&lt;/div&gt;
&lt;div&gt;
set @olddate = @currentdate - 1&lt;/div&gt;
&lt;div&gt;
--Change number here depending how many days of backup file you&lt;/div&gt;
&lt;div&gt;
--want to retain on server.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
-- Add below line for each database/path you might need.&lt;/div&gt;
&lt;div&gt;
EXECUTE master.dbo.xp_delete_file&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,N&#39;C:\MSSQL\Backup\Temp2\&#39;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,N&#39;bak&#39;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,@olddate&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,1&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here first arg is&lt;/div&gt;
&lt;div&gt;
0 - specifies a backup file&lt;/div&gt;
&lt;div&gt;
1 - specifies a report file&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Fifth argument is&lt;/div&gt;
&lt;div&gt;
0 - don&#39;t delete recursively (default)&lt;/div&gt;
&lt;div&gt;
1 - delete files in sub directories&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For some reason, master.dbo.xp_delete_file sometimes returns the error listed below:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Msg 22049, Level 16, State 1, Line 0&lt;/div&gt;
&lt;div&gt;
xp_delete_file() returned error 2, ‘The system cannot find the file specified.’&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To remediate:&lt;/div&gt;
&lt;div&gt;
Ensure that the folder referenced in the master.dbo.xp_delete_file exists&lt;/div&gt;
&lt;div&gt;
Ensure that the SQL Server or SQL Server Agent has access to the folder referenced&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2014/05/microsoft-sql-server-xpdeletefile-error.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLIXjAcCC0DyfbIbzW4vgVtJLGJigOlCgZ8QJN8cJfi5V1031WxfHnR_6AA9gb2Ff5m_B3gLTH3KCPEGZSHqxoOQA4FhYdXG_FzLFxK6y8ICT1AfwUKjV17Ue70E1yqCoRw6IdqegKB-6c/s72-c/Maintenance_Cleanup_+xp_delete_file+%25E2%2580%2593+error+2.png" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-249501120255975232</guid><pubDate>Fri, 16 May 2014 13:17:00 +0000</pubDate><atom:updated>2014-05-16T06:17:23.301-07:00</atom:updated><title>SQL Stored Procedure Modified Date Query</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 22px; margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-size: 13px; line-height: 18.200000762939453px;&quot;&gt;While working on a problem I wanted to determine the last modified date for stored procedures (sprocs) in the SQL database I was working in. After some Google’ing I learned the following, from forums, multiple blog posts, etc. I figured it would be nice to have this information in a centralized area, so here you go....&lt;/span&gt;&lt;/h3&gt;
&lt;div class=&quot;post-body entry-content&quot; style=&quot;background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.200000762939453px; position: relative; width: 756px;&quot;&gt;
&lt;br /&gt;&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;u&gt;SQL 2005 Stored Procedure Last Modified Date&lt;/u&gt;&lt;/h3&gt;
&lt;br /&gt;Getting the last modified date for sprocs in SQL 2005 is really easy using the following query:&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &#39;; font-size: 10;&quot;&gt;-- Queries the sys.objects system view to gather information&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &#39;; font-size: 10;&quot;&gt;-- about user defined stored procedure database objects;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &#39;; font-size: 10;&quot;&gt;-- specified with type=&#39;P&#39;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &#39;; font-size: 10;&quot;&gt;-- SQL 2005 --&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;USE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;AdventureWorks&lt;span style=&quot;color: grey;&quot;&gt;;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;-- Database name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;create_date&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;modify_date&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;sys.objects&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;-- User defined objects system view&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;type&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&#39;P&#39;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;-- Only return stored procedures&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &#39;; font-size: 10;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;name&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;LIKE&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&#39;mycompanyprefix_%&#39;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;-- Only return sprocs with names beginning with &quot;mycompanyprefix_&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;GO&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;u&gt;SQL 2000 Stored Procedure Last Modified Date&lt;/u&gt;&lt;/h3&gt;
&lt;br /&gt;Unfortunately, there isn’t an equivalent command for SQL 2000. The modified date columns in SQL 2000 weren’t being updated correctly and from the research I performed Microsoft didn’t fix the problem until SQL 2005. I tried writing the following similar query to the one that works in SQL 2005, but the created date &amp;amp; ref date are always the same.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &#39;; font-size: 10;&quot;&gt;-- SQL 2000 --&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: green; font-family: &#39;; font-size: 10;&quot;&gt;-- DOESN&#39;T WORK --&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;USE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;Northwind&lt;span style=&quot;color: grey;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;name&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;crdate&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;refdate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;sysobjects&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;; font-size: 10;&quot;&gt;WHERE&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;type&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&#39;P&#39;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: grey; font-family: &#39;; font-size: 10;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&amp;nbsp;name&amp;nbsp;&lt;span style=&quot;color: grey;&quot;&gt;LIKE&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&#39;mycompanyprefix_%&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 12pt; margin: 0in 0in 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;; font-size: 10;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2014/05/sql-stored-procedure-modified-date-query.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-1136183979082958806</guid><pubDate>Mon, 25 Nov 2013 07:18:00 +0000</pubDate><atom:updated>2013-11-24T23:18:03.053-08:00</atom:updated><title>How to resolve source.udl error while executing the JOB on SQLServer?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
Hi All,&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuYqmwZcWWA2ITuDNpi8nQsifLE6CrJpqc2HyNOeipYlPou9ENu3simcHxqbJTRVe1cc9N0y8hGlrrwFqZaI6SpLRMabgGa-MDJOghjol0vMV6rB7Rh1TZPc-Cn9i_wSfU5CjSQ9e8Pxmg/s1600/Source_UDL_Error.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;304&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuYqmwZcWWA2ITuDNpi8nQsifLE6CrJpqc2HyNOeipYlPou9ENu3simcHxqbJTRVe1cc9N0y8hGlrrwFqZaI6SpLRMabgGa-MDJOghjol0vMV6rB7Rh1TZPc-Cn9i_wSfU5CjSQ9e8Pxmg/s320/Source_UDL_Error.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
Guys I created one Job and it&#39;s scheduled for daily. some days it&#39;s running with out any issue and some it&#39;s giving the above error, I spent so much time to solve this issue but i couldn&#39;t, could any one please help me on this...&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
around from last 15 days I am fighting on this issue only and to complete this job it&#39;s taking 18 hrs, actually this is not an issue but some time it&#39;s giving the source.udl error.. and it&#39;s giving randomly not in on a particular day (like only on Tuesday, or Monday or sunday...) &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
if you observe in the above screen shot job ran successfully on 17th &amp;amp; 18th and it&#39;s failed on 19th again it&#39;s ran&amp;nbsp;successfully on 20, 21 &amp;amp; 22 and&amp;nbsp;it&#39;s failed on 23rd&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
&lt;strong style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Thanks in advance,&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: none; color: #333333; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 20px; list-style-type: none; margin-bottom: 1em; outline: 0px; padding: 0px;&quot;&gt;
VenkataNarayana Thogati&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2013/11/how-to-resolve-sourceudl-error-while.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuYqmwZcWWA2ITuDNpi8nQsifLE6CrJpqc2HyNOeipYlPou9ENu3simcHxqbJTRVe1cc9N0y8hGlrrwFqZaI6SpLRMabgGa-MDJOghjol0vMV6rB7Rh1TZPc-Cn9i_wSfU5CjSQ9e8Pxmg/s72-c/Source_UDL_Error.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-4323340382493157626</guid><pubDate>Fri, 05 Jul 2013 10:53:00 +0000</pubDate><atom:updated>2013-07-05T03:53:16.317-07:00</atom:updated><title>How to find the list of tables containing column with specified name/ column name like ?</title><description>&lt;div class=&quot;post-text&quot;&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot;&gt;select distinct TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME ,COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS 
where 
--COLUMN_NAME like &#39;%KATID%&#39;
TABLE_NAME like &#39;%temp%&#39;
order by  TABLE_NAME&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot;&gt;PFA Sample Screen Shot&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint prettyprinted&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvM42t5-ZwmP-7bfQq0klZf7Dy9LUP5TpA6erV0HYhdwC4cu_CNREhl6kN4DWNd9upqd0_IyG-EguXdgYTKaCut2mqouRcKnvpIpiKqUGwYtyf38uC7DHZFvYz5181Ywp-QLh-S2NSkrZE/s514/Q-Find_Tables_sps_by_colnames&amp;amp;tablenames.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvM42t5-ZwmP-7bfQq0klZf7Dy9LUP5TpA6erV0HYhdwC4cu_CNREhl6kN4DWNd9upqd0_IyG-EguXdgYTKaCut2mqouRcKnvpIpiKqUGwYtyf38uC7DHZFvYz5181Ywp-QLh-S2NSkrZE/s514/Q-Find_Tables_sps_by_colnames&amp;amp;tablenames.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2013/07/how-to-find-list-of-tables-containing.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvM42t5-ZwmP-7bfQq0klZf7Dy9LUP5TpA6erV0HYhdwC4cu_CNREhl6kN4DWNd9upqd0_IyG-EguXdgYTKaCut2mqouRcKnvpIpiKqUGwYtyf38uC7DHZFvYz5181Ywp-QLh-S2NSkrZE/s72-c/Q-Find_Tables_sps_by_colnames&amp;tablenames.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-7594747834977155704</guid><pubDate>Fri, 05 Jul 2013 10:35:00 +0000</pubDate><atom:updated>2013-07-05T03:35:58.680-07:00</atom:updated><title>How to Find a string value in the current DB in SQL Server / How to find the SchemaName, TableName, ColumnName from the current DB by passing a string? </title><description>&lt;br /&gt;
/****** Object: &amp;nbsp;To find the SchemaName, TableName, ColumnName from the current DB by passing a string ******/&lt;br /&gt;
/* Note: plz check the below commented code for Schema wise filtering and Table wise filter */&lt;br /&gt;
SET ANSI_NULLS ON&lt;br /&gt;
GO&lt;br /&gt;
SET QUOTED_IDENTIFIER ON&lt;br /&gt;
GO&lt;br /&gt;
--Exec [SP_StingFinderFromAllTheTablesInCurrentDB] &#39;Ven&#39;&lt;br /&gt;
Create PROC [dbo].[SP_StingFinderFromAllTheTablesInCurrentDB] &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
@SearchStr nvarchar(100) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
AS &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
BEGIN &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
DECLARE @dml nvarchar(max) = N&#39;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
IF OBJECT_ID(&#39;tempdb.dbo.#OutPut&#39;) IS NOT NULL DROP TABLE dbo.#OutPut &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
CREATE TABLE dbo.#OutPut &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp;(&lt;br /&gt;
&amp;nbsp; [Schema Name] nvarchar(100), &amp;nbsp;&lt;br /&gt;
&amp;nbsp; [Table Name] nvarchar(100), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; [Column Name] nvarchar(100), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; [Given String] nvarchar(max)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
SELECT @dml += &#39; SELECT &#39;&#39;&#39; + s.name + &#39;&#39;&#39; AS [Schema Name], &#39;&#39;&#39; + + t.name + &#39;&#39;&#39; AS [Table Name], &#39;&#39;&#39; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.name + &#39;&#39;&#39; AS [Column Name], CAST(&#39; + QUOTENAME(c.name) + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39; AS nvarchar(max)) AS [Given String] FROM &#39; + QUOTENAME(s.name) + &#39;.&#39; + QUOTENAME(t.name) + &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39; (NOLOCK) WHERE CAST(&#39; + QUOTENAME(c.name) + &#39; AS nvarchar(max)) LIKE &#39; + &#39;&#39;&#39;%&#39; + @SearchStr + &#39;%&#39;&#39;&#39; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
FROM sys.schemas s JOIN sys.tables t ON s.schema_id = t.schema_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JOIN sys.columns c ON t.object_id = c.object_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JOIN sys.types ty ON c.system_type_id = ty.system_type_id AND c .user_type_id = ty .user_type_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
WHERE t.is_ms_shipped = 0 AND ty.name NOT IN (&#39;timestamp&#39;, &#39;image&#39;, &#39;sql_variant&#39;) &amp;nbsp; &amp;nbsp; &lt;br /&gt;
--and t.name like &#39;%_Cleansing&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;-- Table wise filter&lt;br /&gt;
--and S.name = &#39;Your Schema Name&#39; &amp;nbsp; &amp;nbsp;-- Schema wise filter &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
INSERT dbo.#OutPut &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
EXEC sp_executesql @dml &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
SELECT * &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
FROM dbo.#OutPut &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
END&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghgaTGkSd0w2ES6m_IPu4wAHKYMCG687pbqcRM3LG_rNFcBh7RxwTUZmcfCJb8j3-dh-HzWboJFiHBZTredQ_9y-hdMtcLakenOxjpkdFOWzIHGaEJwxT_HIfAxASNs6d2MEUVN-gK7MHZ/s411/StingFinderFromAllTheTablesInCurrentDB.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghgaTGkSd0w2ES6m_IPu4wAHKYMCG687pbqcRM3LG_rNFcBh7RxwTUZmcfCJb8j3-dh-HzWboJFiHBZTredQ_9y-hdMtcLakenOxjpkdFOWzIHGaEJwxT_HIfAxASNs6d2MEUVN-gK7MHZ/s411/StingFinderFromAllTheTablesInCurrentDB.png&quot; height=&quot;109&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2013/07/how-to-find-string-value-in-current-db.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghgaTGkSd0w2ES6m_IPu4wAHKYMCG687pbqcRM3LG_rNFcBh7RxwTUZmcfCJb8j3-dh-HzWboJFiHBZTredQ_9y-hdMtcLakenOxjpkdFOWzIHGaEJwxT_HIfAxASNs6d2MEUVN-gK7MHZ/s72-c/StingFinderFromAllTheTablesInCurrentDB.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-4460802165545115087</guid><pubDate>Tue, 23 Apr 2013 11:30:00 +0000</pubDate><atom:updated>2013-04-23T04:30:52.246-07:00</atom:updated><title>how to know outlook 2003 mail replied time in C#?  Error Image</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxkx7klzpnz8MbtlnnZ43_lGxkxKEc7Aiatl4pZgVyu9DGwtblrDSdNer1gAV8FvUJv7YBP_boq97xEz6NBU3tmHV9WcReGTJ5ELQLMYCFAxAWuytf_Xnmst_Q6GUhzM0-SskK2tG1u4Ue/s1600/Error_Redemption.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; dua=&quot;true&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxkx7klzpnz8MbtlnnZ43_lGxkxKEc7Aiatl4pZgVyu9DGwtblrDSdNer1gAV8FvUJv7YBP_boq97xEz6NBU3tmHV9WcReGTJ5ELQLMYCFAxAWuytf_Xnmst_Q6GUhzM0-SskK2tG1u4Ue/s320/Error_Redemption.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQnDGHMv8Fk9XVhNkpHlws9Krb6S7HVs0Z9FN0fEeaLpwcypbty6UnZNoElf2FSlCzTDx6Gg7LF8gW1Jm4_1NQiHU8ZOSERpVlFo6Y2ALg7dXk7FgPj-r2gVT-BQfmcMiFutQ0PhbKYCdv/s1600/Error_Redemption.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; dua=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQnDGHMv8Fk9XVhNkpHlws9Krb6S7HVs0Z9FN0fEeaLpwcypbty6UnZNoElf2FSlCzTDx6Gg7LF8gW1Jm4_1NQiHU8ZOSERpVlFo6Y2ALg7dXk7FgPj-r2gVT-BQfmcMiFutQ0PhbKYCdv/s1600/Error_Redemption.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2013/04/how-to-know-outlook-2003-mail-replied.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxkx7klzpnz8MbtlnnZ43_lGxkxKEc7Aiatl4pZgVyu9DGwtblrDSdNer1gAV8FvUJv7YBP_boq97xEz6NBU3tmHV9WcReGTJ5ELQLMYCFAxAWuytf_Xnmst_Q6GUhzM0-SskK2tG1u4Ue/s72-c/Error_Redemption.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-7529321526418022333</guid><pubDate>Wed, 10 Apr 2013 06:49:00 +0000</pubDate><atom:updated>2013-04-09T23:52:38.521-07:00</atom:updated><title>What is the maximum number of Index per table in ,SQL Server 2005, SQL Server 2008 &amp; SQL Server 2012?</title><description>&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;In&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; outline: none 0px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;SQL Server 2005&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;we can create&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px; font-weight: bold; outline: none 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; outline: none 0px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;1 cluster+249 non cluster=250&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&amp;nbsp;indexes&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp;For More Iformation: &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/ms143432(v=SQL.90).aspx&quot;&gt;http://technet.microsoft.com/en-us/library/ms143432(v=SQL.90).aspx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;In&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; outline: none 0px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;SQL Server 2008&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;we can create&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px; font-weight: bold; outline: none 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; outline: none 0px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;1 cluster+999 non cluster=1000&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&amp;nbsp;indexes&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&amp;nbsp; &amp;nbsp;For More Iformation: &amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://technet.microsoft.com/en-us/library/ms143432(v=sql.105).aspx&quot;&gt;http://technet.microsoft.com/en-us/library/ms143432(v=sql.105).aspx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;In&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; outline: none 0px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;SQL Server 2012&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;we can create&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px; font-weight: bold; outline: none 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; outline: none 0px;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;b&gt;1 cluster+999 non cluster=1000&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&amp;nbsp;indexes&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&amp;nbsp; &amp;nbsp;For More Iformation: &amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Segoe UI, Calibri, Verdana; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms143432.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/ms143432.aspx&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: &#39;Segoe UI&#39;, Calibri, Verdana; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://sqlpool.blogspot.com/2013/04/what-is-maximum-number-of-index-per.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-7047497102926865029</guid><pubDate>Wed, 03 Apr 2013 07:44:00 +0000</pubDate><atom:updated>2013-04-03T00:46:39.111-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MyQueries</category><category domain="http://www.blogger.com/atom/ns#">SQL Functions</category><category domain="http://www.blogger.com/atom/ns#">SQL Videos</category><title>How to find a column from Entire Database?</title><description>&lt;br /&gt;
use [DataBase Name]&lt;br /&gt;
&lt;br /&gt;
SELECT tab.Name AS Tablename,SCHEMA_NAME(schema_id) AS Schemaname,col.name AS Columnname&lt;br /&gt;
FROM sys.tables AS tab INNER JOIN sys.columns col ON tab.OBJECT_ID = col.OBJECT_ID&lt;br /&gt;
WHERE col.name LIKE &#39;%ShiftStartTime%&#39;</description><link>http://sqlpool.blogspot.com/2013/04/how-to-find-column-from-entire-database.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-597171697096956715</guid><pubDate>Thu, 23 Aug 2012 01:30:00 +0000</pubDate><atom:updated>2012-08-22T18:34:18.385-07:00</atom:updated><title>10 reasons why SQL Server 2008 is going to rock OR SQL Server 2008 Features </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
10. Plug-in model for SSMS. SSMS 2005 also had a plug-in model, but it was not published, so the few developers that braved that environment were flying blind. Apparently for 2008, the plug-in model will be published and a thousand add-ins will bloom. &lt;br /&gt;
&lt;br /&gt;
9. Inline variable assignment. I often wondered why, as a language, SQL languishes behind the times. I mean, it has barely any modern syntactic sugar. Well, in this version, they are at least scratching the the tip of the iceberg. Instead of: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DECLARE @myVar int SET &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@myVar = 5 &lt;br /&gt;
you can do it in one line: &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DECLARE @myVar int = 5 Sweet. &lt;br /&gt;
&lt;br /&gt;
8. C like math syntax. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET @i += 5. Enough said. They finally let a C# developer on the SQL team. &lt;br /&gt;
&lt;br /&gt;
7. Auditing. It&#39;s a 10 dollar word for storing changes to your data for later review, debugging or in response to regulatory laws. It&#39;s a thankless and a mundane task and no one is ever excited by the prospect of writing triggers to handle it. SQL Server 2008 introduces automatic auditing, so we can now check one thing off our to do list. &lt;br /&gt;
&lt;br /&gt;
6. Compression. You may think that this feature is a waste of time, but it&#39;s not what it sounds like. The release will offer row-level and page-level compression. The compression mostly takes place on the metadata. For instance, page compression will store common data for affected rows in a single place. The metadata storage for variable length fields is going to be completely crazy: they are pushing things into bits (instead of bytes). For instance, length of the varchar will be stored in 3 bits. Anyway, I don&#39;t really care about space savings - storage is cheap. What I do care about is that the feature promised (key word here &quot;promises&quot;) to reduce I/O and RAM utilization, while increasing CPU utilization. Every single performance problem I ever dealt with had to do with I/O overloading. Will see how this plays out. I am skeptical until I see some real world production benchmarks. &lt;br /&gt;
&lt;br /&gt;
5. Filtered Indexes. This is another feature that sounds great - will have to see how it plays out. Anyway, it allows you to create an index while specifying what rows are not to be in the index. For example, index all rows where Status != null. Theoretically, it&#39;ll get rid of all the dead weight in the index, allowing for faster queries. &lt;br /&gt;
&lt;br /&gt;
4. Resource governor. All I can say is FINALLY. Sybase has had it since version 12 (that&#39;s last millennium, people). Basically it allows the DBA to specify how much resources (e.g. CPU/RAM) each user is entitled to. At the very least, it&#39;ll prevent people, with sparse SQL knowledge from shooting off a query with a Cartesian product and bringing down the box. Actually Sybase is still ahead of MS on this feature. Its ASE server allows you to prioritize one user over another - a feature that I found immensely useful. &lt;br /&gt;
&lt;br /&gt;
3. Plan freezing. This is a solution to my personal pet peeve. Sometimes SQL Server decides to change its plan on you (in response to data changes, etc...). If you&#39;ve achieved your optimal query plan, now you can stick with it. Yeah, I know, hints are evil, but there are situations when you want to take a hammer to SQL Server - well, this is the chill pill. &lt;br /&gt;
&lt;br /&gt;
2. Processing of delimited strings. This is awesome and I could have used this feature...well, always. Currently, we pass in delimited strings in the following manner: exec sp_MySproc &#39;murphy,35;galen,31;samuels,27;colton,42&#39; Then the stored proc needs to parse the string into a usable form - a mindless task. In 2008, Microsoft introduced Table Value Parameters (TVP). CREATE TYPE PeepsType AS TABLE (Name varchar(20), Age int) DECLARE @myPeeps PeepsType INSERT @myPeeps SELECT &#39;murphy&#39;, 35 INSERT @myPeeps SELECT &#39;galen&#39;, 31 INSERT @myPeeps SELECT &#39;samuels&#39;, 27 INSERT @myPeeps SELECT &#39;colton&#39;, 42 exec sp_MySproc2 @myPeeps And the sproc would look like this: CREATE PROCEDURE sp_MySproc2(@myPeeps PeepsType READONLY) ... The advantage here is that you can treat the Table Type as a regular table, use it in joins, etc. Say goodbye to all those string parsing routines. &lt;br /&gt;
&lt;br /&gt;
1. Intellisense in the SQL Server Management Studio (SSMS). This has been previously possible in SQL Server 2000 and 2005 with use of 3rd party add-ins like SQL Prompt ($195). But these tools are a horrible hack at best (e.g. they hook into the editor window and try to interpret what the application is doing). Built-in intellisense is huge - it means new people can easily learn the database schema as they go. &lt;/div&gt;
</description><link>http://sqlpool.blogspot.com/2012/08/10-reasons-why-sql-server-2008-is-going.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-576045030163495591</guid><pubDate>Wed, 14 Mar 2012 14:32:00 +0000</pubDate><atom:updated>2012-03-14T07:35:50.328-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sharepoint</category><title>Sharepoint Solved Issues</title><description>&lt;strong&gt;Hiding field in SharePoint through JavaScript in Edit mode&lt;/strong&gt;&lt;br /&gt;1. Create one new list&lt;br /&gt;2. Open EditForm.aspx using sharepoint designer&lt;br /&gt;3. Copy the following javascript code before &lt;/asp:Content&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;br /&gt;function HideField(title){&lt;br /&gt;var header_h3=document.getElementsByTagName(&quot;h3&quot;) ;&lt;br /&gt;&lt;br /&gt;for(var i = 0; i &lt;header_h3.length; i++)&lt;br /&gt;{&lt;br /&gt;var el = header_h3[i];&lt;br /&gt;var foundField ;&lt;br /&gt;if(el.className==&quot;ms-standardheader&quot;)&lt;br /&gt;{&lt;br /&gt;for(var j=0; j&lt;el.childNodes.length; j++)&lt;br /&gt;{ &lt;br /&gt;if(el.childNodes[j].innerHTML == title || el.childNodes[j].nodeValue == title)&lt;br /&gt;{ &lt;br /&gt;var elRow = el.parentNode.parentNode ;&lt;br /&gt;elRow.style.display = &quot;none&quot;; //and hide the row&lt;br /&gt;foundField = true ;&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;} &lt;br /&gt;}&lt;br /&gt;if(foundField)&lt;br /&gt;break ;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;HideField(&quot;EmailID&quot;); // here give the required filed name&lt;br /&gt;HideField(&quot;Ext Num&quot;); // here give the required filed name&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;Ref link: http://www.sharepointkings.com/2009/10/hiding-field-in-sharepoint-through.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Hiding the &quot;Toolbar&quot; (New/Upload/Actions/Settings) for list or document&lt;/strong&gt;1. Open required list or document &lt;br /&gt;2. Click on &quot;Edit Page&quot; option using this navigation (Site Actions --&gt; Edit Page)&lt;br /&gt;3. Click &quot;Edit&quot; Option then click on &quot;Modify Shared Web Part&quot; &lt;br /&gt;4. Select &quot;No Toolbar&quot; option from Toolbar Type dropdown&lt;br /&gt;5. Click on apply and see the result&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Removing &quot;Upload Multiple Documnets&quot;&lt;/strong&gt;&lt;br /&gt;1. Open Allitems.aspx using sharepoint designer&lt;br /&gt;2. Copy the following javascript code between &lt;asp:Content ContentPlaceHolderId=&quot;PlaceHolderBodyAreaClass&quot; runat=&quot;server&quot;&gt; and  &lt;/asp:Content&gt;&lt;br /&gt;&lt;!-- Code for Remove &quot;Upload Multiple Documnets&quot;--&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;br /&gt;$(document).ready(function(){ &lt;br /&gt;   $(&quot;ie\\:menuitem[text=&#39;Upload Multiple Documents&#39;]&quot;).each(function(){&lt;br /&gt;       this.hidden=true;&lt;br /&gt;   });&lt;br /&gt;});&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;Ref link: http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/c603c25a-729b-4038-908d-3e8d8b5dfc39&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Setting List View Column Width in sharepoint&lt;/strong&gt;&lt;br /&gt;1. Open required list or document &lt;br /&gt;2. Click on &quot;Edit Page&quot; option using this navigation (Site Actions --&gt; Edit Page)&lt;br /&gt;3. Click on “Add a web part” and add “Content editor web part” from Miscellaneous part.&lt;br /&gt;4. Click &quot;Edit&quot; Option then click on &quot;Modify Shared Web Part&quot; &lt;br /&gt;5. Click on “Source Editor” button then copy the below code&lt;br /&gt;6. Here &#39;Client Name&#39; &amp; &#39;Overall Score&#39; are the column names, you can use your required column names here.&lt;br /&gt;&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;br /&gt;$(function(){&lt;br /&gt;$(&quot;TR.ms-viewheadertr TH:contains(&#39;Client Name&#39;)&quot;).css(&quot;width&quot;, &quot;50px&quot;);&lt;br /&gt;$(&quot;TR.ms-viewheadertr TH:contains(&#39;Overall Score&#39;)&quot;).css(&quot;width&quot;, &quot;50px&quot;);&lt;br /&gt;});&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;Ref link: http://kjellsj.blogspot.in/2009/06/sharepoint-jquery-setting-td-column.html</description><link>http://sqlpool.blogspot.com/2012/03/sharepoint-solves-issues.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-6928435793310073485</guid><pubDate>Sun, 30 Oct 2011 05:56:00 +0000</pubDate><atom:updated>2011-10-29T22:56:21.310-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Videos</category><title>Did you know? SQL Server 2008 includes GROUPING SETS</title><description>&lt;iframe src=&quot;http://player.vimeo.com/video/12291084?title=0&amp;amp;byline=0&amp;amp;portrait=0&quot; width=&quot;400&quot; height=&quot;300&quot; frameborder=&quot;0&quot; webkitAllowFullScreen allowFullScreen&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/12291084&quot;&gt;Did you know? SQL Server 2008 includes GROUPING SETS&lt;/a&gt;&lt;/p&gt;</description><link>http://sqlpool.blogspot.com/2011/10/did-you-know-sql-server-2008-includes_3794.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-660777273714927826</guid><pubDate>Sun, 30 Oct 2011 05:55:00 +0000</pubDate><atom:updated>2011-10-29T22:55:18.263-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Videos</category><title>Did you know? SQL Server 2008 includes Dimension Designer Enhancements</title><description>&lt;iframe src=&quot;http://player.vimeo.com/video/12290829?title=0&amp;amp;byline=0&amp;amp;portrait=0&quot; width=&quot;400&quot; height=&quot;285&quot; frameborder=&quot;0&quot; webkitAllowFullScreen allowFullScreen&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/12290829&quot;&gt;Did you know? SQL Server 2008 includes Dimension Designer Enhancements&lt;/a&gt;&lt;/p&gt;</description><link>http://sqlpool.blogspot.com/2011/10/did-you-know-sql-server-2008-includes_8863.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4552592939910167609.post-965788440589674218</guid><pubDate>Sun, 30 Oct 2011 05:54:00 +0000</pubDate><atom:updated>2011-10-29T22:54:37.616-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Videos</category><title>Did you know? SQL Server 2008 includes Intellisense</title><description>&lt;iframe src=&quot;http://player.vimeo.com/video/12291158?title=0&amp;amp;byline=0&amp;amp;portrait=0&quot; width=&quot;400&quot; height=&quot;285&quot; frameborder=&quot;0&quot; webkitAllowFullScreen allowFullScreen&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/12291158&quot;&gt;Did you know? SQL Server 2008 includes Intellisense&lt;/a&gt;&lt;/p&gt;</description><link>http://sqlpool.blogspot.com/2011/10/did-you-know-sql-server-2008-includes_7621.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item></channel></rss>