<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns: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'><id>tag:blogger.com,1999:blog-7883769006508081360</id><updated>2024-09-28T18:44:12.388-07:00</updated><category term="Select Statement"/><category term="SQL Server"/><category term="SQL Server 2005"/><category term="Sybase"/><category term="System Stored Procedures"/><category term="SQL Errors"/><category term="SQL Server 2008"/><category term="GetDate"/><category term="Stored Procedures"/><category term="T-SQL Errors"/><category term="Connection Strings"/><category term="DateDiff"/><category term="Mathematical Table in SQL Server"/><category term="Temporary Tables in SQL Server 2008"/><category term="UsingTOP"/><category term="While Loop in SQL Server"/><category term="While loop in T-SQL"/><category term="ADO Connection String"/><category term="ADO connection string for Access 2007 database with password"/><category term="Access 2007 ADO Connection String"/><category term="Adding Dates"/><category term="Append log files in Sybase"/><category term="Binary Sort in SQL SERVER"/><category term="British Date"/><category term="C Sharp Convert Text File (CSV) to XML file"/><category term="C# Get Files modified within a week"/><category term="CASE Function"/><category term="CASE Function Example"/><category term="Cannot insert the value NULL into column &#39;ID&#39;"/><category term="Change DataType of TimeStamp Column"/><category term="CharIndex function SQL SERVER"/><category term="Check for Valid Database Name"/><category term="Coalesce Function"/><category term="Column Names frol All Tables using SQL 2008 Query"/><category term="Compound Operators in SQL Server"/><category term="Computer Name from SQL"/><category term="Configure SQL Server Help"/><category term="Connection String"/><category term="Convert DataType of TimeStamp Column"/><category term="Create Cubes and Dimensions in SQL Server"/><category term="Create Log Files in Sybase"/><category term="Create Primary Key"/><category term="Create TimeStamp and Change TimeStamp in SQL"/><category term="Create XML files from CSV (Text) files using .NET (C#)"/><category term="DB Name Error"/><category term="DB Name Validity"/><category term="Data Types in SQL Server 2008"/><category term="Database Version"/><category term="Database users"/><category term="DateFormat"/><category term="DateName"/><category term="Dateadd"/><category term="Default Column values in SQL Server"/><category term="Default Values in SQL 2008"/><category term="Dictionary Sort in SQL SERVER"/><category term="Difference between GMT and Local"/><category term="Differences in Vulnerability between Oracle and SQL Server"/><category term="DirectoryInfo.GetFiles method in C#"/><category term="ETL"/><category term="Excel to SQL Server Table"/><category term="Extract files based on Size in LINQ"/><category term="Extract files greater than 1GB using LINQ"/><category term="Filter by FileSize using .NET"/><category term="Filter by FileSize using LINQ"/><category term="Filter files by Date using ."/><category term="Filter files by Date using C# GetFiles"/><category term="Filter files by date using DirectoryInfo"/><category term="Foriegn Key Relationships in SQL Server 2008"/><category term="Foriegn Key constraints in SQL Server 2008"/><category term="Formatting Date"/><category term="Free Download SQL Server 2008"/><category term="GMT"/><category term="Get Computer Name"/><category term="Get HOst Name"/><category term="GetUTCDate"/><category term="How to  Upgrade to SQL Server 2008"/><category term="How to Set Sleep Time in SQL Server"/><category term="How to find remainder using SQL functions"/><category term="How to get current time alone in SQL Server 2008"/><category term="How to set delay in SQL Server 2008"/><category term="Information_Schema Faulty"/><category term="Information_Schema and Stored Procedures"/><category term="Input Parameters Stored Procedures"/><category term="Katakana SQL SERVER"/><category term="LINQ List files based on Size"/><category term="LTRIM Function SQL Server"/><category term="Learn SQL Server 2005 Free CD or Download"/><category term="Link Columns to Tables"/><category term="List of All Columns in a database"/><category term="MAX_Connections"/><category term="Maximum Connections for SQL Server"/><category term="Maximum Level of Nesting"/><category term="Microsoft SQL Server Management Studio"/><category term="NestLevel"/><category term="New Data Types in SQL Server 2008"/><category term="No Records using Select Query"/><category term="No of Records for each group using Select Query"/><category term="Now Function in SQL Server"/><category term="Number Of Active Transactions"/><category term="Oracle is better than SQL Server"/><category term="Oracle versus SQL Server Comparison"/><category term="Output Parameters Stored Procedures"/><category term="Output text file Sybase"/><category term="Parameters used in Stored Procedures"/><category term="Recording Change time in SQL Server"/><category term="SQL  2008 Datetime2 Datatype"/><category term="SQL SERver Schema Creation Wizard"/><category term="SQL SErver Business Intelligence"/><category term="SQL SErver Modulo Operator"/><category term="SQL Server  Free CD"/><category term="SQL Server 2008 Auto Increment"/><category term="SQL Server 2008 Free Download"/><category term="SQL Server 2008 Select as Query"/><category term="SQL Server 2008 Upgrade Technical Reference Guide"/><category term="SQL Server Analytics"/><category term="SQL Server BI"/><category term="SQL Server CASE Function"/><category term="SQL Server Check Access to database"/><category term="SQL Server Collation"/><category term="SQL Server Compound Operators"/><category term="SQL Server Default Values"/><category term="SQL Server Free Download"/><category term="SQL Server Help"/><category term="SQL Server Import Excel"/><category term="SQL Server Management Studio"/><category term="SQL Server Next and Previous Buttons"/><category term="SQL Server Programming"/><category term="SQL Server TimeStamps"/><category term="SQL Server identity column"/><category term="SQL functions"/><category term="SQL to Find all the triggers for a Table"/><category term="SQL to XML in SQL Server 2008"/><category term="SQL_TABLE_VALUED_FUNCTION in SQL SErver 2008"/><category term="SSIS"/><category term="Save Query as XML"/><category term="Select Columns From All Tables"/><category term="Select Specific Columns and their corresponding tables"/><category term="Server Explorer not visible in Visual Studio"/><category term="Set Primary Key SQL Server 2008"/><category term="Sleep Function in SQL Server"/><category term="Substring Function SQL Server"/><category term="Subtracting Dates"/><category term="Sybase  systrigger"/><category term="Sybase Case Function"/><category term="Sybase Write Log"/><category term="Sybase Write To ASCII File"/><category term="Sybase Write To Text File"/><category term="Sys.Objects"/><category term="SysColumns"/><category term="System Tables"/><category term="TRANCOUNT"/><category term="Transact-SQL (T-SQL)"/><category term="Triggers and thier corresponding Tables"/><category term="Unable to change Identity Specification in SQL 2008"/><category term="Upgrade to SQL Server 2008"/><category term="User Access for DB"/><category term="User Information through Queries"/><category term="User Permissions for DB"/><category term="User Rights for DB"/><category term="Version"/><category term="Version of DB"/><category term="WITH TIES"/><category term="XML in SQL Server"/><category term="auto-increment column in SQL Server"/><category term="calculate Age using SQL Query"/><category term="datefirst"/><category term="monitoring sql server"/><category term="savepoint_name"/><category term="sp_monitor"/><category term="sp_who"/><category term="sql server operators"/><category term="sys.triggers"/><category term="sysusers"/><category term="table &#39;TeamDB1.dbo.PlayerDetails&#39;; column does not allow nulls. INSERT fails."/><category term="xp_cmdshell"/><category term="xp_msver"/><title type='text'>SQL Tips &amp;amp; Tricks</title><subtitle type='html'>Its all about structured query language (SQL) - SQL Query Snippets, LINQ Snippets, SQL Stored Procedures, SQL Server Articles, SQL Server Feeds, SQL Server Analytics, SQL Server Integration Services (SSIS), Microsoft SQL Server BIG DATA - HortonWorks, SQL Server CRM Integration</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>72</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-630479174162477894</id><published>2013-05-14T02:11:00.000-07:00</published><updated>2013-05-14T02:11:02.155-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Create Cubes and Dimensions in SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Analytics"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server BI"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL SErver Business Intelligence"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL SERver Schema Creation Wizard"/><title type='text'>How to Perform Analysis with SQL Server Analysis Services Project (Step by Step Instruction)</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;How to Create Cubes, Dimensions and Measures in SQL Server Business Intelligence &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
What is the use of data if it is not for Analysis. What is the use of RDBMS if it is not providing the Analytics functionality. Here we take a look at the SQL Services Project of SQL Server 2008&lt;br /&gt;
&lt;br /&gt;
There are multiple open source softwares like Pentaho / Jasper etc. that provide the functionality we will see below but nothing comes with the&amp;nbsp;ease&amp;nbsp;like&amp;nbsp;SSAS&lt;br /&gt;
&lt;br /&gt;
To start, open Business Intelligence Studio and create Analysis Services Project&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/AVvXsEjLUGy1-h_Bx-pgq-vdAC8IM0QZQgI9bCRIVsfJNkUlhwqh7Vqc-Sk50kbh6k52zJzzJNVjZ1tXtlrjObGwDOpoUzFK5DuEsGTLAbXkF6zOfQxH0JoWP7GoSdgJtJOryQX1xUU1nUeMOc0/s1600/SQL+Server+Analysis+Services+Project.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLUGy1-h_Bx-pgq-vdAC8IM0QZQgI9bCRIVsfJNkUlhwqh7Vqc-Sk50kbh6k52zJzzJNVjZ1tXtlrjObGwDOpoUzFK5DuEsGTLAbXkF6zOfQxH0JoWP7GoSdgJtJOryQX1xUU1nUeMOc0/s640/SQL+Server+Analysis+Services+Project.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;The wizard will create a project aling with required folders - Dimensions and Cubes the two most important of any Business Intelligence project&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/AVvXsEhQaeRbRPveaEBIL4YKX5dIvWG0jQKK3mCaV2pD75POSwsOcXvVoi3z-j-5PPPSTNo3YZArZlCekGdLCL6z1-ustA0e4n0IKLoKIuY9VfqHQtb99_A8FfOwjJz2ysTG_-pbCk3wYHGzY24/s1600/SQL+Server+Analysis+Services+Project+2+-+Project+Directory.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQaeRbRPveaEBIL4YKX5dIvWG0jQKK3mCaV2pD75POSwsOcXvVoi3z-j-5PPPSTNo3YZArZlCekGdLCL6z1-ustA0e4n0IKLoKIuY9VfqHQtb99_A8FfOwjJz2ysTG_-pbCk3wYHGzY24/s320/SQL+Server+Analysis+Services+Project+2+-+Project+Directory.png&quot; width=&quot;219&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Creating Cube is easy in SQL Server. Right click on Cubes and select New Cube - a beautiful Wizard will guide &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/AVvXsEjwDPo6Sxr6-lX_-yDD54XLXLkFW1H71BR4dPYBUQiBp6WTPCHrgxFbS_-6n7v7zCdGohJ77BOeswNfbbGJtmSsl2rxZ6L91LZ7jMcjbRtd90Q6tL_EG1jhnRQplpTmLRQM3rHpqo1X6Xg/s1600/SQL+Server+Analysis+Services+Project+3+-+Cube+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwDPo6Sxr6-lX_-yDD54XLXLkFW1H71BR4dPYBUQiBp6WTPCHrgxFbS_-6n7v7zCdGohJ77BOeswNfbbGJtmSsl2rxZ6L91LZ7jMcjbRtd90Q6tL_EG1jhnRQplpTmLRQM3rHpqo1X6Xg/s320/SQL+Server+Analysis+Services+Project+3+-+Cube+Wizard.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Select the Generate tables option &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/AVvXsEj118bEMSDc_62u2kMoALIHLk743Xhav4r57kg22DRXbIibwITOyQaT70mQxyM815CMSsrD2pTHNF7oTa8CMYj0hE-wFx1Gt4AcXpjYPHOwAyhEYbX9EFpC1ObNHbtktjBcm6VICk7zZe8/s1600/SQL+Server+Analysis+Services+Project+4+-+Cube+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj118bEMSDc_62u2kMoALIHLk743Xhav4r57kg22DRXbIibwITOyQaT70mQxyM815CMSsrD2pTHNF7oTa8CMYj0hE-wFx1Gt4AcXpjYPHOwAyhEYbX9EFpC1ObNHbtktjBcm6VICk7zZe8/s320/SQL+Server+Analysis+Services+Project+4+-+Cube+Wizard.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/AVvXsEg5vUByqMW6hdkcKJHolN0aErKvLxsJ-sdWT2GJKXEihErVJ-QlbgR0JLZ-oqAEFUfjDAO5DhEJO3cTLcfv5Xrq7yrhJsZayZfD50C1DzHoOOCKydKV-mrkvA8N3jhsaKtg5-TFr0SbFh8/s1600/SQL+Server+Analysis+Services+Project+5+-+Cube+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5vUByqMW6hdkcKJHolN0aErKvLxsJ-sdWT2GJKXEihErVJ-QlbgR0JLZ-oqAEFUfjDAO5DhEJO3cTLcfv5Xrq7yrhJsZayZfD50C1DzHoOOCKydKV-mrkvA8N3jhsaKtg5-TFr0SbFh8/s320/SQL+Server+Analysis+Services+Project+5+-+Cube+Wizard.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The below step helps you in Creating new Dimensions -&amp;nbsp;OLAP is all about measures (Facts and Dimensions)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;Facts and Dimensions in SQL Server&lt;/span&gt;&lt;/strong&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/AVvXsEhRsVO9GPhOqzixiEi4LcT2eb3Bs3s6IZ_eNAsT1JCkNgs4CbOzLtiCn5RuamDArhavzSztvs6rcUJH1Kx8npcwM6T8qFAbFNtb8Mk44TCKwJeCE3aNZr31LUdcxM0okTCrYRD9UtaMjNQ/s1600/SQL+Server+Analysis+Services+Project+6+-+Cube+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRsVO9GPhOqzixiEi4LcT2eb3Bs3s6IZ_eNAsT1JCkNgs4CbOzLtiCn5RuamDArhavzSztvs6rcUJH1Kx8npcwM6T8qFAbFNtb8Mk44TCKwJeCE3aNZr31LUdcxM0okTCrYRD9UtaMjNQ/s320/SQL+Server+Analysis+Services+Project+6+-+Cube+Wizard.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Time dimension is created and filled automatically by SQL Server based on settings&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/AVvXsEiUpvKb_YFZS1YcKUxGZ7Uas7j-s3eOhwOf_NRfxA73voMgo1wD4sO9Dniraqu0-xl4uWo3cbwr-0MDl77TuPm_QdxJZfUyb-6viWD-ImSKAV4AH0E-_PkAnFngSrG4NyM7e2rOw3aWHEM/s1600/SQL+Server+Analysis+Services+Project+7+-+Cube+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUpvKb_YFZS1YcKUxGZ7Uas7j-s3eOhwOf_NRfxA73voMgo1wD4sO9Dniraqu0-xl4uWo3cbwr-0MDl77TuPm_QdxJZfUyb-6viWD-ImSKAV4AH0E-_PkAnFngSrG4NyM7e2rOw3aWHEM/s320/SQL+Server+Analysis+Services+Project+7+-+Cube+Wizard.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/AVvXsEgrmFUUX-pXGMCmsy-1xVc_iDH6LyyAq0kLlM7yulNfsgfm1rLhDUl3yUo3C4GeHmYK70lHvOjfdMJBn9Lsv_FWVzqdirBneBelT8b5zy6qymh4qQmX8BkfY_eCw21AFQKTjYsZnfWZZPg/s1600/SQL+Server+Analysis+Services+Project+8+-+Define+Dimension+Usage.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrmFUUX-pXGMCmsy-1xVc_iDH6LyyAq0kLlM7yulNfsgfm1rLhDUl3yUo3C4GeHmYK70lHvOjfdMJBn9Lsv_FWVzqdirBneBelT8b5zy6qymh4qQmX8BkfY_eCw21AFQKTjYsZnfWZZPg/s320/SQL+Server+Analysis+Services+Project+8+-+Define+Dimension+Usage.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/AVvXsEhVKuYPyMaOV-p2jW2we_DLU0Lj2RuiasYzVclXX46ZpgNARNzd_tEUW48kDaKeOVT0iYyD9btInKFj0Z_bMceNp01FsuQmsmxCJLgjyvmcTExIvPVPJvzDCe1iF2ejkKdgZXb6iWgCi_s/s1600/SQL+Server+Analysis+Services+Project+9+-+Review+Cube+and+Schema.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVKuYPyMaOV-p2jW2we_DLU0Lj2RuiasYzVclXX46ZpgNARNzd_tEUW48kDaKeOVT0iYyD9btInKFj0Z_bMceNp01FsuQmsmxCJLgjyvmcTExIvPVPJvzDCe1iF2ejkKdgZXb6iWgCi_s/s320/SQL+Server+Analysis+Services+Project+9+-+Review+Cube+and+Schema.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;The above figure shows the measures and dimensions created by SQL SERVER. &lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Now we have the logical data model, we can create the Schema . &lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;SQL SERver Schema Creation Wizard&lt;/strong&gt;&lt;/span&gt; helps to&amp;nbsp; create the required schema&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/AVvXsEhLTyQssWV0RPXlR8Alwc4U72tKcSAebvvfW0mKAKXLUmyJdy8Y6oB-_gQaylx-geTlXUJSUn_Jo3znvs6uu6J39CUUnbi5UE9cbp_PTg2HSmUcs3qULmIk6b4q8gsd2SSYT2TzF8l0FSo/s1600/SQL+Server+Analysis+Services+Project+10+-+Schema+Generation+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLTyQssWV0RPXlR8Alwc4U72tKcSAebvvfW0mKAKXLUmyJdy8Y6oB-_gQaylx-geTlXUJSUn_Jo3znvs6uu6J39CUUnbi5UE9cbp_PTg2HSmUcs3qULmIk6b4q8gsd2SSYT2TzF8l0FSo/s320/SQL+Server+Analysis+Services+Project+10+-+Schema+Generation+Wizard.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/AVvXsEg3vWSLTNu349qvxBnRR6iDxK9ywBZJCEdzdTWVMpZrjbvmgoLk8Ho9Sy0VW8bK5lCKzhjNQfolPM1SBRFaUpJnbuFEzbxKzOLL7pCCJt-MvPJFVlucfgO4vbpwaqpHDRQin4Yc8SiBe0k/s1600/SQL+Server+Analysis+Services+Project+11+-+Data+Source+Wizard.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;310&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3vWSLTNu349qvxBnRR6iDxK9ywBZJCEdzdTWVMpZrjbvmgoLk8Ho9Sy0VW8bK5lCKzhjNQfolPM1SBRFaUpJnbuFEzbxKzOLL7pCCJt-MvPJFVlucfgO4vbpwaqpHDRQin4Yc8SiBe0k/s320/SQL+Server+Analysis+Services+Project+11+-+Data+Source+Wizard.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/AVvXsEj2KMWQWmTiWO9DpjNDlLZf4N3f3yPZ7anrAl1Lnr1oNSzc8MoMIk5NpzqNM8ZioDt7JdnW4ZHQg3CGAne1xT0H7ckwNTnA1NiVbnD03b-QjWHfwFk9-7mRjPS2YBWrVaUELJjSEk1dGrk/s1600/SQL+Server+Analysis+Services+Project+12+-+Schema+Generation+Progress.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/AVvXsEj2KMWQWmTiWO9DpjNDlLZf4N3f3yPZ7anrAl1Lnr1oNSzc8MoMIk5NpzqNM8ZioDt7JdnW4ZHQg3CGAne1xT0H7ckwNTnA1NiVbnD03b-QjWHfwFk9-7mRjPS2YBWrVaUELJjSEk1dGrk/s320/SQL+Server+Analysis+Services+Project+12+-+Schema+Generation+Progress.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/AVvXsEhKS98F1APCRbFKdgbG2JiA6EOwnvuh0ZHlnrV2PxxIvwZMSwIFC_1yARnG5FW_vm26oLWpwebs7VpETQL_ZTaqHK_9_soWYSV4dsv8jBbcUa-zy_H53dH7HVVNO1gVWr0gx60DiY2_MyI/s1600/SQL+Server+Analysis+Services+Project+13+-+Sales+Cube+Final.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKS98F1APCRbFKdgbG2JiA6EOwnvuh0ZHlnrV2PxxIvwZMSwIFC_1yARnG5FW_vm26oLWpwebs7VpETQL_ZTaqHK_9_soWYSV4dsv8jBbcUa-zy_H53dH7HVVNO1gVWr0gx60DiY2_MyI/s320/SQL+Server+Analysis+Services+Project+13+-+Sales+Cube+Final.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/AVvXsEig1GLMC_SZyNZ_FxGp6VPgJUHV4NrM1-OHRdH974gd0_0Zx-E0XySKkTk2MvSlfuaU0y0CuV3oc-RN8vA35oS1KqwBmUfyAIZ69tyT_MKN9kfBLJvg70BEQDxRtReibpYe2IYqbr7Emy8/s1600/SQl+Server+2012.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;96&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig1GLMC_SZyNZ_FxGp6VPgJUHV4NrM1-OHRdH974gd0_0Zx-E0XySKkTk2MvSlfuaU0y0CuV3oc-RN8vA35oS1KqwBmUfyAIZ69tyT_MKN9kfBLJvg70BEQDxRtReibpYe2IYqbr7Emy8/s320/SQl+Server+2012.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/630479174162477894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/630479174162477894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/630479174162477894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/630479174162477894'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2013/05/how-to-perform-analysis-with-sql-server.html' title='How to Perform Analysis with SQL Server Analysis Services Project (Step by Step Instruction)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLUGy1-h_Bx-pgq-vdAC8IM0QZQgI9bCRIVsfJNkUlhwqh7Vqc-Sk50kbh6k52zJzzJNVjZ1tXtlrjObGwDOpoUzFK5DuEsGTLAbXkF6zOfQxH0JoWP7GoSdgJtJOryQX1xUU1nUeMOc0/s72-c/SQL+Server+Analysis+Services+Project.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-2142901662504579214</id><published>2013-05-08T21:22:00.000-07:00</published><updated>2013-05-08T21:22:38.278-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ETL"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="SSIS"/><title type='text'>How to import Large files (TXT / CSV) to SQL Server 2008 using SSIS</title><content type='html'>&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/AVvXsEiY8xBklqFG32lzan9BXg_2hyU4Q7VyaVVn-vMNUWZe4UlEpjDfsMtbUT32CevnL6QatbklpNRQo4C8Jpj1iA5-gnRG_hJmF13w_l1hSw1Q5_z4KvLQD-CCsZGkVym-1lxtbitLXusepdQ/s1600/SQL+Server+Load+Files+Import+Large+Files+using+SSIS.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;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8xBklqFG32lzan9BXg_2hyU4Q7VyaVVn-vMNUWZe4UlEpjDfsMtbUT32CevnL6QatbklpNRQo4C8Jpj1iA5-gnRG_hJmF13w_l1hSw1Q5_z4KvLQD-CCsZGkVym-1lxtbitLXusepdQ/s320/SQL+Server+Load+Files+Import+Large+Files+using+SSIS.png&quot; width=&quot;239&quot; /&gt;&amp;nbsp;SQL Server&#39;s Integration Services provides the functionality to laod&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This can be done from the SQL Server
by selecting the integration services project
&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/AVvXsEjtQKWRv2WWbrcFGmSX4bRkYnsHQFzpMH62MtSNkQ7OqiPLxC02UPKpA_CsNAQRWj5QUUXEEBZOmsLXwP6SlwrANyQWbZli0W6x21lL3ZWdc9DAuJZFsHPfeYvceIJtHdj58ZZtmchaAZA/s1600/SQL+Server+Load+Files+Import+Large+Files+using+SSIS+3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtQKWRv2WWbrcFGmSX4bRkYnsHQFzpMH62MtSNkQ7OqiPLxC02UPKpA_CsNAQRWj5QUUXEEBZOmsLXwP6SlwrANyQWbZli0W6x21lL3ZWdc9DAuJZFsHPfeYvceIJtHdj58ZZtmchaAZA/s640/SQL+Server+Load+Files+Import+Large+Files+using+SSIS+3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
The following

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4h9wb1n_W5VIJkdDsBm8HNBHNj3UZPFBKvPaSzl7XZTysI50ZdVftPJqWTCRNbDrfD4dBNhyTiy9YZoH0mikQn3iPj7BCbRtZlpDdpx8q1QvarAKlw2ux7eLoLpC5xrU0sm-C2l6xjQg/s1600/SQL+Server+Load+Files+Import+Large+Files+using+SSIS+s.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4h9wb1n_W5VIJkdDsBm8HNBHNj3UZPFBKvPaSzl7XZTysI50ZdVftPJqWTCRNbDrfD4dBNhyTiy9YZoH0mikQn3iPj7BCbRtZlpDdpx8q1QvarAKlw2ux7eLoLpC5xrU0sm-C2l6xjQg/s320/SQL+Server+Load+Files+Import+Large+Files+using+SSIS+s.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/2142901662504579214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/2142901662504579214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/2142901662504579214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/2142901662504579214'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2013/05/how-to-import-large-files-txt-csv-to.html' title='How to import Large files (TXT / CSV) to SQL Server 2008 using SSIS'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8xBklqFG32lzan9BXg_2hyU4Q7VyaVVn-vMNUWZe4UlEpjDfsMtbUT32CevnL6QatbklpNRQo4C8Jpj1iA5-gnRG_hJmF13w_l1hSw1Q5_z4KvLQD-CCsZGkVym-1lxtbitLXusepdQ/s72-c/SQL+Server+Load+Files+Import+Large+Files+using+SSIS.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-6551096350592540265</id><published>2012-09-10T01:37:00.003-07:00</published><updated>2012-09-10T01:37:55.993-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel to SQL Server Table"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Import Excel"/><title type='text'>How to import CSV / Excel file to SQL Server Table </title><content type='html'>How to Load Excel File / CSV File to a SQL Server Table / Create SQL Server Table from Excel File&lt;br /&gt;
&lt;br /&gt;
Step 1: Select Import and Export Wizard from Program&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZeeniy-quANMsdLRFffrgVyMh58_x6gmzgEDxzaXaehDc9BimHJv3XQ-JjLn11Yj1Cw95acrQrkn0RFWN69UpUJgAhaQ4hf-HEOA805A-TkqHtNQB5TuQWVIop8V4ASX3Nh9VlmIsJRM/s1600/SQL+Server+2008+-+Import+From+Excel+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;235&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZeeniy-quANMsdLRFffrgVyMh58_x6gmzgEDxzaXaehDc9BimHJv3XQ-JjLn11Yj1Cw95acrQrkn0RFWN69UpUJgAhaQ4hf-HEOA805A-TkqHtNQB5TuQWVIop8V4ASX3Nh9VlmIsJRM/s320/SQL+Server+2008+-+Import+From+Excel+1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Step 2: Select Import and Export Wizard from Program&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/AVvXsEiZxpgbSvsBECPgzFzfx8ydSVX9cXnWcA3A2DiK0V3bqjzlfPusTOJLq21lzdFH4OX4NRarx5B8BrPxr7KpuqdXuTKwj4irXcwuUxzKjVuPVzNOfLN4SUldwFIkf5tg1BmL5qOskktMQuU/s1600/SQL+Server+2008+-+Import+From+Excel+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZxpgbSvsBECPgzFzfx8ydSVX9cXnWcA3A2DiK0V3bqjzlfPusTOJLq21lzdFH4OX4NRarx5B8BrPxr7KpuqdXuTKwj4irXcwuUxzKjVuPVzNOfLN4SUldwFIkf5tg1BmL5qOskktMQuU/s320/SQL+Server+2008+-+Import+From+Excel+2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Step 3: Select Flat File as Source&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/AVvXsEgqSPHxJLHNCFHmqo0psREjCWMmgWHa-zuEcvKRlC0499ts5-KL_J_ocZcLlcyAJ_WLcOh3l6OZlLg5sgWad8tMcODu14M9khjA_nJUMHNT9Lo1RsMnZnqeh1FoTjP4yBM9GERN1R_S0qg/s1600/SQL+Server+2008+-+Import+From+Excel+3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;336&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqSPHxJLHNCFHmqo0psREjCWMmgWHa-zuEcvKRlC0499ts5-KL_J_ocZcLlcyAJ_WLcOh3l6OZlLg5sgWad8tMcODu14M9khjA_nJUMHNT9Lo1RsMnZnqeh1FoTjP4yBM9GERN1R_S0qg/s640/SQL+Server+2008+-+Import+From+Excel+3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Step 4: Select the CSV / Text file&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/AVvXsEjPLPAfKKbyUpsPOL6LysmaI5-1M1eglZluavgDW7Js1IX9KVD8NgN_Lrc9qucSUrzz7OWV225m1_yKCTvDQuoyWyiZwASG8TQ5nn4rHdClQ4yJvJWHJvUZ1Hp2jcsmkm171Do83c658Ow/s1600/SQL+Server+2008+-+Import+From+Excel+4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPLPAfKKbyUpsPOL6LysmaI5-1M1eglZluavgDW7Js1IX9KVD8NgN_Lrc9qucSUrzz7OWV225m1_yKCTvDQuoyWyiZwASG8TQ5nn4rHdClQ4yJvJWHJvUZ1Hp2jcsmkm171Do83c658Ow/s640/SQL+Server+2008+-+Import+From+Excel+4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Step 5: Choose the Server&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/AVvXsEgzeZxfpHN6wCBHJUN_TC8UOwbXbfQS91f7JvVJQPArW-zMyLPlnEIxKr4QnhzwiFlbIrFkIGemQsNm_jWfbVC-HwXxauFOLWIJ9Qbz1luj7u8X1ejJgxfgmLC7o7sxVXo1hnXzLiJsN6k/s1600/SQL+Server+2008+-+Import+From+Excel+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzeZxfpHN6wCBHJUN_TC8UOwbXbfQS91f7JvVJQPArW-zMyLPlnEIxKr4QnhzwiFlbIrFkIGemQsNm_jWfbVC-HwXxauFOLWIJ9Qbz1luj7u8X1ejJgxfgmLC7o7sxVXo1hnXzLiJsN6k/s640/SQL+Server+2008+-+Import+From+Excel+5.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Step 6: Choose Database&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/AVvXsEia0eBEVvbsgB9Qt1hQOo__iMMFRTAzYLmLPS3DmCr0uB7ARJVN_JmzFilG-nNQqRfKrm8D7xhlRO9OGvf4FRWrdull4lVe_YZQgOhLV2MXlg_YOtqVh9Gy222j0XPsS8vhhbeBPVK5_l4/s1600/SQL+Server+2008+-+Import+From+Excel+5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia0eBEVvbsgB9Qt1hQOo__iMMFRTAzYLmLPS3DmCr0uB7ARJVN_JmzFilG-nNQqRfKrm8D7xhlRO9OGvf4FRWrdull4lVe_YZQgOhLV2MXlg_YOtqVh9Gy222j0XPsS8vhhbeBPVK5_l4/s640/SQL+Server+2008+-+Import+From+Excel+5.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Step 7: Specify Schema and Table Names&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/AVvXsEhqCxQUYhtxuHnH5p2D51ZV-kMfm220LRAc-QLIQGnz0I-b5rdj0A6jbl5aQCv2WybF5IZc16fMai2nTibT1ZAKV_3w5i4AdVMWRiUCzJ-RCXbJUSTo4FeOu-mttn-5LyZnR6-nQsThEJs/s1600/SQL+Server+2008+-+Import+From+Excel+6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;336&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqCxQUYhtxuHnH5p2D51ZV-kMfm220LRAc-QLIQGnz0I-b5rdj0A6jbl5aQCv2WybF5IZc16fMai2nTibT1ZAKV_3w5i4AdVMWRiUCzJ-RCXbJUSTo4FeOu-mttn-5LyZnR6-nQsThEJs/s640/SQL+Server+2008+-+Import+From+Excel+6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Step 8: Run the Pachage&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/AVvXsEgCjDxBhYNNbgcuN3E8RXz3_93cdmGz0RnkTd0ZWt9uD4dfxH9In88PMiRNwhPaaIiJ1aMuDkZBcd72WYhFEtMkOVMw2QDMHCqidkR4uDIRwwu7iF-uS_EFJl3pbmYdx5NC82er0fTey7E/s1600/SQL+Server+2008+-+Import+From+Excel+7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;336&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCjDxBhYNNbgcuN3E8RXz3_93cdmGz0RnkTd0ZWt9uD4dfxH9In88PMiRNwhPaaIiJ1aMuDkZBcd72WYhFEtMkOVMw2QDMHCqidkR4uDIRwwu7iF-uS_EFJl3pbmYdx5NC82er0fTey7E/s640/SQL+Server+2008+-+Import+From+Excel+7.png&quot; width=&quot;640&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/AVvXsEjZeeniy-quANMsdLRFffrgVyMh58_x6gmzgEDxzaXaehDc9BimHJv3XQ-JjLn11Yj1Cw95acrQrkn0RFWN69UpUJgAhaQ4hf-HEOA805A-TkqHtNQB5TuQWVIop8V4ASX3Nh9VlmIsJRM/s1600/SQL+Server+2008+-+Import+From+Excel+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/6551096350592540265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/6551096350592540265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6551096350592540265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6551096350592540265'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/09/how-to-import-csv-excel-file-to-sql.html' title='How to import CSV / Excel file to SQL Server Table '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZeeniy-quANMsdLRFffrgVyMh58_x6gmzgEDxzaXaehDc9BimHJv3XQ-JjLn11Yj1Cw95acrQrkn0RFWN69UpUJgAhaQ4hf-HEOA805A-TkqHtNQB5TuQWVIop8V4ASX3Nh9VlmIsJRM/s72-c/SQL+Server+2008+-+Import+From+Excel+1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-8571896546487364236</id><published>2012-09-10T00:39:00.002-07:00</published><updated>2012-09-10T00:39:40.655-07:00</updated><title type='text'>Specified column precision 50 is greater than the maximum precision of 38.</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;What is the Preferred Data Type for Price and Amount Fields&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This error occurs when you are trying to define a Decimal field with precision more than 38. If you would require more precission, please use any of the following:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; [Sales Price] [Numeric]&lt;/span&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&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 style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;2&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;NULL,&lt;/span&gt;&lt;/span&gt;&lt;br /&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; [Quantity] [int]&lt;/span&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&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 style=&quot;color: grey; font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;NULL,&lt;/span&gt;&lt;/span&gt;&lt;br /&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; [Amount] [Numeric]&lt;/span&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&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 style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;2&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;NULL,&lt;/span&gt;&lt;/span&gt;&lt;br /&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&gt;&lt;/span&gt;&lt;br /&gt;
Money&lt;br /&gt;
Float&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
CREATE TABLE [dbo].[Transact.Details](
&lt;br /&gt;
 [Store ID] [varchar](50) NULL,
&lt;br /&gt;
 [Customer ID] [varchar](50) NULL,
&lt;br /&gt;
 [Transaction ID] [varchar](50) NULL,
&lt;br /&gt;
 [Transaction Date] [varchar](50) NULL,
&lt;br /&gt;
 [Category ID] [varchar](50) NULL,
&lt;br /&gt;
 [Item ID] [varchar](50) NULL,
&lt;br /&gt;
 [Sales Price] [Numeric](38,2) NULL,
&lt;br /&gt;
 [Quantity] [int] NULL,
&lt;br /&gt;
 [Amount] [Numeric](38,2) NULL,
&lt;br /&gt;
) ON [PRIMARY]
&lt;br /&gt;
&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/8571896546487364236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/8571896546487364236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8571896546487364236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8571896546487364236'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/09/specified-column-precision-50-is.html' title='Specified column precision 50 is greater than the maximum precision of 38.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-6243127316531266327</id><published>2012-07-08T06:54:00.002-07:00</published><updated>2012-07-08T06:54:48.823-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="xp_cmdshell"/><title type='text'>SQL Server blocked access to procedure &#39;sys.xp_cmdshell&#39; of component &#39;xp_cmdshell&#39; because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of &#39;xp_cmdshell&#39; by using sp_configure. For more information about enabling &#39;xp_cmdshell&#39;, see &quot;Surface Area Configuration&quot; in SQL Server Books Online.</title><content type='html'>The error occurs when I try to run the BCP utility&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;/span&gt;

SQL Server blocked access to procedure &#39;sys.xp_cmdshell&#39; of component &#39;xp_cmdshell&#39; because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of &#39;xp_cmdshell&#39; by using sp_configure. For more information about enabling &#39;xp_cmdshell&#39;, see &quot;Surface Area Configuration&quot; in SQL Server Books Online.</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/6243127316531266327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/6243127316531266327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6243127316531266327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6243127316531266327'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/07/sql-server-blocked-access-to-procedure.html' title='SQL Server blocked access to procedure &#39;sys.xp_cmdshell&#39; of component &#39;xp_cmdshell&#39; because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of &#39;xp_cmdshell&#39; by using sp_configure. For more information about enabling &#39;xp_cmdshell&#39;, see &quot;Surface Area Configuration&quot; in SQL Server Books Online.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-6008234227878477052</id><published>2012-07-08T05:49:00.002-07:00</published><updated>2012-07-08T05:49:52.084-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Save Query as XML"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 Select as Query"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL to XML in SQL Server 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="XML in SQL Server"/><title type='text'>How to Export Query as XML - SQL Server 2008</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;Save Recordset as XML using Select Query in SQL Server 2008&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Let us consider the a table (shown below) with couple of columns that needs to be exported as XML﻿&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/AVvXsEgkO4QH6PedE_ffbEa9R8MaGvhhQ8mBlFPq72pfJEXn70K3dmKmrcWI5-_MLUEVLNofqzC0cksMVlucNFUWtnlJ0IZtkyMTmtvgX0ijMRxBRVlG3ntPbzSagGM2-NHPXTAMBm3wnPDbwfs/s1600/SQL+Server+2008+-+Export+Query+as+XML+1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;462&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkO4QH6PedE_ffbEa9R8MaGvhhQ8mBlFPq72pfJEXn70K3dmKmrcWI5-_MLUEVLNofqzC0cksMVlucNFUWtnlJ0IZtkyMTmtvgX0ijMRxBRVlG3ntPbzSagGM2-NHPXTAMBm3wnPDbwfs/s640/SQL+Server+2008+-+Export+Query+as+XML+1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The following query &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;TOP&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1000 [TrainID] &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;TrainNum&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[TrainName]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; [OnlineTrans]&lt;/span&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&gt;&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 style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[TrainMaster] &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;XML&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;PATH&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Is used for&amp;nbsp;generating a XML&amp;nbsp; &lt;/span&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/AVvXsEgAH1yqcqj_2Moiw2Q4fbR8v9cqToKQ1SWzCHF5ZwoKAF4Ape97-0ZAOAg_biuWTLqqtQdMP8hTOwGQvALvt8Zm8j9DjtRKbN-q2U4X5eFNv-NevOmNDnqN8ttA1nyCOnG6gOj9Npu9UPc/s1600/SQL+Server+2008+-+Export+Query+as+XML+2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAH1yqcqj_2Moiw2Q4fbR8v9cqToKQ1SWzCHF5ZwoKAF4Ape97-0ZAOAg_biuWTLqqtQdMP8hTOwGQvALvt8Zm8j9DjtRKbN-q2U4X5eFNv-NevOmNDnqN8ttA1nyCOnG6gOj9Npu9UPc/s640/SQL+Server+2008+-+Export+Query+as+XML+2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;On the other hand, If you want to have a meaningfully named element instead of &lt;row&gt;, you need to specify the same in the query. The following query has the row element as well as the root element&lt;/row&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;TOP&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; 1000 [TrainID] &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;TrainNum&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&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;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;      &lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[TrainName]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; [OnlineTrans]&lt;/span&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&gt;&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 style=&quot;color: grey; font-size: x-small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[TrainMaster] &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;XML&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;path &lt;/span&gt;&lt;/span&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&gt;&lt;/span&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;TrainInfo&#39;&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;root &lt;/span&gt;&lt;/span&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&gt;&lt;/span&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;ParentInfo&#39;&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&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&gt;&lt;/span&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/AVvXsEhx6TgrDigOfBlZYLvoLzQNi75f8RbbbAZsl4xaLWO5y5VWEUS0A3pKY9CJk5vlJbqhFPuquD36OdZaMQyyfBis_e6zekVOyT2lfbDz1Dw9ywIpH9pqLgYL1BLTDt6laN9Q1EMVdwNSlYM/s1600/SQL+Server+2008+-+Export+Query+as+XML+3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;328&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx6TgrDigOfBlZYLvoLzQNi75f8RbbbAZsl4xaLWO5y5VWEUS0A3pKY9CJk5vlJbqhFPuquD36OdZaMQyyfBis_e6zekVOyT2lfbDz1Dw9ywIpH9pqLgYL1BLTDt6laN9Q1EMVdwNSlYM/s640/SQL+Server+2008+-+Export+Query+as+XML+3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/6008234227878477052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/6008234227878477052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6008234227878477052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6008234227878477052'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/07/how-to-export-query-as-xml-sql-server.html' title='How to Export Query as XML - SQL Server 2008'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkO4QH6PedE_ffbEa9R8MaGvhhQ8mBlFPq72pfJEXn70K3dmKmrcWI5-_MLUEVLNofqzC0cksMVlucNFUWtnlJ0IZtkyMTmtvgX0ijMRxBRVlG3ntPbzSagGM2-NHPXTAMBm3wnPDbwfs/s72-c/SQL+Server+2008+-+Export+Query+as+XML+1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-5567743377108724457</id><published>2012-05-06T08:21:00.002-07:00</published><updated>2012-05-06T08:21:48.574-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Errors"/><category scheme="http://www.blogger.com/atom/ns#" term="T-SQL Errors"/><category scheme="http://www.blogger.com/atom/ns#" term="Temporary Tables in SQL Server 2008"/><title type='text'>&#39;int&#39; is not a recognized CURSOR option.</title><content type='html'>&lt;div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;This error occurs when a variable name is preceded by # instead of @. # is used to declare temporary table &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt; #myi &lt;span style=&quot;color: blue;&quot;&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;Should be replaced by&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt; @myi &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/5567743377108724457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/5567743377108724457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/5567743377108724457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/5567743377108724457'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/05/int-is-not-recognized-cursor-option.html' title='&#39;int&#39; is not a recognized CURSOR option.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-8843029634497332713</id><published>2012-05-06T08:21:00.001-07:00</published><updated>2012-05-06T08:21:37.904-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mathematical Table in SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="While Loop in SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="While loop in T-SQL"/><title type='text'>While Loop in SQL Server</title><content type='html'>&lt;div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;color: red; font-family: Calibri;&quot;&gt;&lt;strong&gt;While loop in T-SQL&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Here is a simple example of While loop&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;Declare&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt; @temp &lt;span style=&quot;color: blue;&quot;&gt;tinyint&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;while &lt;/span&gt;&lt;span style=&quot;color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;@temp &lt;span style=&quot;color: grey;&quot;&gt;&amp;lt;&lt;/span&gt; 11&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;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;begin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;cast&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@temp &lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;varchar&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;2&lt;span style=&quot;color: grey;&quot;&gt;))&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39; X 2 = &#39;&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;cast&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;@temp &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; 2 &lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;char&lt;/span&gt;&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;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;      &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt; @temp &lt;span style=&quot;color: grey;&quot;&gt;+=&lt;/span&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;The above code will be having the following output:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;Output&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;1 X 2 = 2&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;2 X 2 = 4&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;3 X 2 = 6&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;4 X 2 = 8&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                             &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;5 X 2 = 10&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;6 X 2 = 12&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;7 X 2 = 14&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;8 X 2 = 16&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;9 X 2 = 18&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 8pt; mso-fareast-language: EN-IN; mso-no-proof: yes;&quot;&gt;10 X 2 = 20&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;
&lt;o:p&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/8843029634497332713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/8843029634497332713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8843029634497332713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8843029634497332713'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/05/while-loop-in-sql-server.html' title='While Loop in SQL Server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-5944007826015234525</id><published>2012-05-06T08:21:00.000-07:00</published><updated>2012-05-06T08:21:24.979-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL_TABLE_VALUED_FUNCTION in SQL SErver 2008"/><title type='text'>How to create a SQL Function that Returns a Table</title><content type='html'>&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;SQL Create Table Valued Function (SQL SERVER 2008) / How to Create SQL_TABLE_VALUED_FUNCTION&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The following snippet uses a Table variable to create a table and inserts value into it, which the function returns&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;SQL&quot; name=&quot;code&quot;&gt;CREATE FUNCTION ReturnATable()
RETURNS @TabVar TABLE
(
 OrderID int not null,
 OrderDate datetime,
 OrderStatus bit,
 OrderValue decimal,
 BilledBy varchar(20)
)
AS
BEGIN
DEclare @Date datetime ;
Set @Date= GETDATE();
Insert Into @TabVar values
(21, @Date , 1, 212.42, &#39;Jose&#39;);
return 
END
&lt;/pre&gt;
&lt;br /&gt;
The function can be executed as shown below&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;sql&quot; name=&quot;code&quot;&gt;Select * from ReturnATable()
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/5944007826015234525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/5944007826015234525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/5944007826015234525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/5944007826015234525'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2012/05/how-to-create-sql-function-that-returns.html' title='How to create a SQL Function that Returns a Table'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-372669506961658567</id><published>2011-09-05T20:12:00.000-07:00</published><updated>2011-09-05T20:12:35.109-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Column Names frol All Tables using SQL 2008 Query"/><category scheme="http://www.blogger.com/atom/ns#" term="List of All Columns in a database"/><category scheme="http://www.blogger.com/atom/ns#" term="SysColumns"/><title type='text'>How to get Column Names of All Tables in a database through SQL Query / SysTables in SQL Server 2008</title><content type='html'>&lt;span style=&quot;color: red;&quot;&gt;How to list all tables and each table, loop through each column using SQL query&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
It is not uncommon to get the list of all column names from all available tables; at times some valuable information peeps out when one researches it. The following query will get you exactly that&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;select &lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;syscolumns&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ColumnName&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sysobjects&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;name &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;as&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; TableName &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;syscolumns&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sysobjects&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;where&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sysobjects&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;id &lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;syscolumns&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;id &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;br /&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;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/372669506961658567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/372669506961658567' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/372669506961658567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/372669506961658567'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/09/how-to-get-column-names-of-all-tables.html' title='How to get Column Names of All Tables in a database through SQL Query / SysTables in SQL Server 2008'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-8154115518443090862</id><published>2011-06-03T01:11:00.000-07:00</published><updated>2011-06-03T01:11:11.195-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CharIndex function SQL SERVER"/><category scheme="http://www.blogger.com/atom/ns#" term="LTRIM Function SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Substring Function SQL Server"/><title type='text'>How to Split SQL String to Multiple String using Delimiter</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;How to check if a text exists within another in SQL Server 2008 / How to split SQL Column based on Comma&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
You can use the combination of CharIndex and Substring function in SQL to split the string based on delimiter.&lt;br /&gt;
&lt;br /&gt;
Here is a way to split&amp;nbsp;a column based on Comma&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;Select&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;LTRIM&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;SUBSTRING&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;EmpAddress&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;CHARINDEX&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;,&#39;&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;EmpAddress&lt;/span&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&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 style=&quot;color: grey; font-size: x-small;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: x-small;&quot;&gt;len&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;EmpAddress&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; #TempEmployee&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
We have used Ltrim to remove any leading spaces</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/8154115518443090862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/8154115518443090862' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8154115518443090862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8154115518443090862'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/06/how-to-split-sql-string-to-multiple.html' title='How to Split SQL String to Multiple String using Delimiter'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-2665609370396724410</id><published>2011-05-31T06:35:00.000-07:00</published><updated>2011-05-31T06:35:22.449-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Errors"/><category scheme="http://www.blogger.com/atom/ns#" term="T-SQL Errors"/><title type='text'>A RETURN statement with a return value cannot be used in this context. - Create Function</title><content type='html'>If this error occurs in the Create Function that uses a table then the variable after return statement should be removed&lt;br /&gt;
&lt;br /&gt;
The syntax should be like&lt;br /&gt;
&lt;br /&gt;
Create Function &lt;function-name&gt;&lt;/function-name&gt;&lt;br /&gt;
Returns &lt;table_var&gt; Table&lt;/table_var&gt;&lt;br /&gt;
(&lt;br /&gt;
Table Definition here&lt;br /&gt;
..&lt;br /&gt;
..&lt;br /&gt;
)&lt;br /&gt;
as &lt;br /&gt;
BEGIN&lt;br /&gt;
..&lt;br /&gt;
.. &lt;br /&gt;
RETURN -- note no value is returned here&lt;br /&gt;
END</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/2665609370396724410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/2665609370396724410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/2665609370396724410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/2665609370396724410'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/05/return-statement-with-return-value.html' title='A RETURN statement with a return value cannot be used in this context. - Create Function'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-1276094018245923744</id><published>2011-05-31T06:06:00.000-07:00</published><updated>2011-05-31T06:06:27.315-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL functions"/><category scheme="http://www.blogger.com/atom/ns#" term="Sys.Objects"/><title type='text'>How to get the list of Functions in Database</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;How to Filter Functions from Sys.Objects&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The following query will list of the Functions that are part of the database:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;sys&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;objects&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;where&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;in&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&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&gt;&lt;/span&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;FN&#39;&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;IF&#39;&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&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;TF&#39;&lt;/span&gt;&lt;/span&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&gt;&lt;/span&gt;&lt;br /&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&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/1276094018245923744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/1276094018245923744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1276094018245923744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1276094018245923744'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/05/how-to-get-list-of-functions-in.html' title='How to get the list of Functions in Database'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-6342676868746574096</id><published>2011-02-21T01:31:00.000-08:00</published><updated>2011-02-21T01:31:00.550-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Change DataType of TimeStamp Column"/><category scheme="http://www.blogger.com/atom/ns#" term="Convert DataType of TimeStamp Column"/><title type='text'>Cannot alter column &#39;X&#39; because it is &#39;timestamp&#39;.</title><content type='html'>How to Change DataType of TimeStamp Column.&lt;br /&gt;
&lt;br /&gt;
Datatype of Timestamp column cannot be deleted. Hence it is advised to drop the column and re-create it&lt;br /&gt;
&lt;br /&gt;
For example,&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE [dbo].[PerformanceMaster] DROP COLUMN PerformanceDate &lt;br /&gt;
ALTER TABLE [dbo].[PerformanceMaster] ADD PerformanceDate datetime2</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/6342676868746574096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/6342676868746574096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6342676868746574096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6342676868746574096'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/02/cannot-alter-column-x-because-it-is.html' title='Cannot alter column &#39;X&#39; because it is &#39;timestamp&#39;.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-3819946083176673477</id><published>2011-02-21T00:59:00.000-08:00</published><updated>2011-02-21T00:59:50.975-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Create TimeStamp and Change TimeStamp in SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Recording Change time in SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server TimeStamps"/><title type='text'>Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.</title><content type='html'>&lt;b&gt;TimeStamp Column in SQL Server&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
TimeStamp is used to store unique binary numbers within a database. This column is autogenerated with a storage size of 8 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&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/AVvXsEjUqxOtTfZblHsMqc8IlhH609OreO7ASZ-IsdMpDKrUsl5i4HeNX9DuhIjYgau11kzX51f0_B3NDvARzmBqLmhtfreh-6nTNiC5gr4izSxGCMwiDOw9oUe4LOnVu06MvIIJSa_RlIT1yw8/s1600/SQL+TimeStamp+1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUqxOtTfZblHsMqc8IlhH609OreO7ASZ-IsdMpDKrUsl5i4HeNX9DuhIjYgau11kzX51f0_B3NDvARzmBqLmhtfreh-6nTNiC5gr4izSxGCMwiDOw9oUe4LOnVu06MvIIJSa_RlIT1yw8/s320/SQL+TimeStamp+1.JPG&quot; width=&quot;320&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;SQL Server - TimeStamp Column&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
IF you want to store the Date and Time (e.g., updated time etc) use &lt;b&gt;datetime2&lt;/b&gt; datatype instead of timestamp.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&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/AVvXsEhTEkXEonyTHTKtE0mifTluhDuCGB0X7AY81w6RGOkcU-wShkWyn-vkRmYaOxXAa1HNTRYKD5KwvE0309w7XZOWiPZZdTggkXbJCql8w_xLsVpbu0V19C2HO_KVwWGNmvA1gWkQ4HLKZNA/s1600/SQL+TimeStamp+2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;104&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEkXEonyTHTKtE0mifTluhDuCGB0X7AY81w6RGOkcU-wShkWyn-vkRmYaOxXAa1HNTRYKD5KwvE0309w7XZOWiPZZdTggkXbJCql8w_xLsVpbu0V19C2HO_KVwWGNmvA1gWkQ4HLKZNA/s320/SQL+TimeStamp+2.JPG&quot; width=&quot;320&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;SQL Server DateTime Column to Record Date and Time&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
The error &quot;Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.&quot; occurs when you try to insert the value using Insert statement. Leaving the column in the Insert will automatically update the value&lt;br /&gt;
&lt;br /&gt;
Insert into PerformanceMaster (PerformanceID, EventID, ArtistID, PerformanceDate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;
values (@PerformanceID, @EventID, @ArtistID, @UpdateDate )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Should throw and error. Use the following instead:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Insert into PerformanceMaster (PerformanceID, EventID, ArtistID, )&lt;br /&gt;
values (@PerformanceID, @EventID, @ArtistID)</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/3819946083176673477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/3819946083176673477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/3819946083176673477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/3819946083176673477'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/02/cannot-insert-explicit-value-into.html' title='Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUqxOtTfZblHsMqc8IlhH609OreO7ASZ-IsdMpDKrUsl5i4HeNX9DuhIjYgau11kzX51f0_B3NDvARzmBqLmhtfreh-6nTNiC5gr4izSxGCMwiDOw9oUe4LOnVu06MvIIJSa_RlIT1yw8/s72-c/SQL+TimeStamp+1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-1253181493943130502</id><published>2011-01-14T18:33:00.000-08:00</published><updated>2011-01-14T18:33:10.279-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Information_Schema and Stored Procedures"/><category scheme="http://www.blogger.com/atom/ns#" term="Information_Schema Faulty"/><title type='text'>Information_Schema.Routines doesn&#39;t return all procedure names</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;How to get a list of Procedures containing Specific Text / How to get a list of Procedures using Particular Table&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is one method we generally use for returning Stored Procedures containing a particular text&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;SELECT ROUTINE_NAME &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;FROM INFORMATION_SCHEMA.ROUTINES &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;WHERE ROUTINE_DEFINITION LIKE &#39;%used_by_id%&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;AND ROUTINE_TYPE = &#39;PROCEDURE&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;order by ROUTINE_NAME&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
However, we found it has some problems when the text appears at the fag end of big procedures. Instead try the following also and match the result &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
SELECT OBJECT_NAME(id) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FROM syscomments &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WHERE [text] LIKE &#39;%used_by_id%&#39; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AND OBJECTPROPERTY(id, &#39;IsProcedure&#39;) = 1 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GROUP BY OBJECT_NAME(id)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT Name &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FROM sys.procedures &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WHERE OBJECT_DEFINITION(object_id) LIKE &#39;%used_by_id%&#39; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
order by name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT OBJECT_NAME(object_id) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FROM sys.sql_modules &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WHERE Definition LIKE &#39;%used_by_id%&#39; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AND OBJECTPROPERTY(object_id, &#39;IsProcedure&#39;) = 1 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
order by OBJECT_NAME(object_id)</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/1253181493943130502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/1253181493943130502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1253181493943130502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1253181493943130502'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2011/01/informationschemaroutines-doesnt-return.html' title='Information_Schema.Routines doesn&#39;t return all procedure names'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-7141688988236671549</id><published>2010-12-16T19:51:00.000-08:00</published><updated>2010-12-16T19:51:33.344-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Foriegn Key constraints in SQL Server 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="Foriegn Key Relationships in SQL Server 2008"/><title type='text'>How to Specify Foriegn Key Relationships in SQL Server 2008</title><content type='html'>&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&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/AVvXsEiWKbh1zJLz09sAP5tgReVuZpgNTI-HiIXr6KujPvepWTw6fVOUB0W5g7aRPwlqMct6J-BGFLmT9F7tkw72c0bMSrycThEsQJqjwabbogYy68Y5wJKiJPyqhaNaHKMnKREoNK-lOkZVzuI/s1600/SQL_2008_ForeignKEY_+RelationShip.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWKbh1zJLz09sAP5tgReVuZpgNTI-HiIXr6KujPvepWTw6fVOUB0W5g7aRPwlqMct6J-BGFLmT9F7tkw72c0bMSrycThEsQJqjwabbogYy68Y5wJKiJPyqhaNaHKMnKREoNK-lOkZVzuI/s640/SQL_2008_ForeignKEY_+RelationShip.PNG&quot; width=&quot;640&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;Foriegn Key in SQL Server 2008 - Use the Relationships option&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&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/AVvXsEi616j6UfSzZp4i2WVILAfOXni9_L_FZ__WH7MvA2zjLTJEW_o4ArsxA7w5hXgiI1Av4qR8Ns_AUEaXcppic4F7Por_w1jxE2Cd-u1_6k3uDhGF5A3zmfDaf8bk9HG5sOv35pyfV5qWMn0/s1600/SQL_2008_ForeignKEY_+RelationShip+3.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi616j6UfSzZp4i2WVILAfOXni9_L_FZ__WH7MvA2zjLTJEW_o4ArsxA7w5hXgiI1Av4qR8Ns_AUEaXcppic4F7Por_w1jxE2Cd-u1_6k3uDhGF5A3zmfDaf8bk9HG5sOv35pyfV5qWMn0/s640/SQL_2008_ForeignKEY_+RelationShip+3.PNG&quot; width=&quot;640&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;Specify the relationship between the columns&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0OzAOWUaT5kH3Fyl7Hgqj5U6rBBqh9s9xyjFhyphenhypheni-FUYuEgpmU29SWNxdfEr5j9gOjML5UajmXySxQbp3o44AUyO2_yUcW7Fz1TMC_0_FppVdETJnHoasGPf8tMTkSKwhF5LIGsFaLWN4/s1600/SQL_2008_ForeignKEY_+RelationShip+4.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;294&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0OzAOWUaT5kH3Fyl7Hgqj5U6rBBqh9s9xyjFhyphenhypheni-FUYuEgpmU29SWNxdfEr5j9gOjML5UajmXySxQbp3o44AUyO2_yUcW7Fz1TMC_0_FppVdETJnHoasGPf8tMTkSKwhF5LIGsFaLWN4/s320/SQL_2008_ForeignKEY_+RelationShip+4.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;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2m3E0cqHHjEbV-DE7T9DVcxh6cTsx19NAh_1K0lMyLoxJQWgd2mXQoLbKqNAF8PrmMwAo2J-1NLK00PlS3Zx8jxVyfz0RsktE21Bjm734fKk8B-L8EPknT19uq5ZwSRGbkw5nFXxvick/s1600/SQL_2008_ForeignKEY_+RelationShip+2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; height: 231px; margin-bottom: 1em; margin-right: 1em; width: 443px;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;232&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2m3E0cqHHjEbV-DE7T9DVcxh6cTsx19NAh_1K0lMyLoxJQWgd2mXQoLbKqNAF8PrmMwAo2J-1NLK00PlS3Zx8jxVyfz0RsktE21Bjm734fKk8B-L8EPknT19uq5ZwSRGbkw5nFXxvick/s320/SQL_2008_ForeignKEY_+RelationShip+2.PNG&quot; width=&quot;320&quot; /&gt;Add new Relationship name and save when prompted&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/7141688988236671549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/7141688988236671549' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/7141688988236671549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/7141688988236671549'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/12/how-to-specify-foriegn-key.html' title='How to Specify Foriegn Key Relationships in SQL Server 2008'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWKbh1zJLz09sAP5tgReVuZpgNTI-HiIXr6KujPvepWTw6fVOUB0W5g7aRPwlqMct6J-BGFLmT9F7tkw72c0bMSrycThEsQJqjwabbogYy68Y5wJKiJPyqhaNaHKMnKREoNK-lOkZVzuI/s72-c/SQL_2008_ForeignKEY_+RelationShip.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-3521779213177891602</id><published>2010-12-16T19:41:00.000-08:00</published><updated>2010-12-16T19:41:19.941-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unable to change Identity Specification in SQL 2008"/><title type='text'>Unable to change Identity Specification in SQL Server 2008</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;Unable to change Identity Specification in SQL Server 2008&lt;/span&gt;&lt;/strong&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/AVvXsEh41ggP77C2eNks4pvbgvS_K8sXpj5EgJUQyr0AEjbRS4kZoVJ27e8783Ddv2sGBE1Eh5rvRNrpUbyu8KOlHildD4PP3zhHem9v7t4-JkAvKcw-U4_Sd8riSHL0yuhq4XbHZ0LhFGA-hGU/s1600/SQL_2008_Unable_To_Change_Id_Spec.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh41ggP77C2eNks4pvbgvS_K8sXpj5EgJUQyr0AEjbRS4kZoVJ27e8783Ddv2sGBE1Eh5rvRNrpUbyu8KOlHildD4PP3zhHem9v7t4-JkAvKcw-U4_Sd8riSHL0yuhq4XbHZ0LhFGA-hGU/s400/SQL_2008_Unable_To_Change_Id_Spec.PNG&quot; width=&quot;380&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/3521779213177891602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/3521779213177891602' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/3521779213177891602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/3521779213177891602'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/12/unable-to-change-identity-specification.html' title='Unable to change Identity Specification in SQL Server 2008'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh41ggP77C2eNks4pvbgvS_K8sXpj5EgJUQyr0AEjbRS4kZoVJ27e8783Ddv2sGBE1Eh5rvRNrpUbyu8KOlHildD4PP3zhHem9v7t4-JkAvKcw-U4_Sd8riSHL0yuhq4XbHZ0LhFGA-hGU/s72-c/SQL_2008_Unable_To_Change_Id_Spec.PNG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-4002728369969643293</id><published>2010-12-16T19:37:00.000-08:00</published><updated>2010-12-16T19:37:53.929-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Server Explorer not visible in Visual Studio"/><title type='text'>How to make Server Explorer visible in Visual Studio</title><content type='html'>&lt;b&gt;Server Explorer not visible in Visual Studio&lt;/b&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/AVvXsEh1ve9N4anab3hOGxy7edwPpKRwWm2AvLHtyOVxrZLcmwV8K22e-vKjNakHJ_QcjTKYcnoKn2WatvWPJtLEOOFr8Dbo1n8z0_Fkn2U1eHg_ViiG7sMZ8UAVLJfZiqoEEdN6XEiES_02n74/s1600/Server_Explorer_VS2010.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1ve9N4anab3hOGxy7edwPpKRwWm2AvLHtyOVxrZLcmwV8K22e-vKjNakHJ_QcjTKYcnoKn2WatvWPJtLEOOFr8Dbo1n8z0_Fkn2U1eHg_ViiG7sMZ8UAVLJfZiqoEEdN6XEiES_02n74/s400/Server_Explorer_VS2010.png&quot; width=&quot;325&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/4002728369969643293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/4002728369969643293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/4002728369969643293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/4002728369969643293'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/12/how-to-make-server-explorer-visible-in.html' title='How to make Server Explorer visible in Visual Studio'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1ve9N4anab3hOGxy7edwPpKRwWm2AvLHtyOVxrZLcmwV8K22e-vKjNakHJ_QcjTKYcnoKn2WatvWPJtLEOOFr8Dbo1n8z0_Fkn2U1eHg_ViiG7sMZ8UAVLJfZiqoEEdN6XEiES_02n74/s72-c/Server_Explorer_VS2010.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-5974576543578887911</id><published>2010-12-16T19:30:00.000-08:00</published><updated>2010-12-16T19:30:55.394-08:00</updated><title type='text'>Your pending changes require the following tables to be dropped and re-created</title><content type='html'>&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/AVvXsEiC4QCz3-ahATCpRRnh5hD8GVWMBglVtD6FoAeofteZyNWAb0ULja2JjqQSFj7semvdlAlYoD-VFK8vVWzZ1N3Jj5unjZvcigWihifHyzgrsWnU8qM_Z_5Woxk3VhUuzsNe1EitklQNQ_s/s1600/SQL_2008_Tables_Recreated.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC4QCz3-ahATCpRRnh5hD8GVWMBglVtD6FoAeofteZyNWAb0ULja2JjqQSFj7semvdlAlYoD-VFK8vVWzZ1N3Jj5unjZvcigWihifHyzgrsWnU8qM_Z_5Woxk3VhUuzsNe1EitklQNQ_s/s640/SQL_2008_Tables_Recreated.PNG&quot; width=&quot;582&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;Remove the checkbox &#39;Prevent saving changes&#39;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu7TU07K5pXjEkb_FsVYm8ofeFJH6vZgbZ7JTLwTrf_OmCzsUMtWZG0o1oOKTD4t_ZGC5TN-wrNZ29bH4YSeJhZG_C6Q-FwfxYrcCDra5PkLj81vsRMT35Lk3BgC2DyerFsb535aGoFDU/s1600/SQL_2008_Tables_Recreated+2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;426&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu7TU07K5pXjEkb_FsVYm8ofeFJH6vZgbZ7JTLwTrf_OmCzsUMtWZG0o1oOKTD4t_ZGC5TN-wrNZ29bH4YSeJhZG_C6Q-FwfxYrcCDra5PkLj81vsRMT35Lk3BgC2DyerFsb535aGoFDU/s640/SQL_2008_Tables_Recreated+2.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/5974576543578887911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/5974576543578887911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/5974576543578887911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/5974576543578887911'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/12/your-pending-changes-require-following.html' title='Your pending changes require the following tables to be dropped and re-created'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC4QCz3-ahATCpRRnh5hD8GVWMBglVtD6FoAeofteZyNWAb0ULja2JjqQSFj7semvdlAlYoD-VFK8vVWzZ1N3Jj5unjZvcigWihifHyzgrsWnU8qM_Z_5Woxk3VhUuzsNe1EitklQNQ_s/s72-c/SQL_2008_Tables_Recreated.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-6632271972553192692</id><published>2010-12-16T19:26:00.000-08:00</published><updated>2010-12-16T19:26:06.942-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="auto-increment column in SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server 2008 Auto Increment"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server identity column"/><title type='text'>How to create auto-increment column in SQL Server</title><content type='html'>&lt;b&gt;How to Set Increment value in SQL Server&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Set Column properties - goto Identity Specification, set (Is Identity) to True (Yes)&lt;br /&gt;
&lt;br /&gt;
﻿ &lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&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/AVvXsEjAdaBvJtgFjZYo247yQKDdJFAXX0CYfTDZPXUwCclelTTHkdZsr2gDpeGc9NyV9cqPY_xtuzzNc9H7JpBClNOEbMjfphbrI5ckIsG937EvgV-hESFqYp5ztk7bTAIWf4kknEnbkbLB7Mc/s1600/SQL_2008_Identity.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;292&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAdaBvJtgFjZYo247yQKDdJFAXX0CYfTDZPXUwCclelTTHkdZsr2gDpeGc9NyV9cqPY_xtuzzNc9H7JpBClNOEbMjfphbrI5ckIsG937EvgV-hESFqYp5ztk7bTAIWf4kknEnbkbLB7Mc/s320/SQL_2008_Identity.PNG&quot; width=&quot;320&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;SQL Server Identity Specification&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;﻿</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/6632271972553192692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/6632271972553192692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6632271972553192692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/6632271972553192692'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/12/how-to-create-auto-increment-column-in.html' title='How to create auto-increment column in SQL Server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAdaBvJtgFjZYo247yQKDdJFAXX0CYfTDZPXUwCclelTTHkdZsr2gDpeGc9NyV9cqPY_xtuzzNc9H7JpBClNOEbMjfphbrI5ckIsG937EvgV-hESFqYp5ztk7bTAIWf4kknEnbkbLB7Mc/s72-c/SQL_2008_Identity.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-8956346079970425557</id><published>2010-12-16T19:18:00.000-08:00</published><updated>2010-12-16T19:18:55.635-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Default Column values in SQL Server"/><category scheme="http://www.blogger.com/atom/ns#" term="Default Values in SQL 2008"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Default Values"/><title type='text'>How to specify Default value for a column in SQL Server</title><content type='html'>&lt;b&gt;SQL Server Default Column Values&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here is a way to specify default values in Sql Server Management Studio for a column&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/AVvXsEgbZ5unntHEO8NMDayaUjxdOdhkLfpMVUwXz4BCCWZ0vR25gPokAFnr4hY5gyjUQvpi9kHbKqGuqLxnNU2P3elsOGM_aldnSzemCrEDakt7DfSyvNvelt3gaWEcN9zliyHK6AW8W-WTX1Q/s1600/SQL_2008_DefaultValue.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; n4=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbZ5unntHEO8NMDayaUjxdOdhkLfpMVUwXz4BCCWZ0vR25gPokAFnr4hY5gyjUQvpi9kHbKqGuqLxnNU2P3elsOGM_aldnSzemCrEDakt7DfSyvNvelt3gaWEcN9zliyHK6AW8W-WTX1Q/s400/SQL_2008_DefaultValue.PNG&quot; width=&quot;378&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/8956346079970425557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/8956346079970425557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8956346079970425557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/8956346079970425557'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/12/how-to-specify-default-value-for-column.html' title='How to specify Default value for a column in SQL Server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbZ5unntHEO8NMDayaUjxdOdhkLfpMVUwXz4BCCWZ0vR25gPokAFnr4hY5gyjUQvpi9kHbKqGuqLxnNU2P3elsOGM_aldnSzemCrEDakt7DfSyvNvelt3gaWEcN9zliyHK6AW8W-WTX1Q/s72-c/SQL_2008_DefaultValue.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-1057755759989468073</id><published>2010-04-05T18:36:00.000-07:00</published><updated>2010-04-05T18:37:15.840-07:00</updated><title type='text'>SQL Server 2008 - Saving changes is not permitted</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhulcqVW9XAxvgRIu1LWVv14Ecs4HtutSDOiG-yQ4cObm4KNk2ILOdEmwaH073kGQnYG_0EyPblZltXI3EHrHNmCiyhgg-Tkb8CAGuXDdhGXvTAST3_7EWQ77HYv9fqsmvQCCyJQXoO1t0/s1600/SQL_SaveChanges_NotPermitted.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 318px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhulcqVW9XAxvgRIu1LWVv14Ecs4HtutSDOiG-yQ4cObm4KNk2ILOdEmwaH073kGQnYG_0EyPblZltXI3EHrHNmCiyhgg-Tkb8CAGuXDdhGXvTAST3_7EWQ77HYv9fqsmvQCCyJQXoO1t0/s400/SQL_SaveChanges_NotPermitted.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5456832449262800114&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/1057755759989468073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/1057755759989468073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1057755759989468073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1057755759989468073'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/04/sql-server-2008-saving-changes-is-not.html' title='SQL Server 2008 - Saving changes is not permitted'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhulcqVW9XAxvgRIu1LWVv14Ecs4HtutSDOiG-yQ4cObm4KNk2ILOdEmwaH073kGQnYG_0EyPblZltXI3EHrHNmCiyhgg-Tkb8CAGuXDdhGXvTAST3_7EWQ77HYv9fqsmvQCCyJQXoO1t0/s72-c/SQL_SaveChanges_NotPermitted.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-1218221814951436075</id><published>2010-04-05T18:16:00.000-07:00</published><updated>2010-04-05T18:18:52.915-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft SQL Server Management Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Errors"/><title type='text'>Error Message: String or binary data would be truncated. - SQL SERVER</title><content type='html'>No row was updated.&lt;br /&gt;&lt;br /&gt;The data in row 1 was not committed.&lt;br /&gt;Error Source: .Net SqlClient Data Provider.&lt;br /&gt;Error Message: String or binary data would be truncated.&lt;br /&gt;The statement has been terminated.&lt;br /&gt;&lt;br /&gt;Correct the errors and retry or press ESC to cancel the change(s).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8kuY5pvFnu7GfUwziUzIlVE4c_nl20KwFcmVC6f_ocV70UGcdn5T28KeH5wl7S_CqzQxc-9qnrVEc6wRvr1MbgaDWoKqKrD6O9TsHsB54tF59d9AYXmnmuJbyAJsQD0WF75T3kEfAjUs/s1600/SQL_Trunctate+Data.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 400px; height: 205px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8kuY5pvFnu7GfUwziUzIlVE4c_nl20KwFcmVC6f_ocV70UGcdn5T28KeH5wl7S_CqzQxc-9qnrVEc6wRvr1MbgaDWoKqKrD6O9TsHsB54tF59d9AYXmnmuJbyAJsQD0WF75T3kEfAjUs/s400/SQL_Trunctate+Data.PNG&quot; alt=&quot;Error Message: String or binary data would be truncated. &quot; id=&quot;BLOGGER_PHOTO_ID_5456827406595331058&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The above error occurs in Microsoft SQL Server Management Studio when you attempt to enter more characters than the maximum level for that field</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/1218221814951436075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/1218221814951436075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1218221814951436075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/1218221814951436075'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/04/error-message-string-or-binary-data.html' title='Error Message: String or binary data would be truncated. - SQL SERVER'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8kuY5pvFnu7GfUwziUzIlVE4c_nl20KwFcmVC6f_ocV70UGcdn5T28KeH5wl7S_CqzQxc-9qnrVEc6wRvr1MbgaDWoKqKrD6O9TsHsB54tF59d9AYXmnmuJbyAJsQD0WF75T3kEfAjUs/s72-c/SQL_Trunctate+Data.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7883769006508081360.post-3418822567965013927</id><published>2010-04-05T18:13:00.000-07:00</published><updated>2010-04-05T18:16:38.476-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Binary Sort in SQL SERVER"/><category scheme="http://www.blogger.com/atom/ns#" term="Dictionary Sort in SQL SERVER"/><category scheme="http://www.blogger.com/atom/ns#" term="Katakana SQL SERVER"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server Collation"/><title type='text'>How to set Case Sensitive comparison in SQL Server 2008</title><content type='html'>&lt;om name=&quot;Om Ganeshaya Namaha&quot;&gt;&lt;br /&gt;&lt;om name=&quot;Om Satguru Seshadri Swamigal Thiruvadike&quot;&gt;&lt;br /&gt;&lt;om name=&quot;Om Varahi Namaha&quot;&gt;&lt;br /&gt;&lt;om name=&quot;Om Saravana Bhava&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;How to set a field as Case Sensitive in SQL Server 2008.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here is a simple way to do that&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguUCMKtDO_FT6FuvqAbOhiJETdWfahcroU5_Cb_N5pbSR3py40NvaT2y12gFqV7uRet3-jhGDVWTHUhou4G494f59WvuVola1rC6BngtilUy-7An3bUZQMgUwkiy0hL4kHCKbRWOUpmTo/s1600/SQL_Collation.PNG&quot;&gt;&lt;img style=&quot;cursor: pointer; width: 292px; height: 400px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguUCMKtDO_FT6FuvqAbOhiJETdWfahcroU5_Cb_N5pbSR3py40NvaT2y12gFqV7uRet3-jhGDVWTHUhou4G494f59WvuVola1rC6BngtilUy-7An3bUZQMgUwkiy0hL4kHCKbRWOUpmTo/s400/SQL_Collation.PNG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5456826782481495058&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/om&gt;&lt;/om&gt;&lt;/om&gt;&lt;/om&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqldud.blogspot.com/feeds/3418822567965013927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7883769006508081360/3418822567965013927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/3418822567965013927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7883769006508081360/posts/default/3418822567965013927'/><link rel='alternate' type='text/html' href='http://sqldud.blogspot.com/2010/04/how-to-set-case-sensitive-comparison-in.html' title='How to set Case Sensitive comparison in SQL Server 2008'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguUCMKtDO_FT6FuvqAbOhiJETdWfahcroU5_Cb_N5pbSR3py40NvaT2y12gFqV7uRet3-jhGDVWTHUhou4G494f59WvuVola1rC6BngtilUy-7An3bUZQMgUwkiy0hL4kHCKbRWOUpmTo/s72-c/SQL_Collation.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>