<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Difference Between Unique Index vs Unique Constraint</title>
	<atom:link href="http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #026 &#124; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-464689</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #026 &#124; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 27 Apr 2013 01:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-464689</guid>
		<description><![CDATA[[...] Difference Between Unique Index vs Unique Constraint There is no difference between Unique Index and Unique Constraint. Even though their syntax are different the effect is the same. Unique Constraint creates Unique Index to maintain the constraint to prevent duplicate keys. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Difference Between Unique Index vs Unique Constraint There is no difference between Unique Index and Unique Constraint. Even though their syntax are different the effect is the same. Unique Constraint creates Unique Index to maintain the constraint to prevent duplicate keys. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guillegr123</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-448983</link>
		<dc:creator><![CDATA[guillegr123]]></dc:creator>
		<pubDate>Tue, 02 Apr 2013 21:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-448983</guid>
		<description><![CDATA[Thanks man, you solved my doubt! That&#039;s certainly true.]]></description>
		<content:encoded><![CDATA[<p>Thanks man, you solved my doubt! That&#8217;s certainly true.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ranjith</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-437518</link>
		<dc:creator><![CDATA[Ranjith]]></dc:creator>
		<pubDate>Fri, 15 Mar 2013 05:27:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-437518</guid>
		<description><![CDATA[I think Unique non clustered index will allow you to add columns in the include columns.]]></description>
		<content:encoded><![CDATA[<p>I think Unique non clustered index will allow you to add columns in the include columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: karthik</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-436278</link>
		<dc:creator><![CDATA[karthik]]></dc:creator>
		<pubDate>Tue, 12 Mar 2013 20:42:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-436278</guid>
		<description><![CDATA[How to create a BITMAP Index in sql server 2008R2?]]></description>
		<content:encoded><![CDATA[<p>How to create a BITMAP Index in sql server 2008R2?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mamun</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-433329</link>
		<dc:creator><![CDATA[mamun]]></dc:creator>
		<pubDate>Thu, 07 Mar 2013 10:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-433329</guid>
		<description><![CDATA[short and clear please keep it up. is there any way to create some other constraint using sql server UI]]></description>
		<content:encoded><![CDATA[<p>short and clear please keep it up. is there any way to create some other constraint using sql server UI</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JoshG</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-374555</link>
		<dc:creator><![CDATA[JoshG]]></dc:creator>
		<pubDate>Thu, 15 Nov 2012 16:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-374555</guid>
		<description><![CDATA[There are differences in the DROP statements as well:

-- UNIQUE CONSTRAINT 
ALTER TABLE  DROP CONSTRAINT 

-- UNIQUE INDEX
DROP INDEX  ON ]]></description>
		<content:encoded><![CDATA[<p>There are differences in the DROP statements as well:</p>
<p>&#8211; UNIQUE CONSTRAINT<br />
ALTER TABLE  DROP CONSTRAINT </p>
<p>&#8211; UNIQUE INDEX<br />
DROP INDEX  ON </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mercedeh.sh@gmail.com</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-330316</link>
		<dc:creator><![CDATA[mercedeh.sh@gmail.com]]></dc:creator>
		<pubDate>Tue, 14 Aug 2012 11:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-330316</guid>
		<description><![CDATA[thanks dear friend for usefull learning]]></description>
		<content:encoded><![CDATA[<p>thanks dear friend for usefull learning</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RAM AMAR</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-255133</link>
		<dc:creator><![CDATA[RAM AMAR]]></dc:creator>
		<pubDate>Wed, 22 Feb 2012 07:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-255133</guid>
		<description><![CDATA[RAM......
 Can We have more  than one Unique Constraints on the Same Column]]></description>
		<content:encoded><![CDATA[<p>RAM&#8230;&#8230;<br />
 Can We have more  than one Unique Constraints on the Same Column</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ayesha</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-228450</link>
		<dc:creator><![CDATA[Ayesha]]></dc:creator>
		<pubDate>Fri, 30 Dec 2011 07:05:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-228450</guid>
		<description><![CDATA[Great! Help]]></description>
		<content:encoded><![CDATA[<p>Great! Help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pran</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-196899</link>
		<dc:creator><![CDATA[Pran]]></dc:creator>
		<pubDate>Wed, 16 Nov 2011 13:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-196899</guid>
		<description><![CDATA[Cannot connect to sql server 2005 management studio express on local pc using windows authentication?  &amp; SQL Configuration tool is also not available with my setup...
cannot connect to sql server 2005 management studio express on local pc using windows authentication?
It&#039;s unable connect to SQL server 2005 management studio express on local m/c using windows authentication. I went through microsoft support script but it also cann&#039;t wok as there is no configuration manager installed with setup (43.2 MB). If there is pb in setup files or something else....
while connection it shows error report is as Follows

TITLE: Connect to Server
------------------------------

Cannot connect to pran-pun-srv-trup.

------------------------------
ADDITIONAL INFORMATION:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)]]></description>
		<content:encoded><![CDATA[<p>Cannot connect to sql server 2005 management studio express on local pc using windows authentication?  &amp; SQL Configuration tool is also not available with my setup&#8230;<br />
cannot connect to sql server 2005 management studio express on local pc using windows authentication?<br />
It&#8217;s unable connect to SQL server 2005 management studio express on local m/c using windows authentication. I went through microsoft support script but it also cann&#8217;t wok as there is no configuration manager installed with setup (43.2 MB). If there is pb in setup files or something else&#8230;.<br />
while connection it shows error report is as Follows</p>
<p>TITLE: Connect to Server<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Cannot connect to pran-pun-srv-trup.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
ADDITIONAL INFORMATION:</p>
<p>An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 &#8211; Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DHall</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-164013</link>
		<dc:creator><![CDATA[DHall]]></dc:creator>
		<pubDate>Wed, 31 Aug 2011 18:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-164013</guid>
		<description><![CDATA[I haven&#039;t tried any of this yet,but it seems that another difference between a unique index and a unique constraint would be the ability to use the optional INCLUDE clause as part of the CREATE INDEX statement to include columns that are not part of the actual unique index. It would probably be overkill, but it seems that you could have both a unique index and a unique constraint and thereby get the benefits of both.]]></description>
		<content:encoded><![CDATA[<p>I haven&#8217;t tried any of this yet,but it seems that another difference between a unique index and a unique constraint would be the ability to use the optional INCLUDE clause as part of the CREATE INDEX statement to include columns that are not part of the actual unique index. It would probably be overkill, but it seems that you could have both a unique index and a unique constraint and thereby get the benefits of both.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A.M. de Jong</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-135204</link>
		<dc:creator><![CDATA[A.M. de Jong]]></dc:creator>
		<pubDate>Thu, 19 May 2011 07:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-135204</guid>
		<description><![CDATA[You can Include a column in a (Unique) Index. Although this extra column (p.e. a primary key) can always make this index Unique it does not affect the uniqueness of the other columns.
So If you have a identity seed table with a PK on the ID and you create a Unique Index on column 2 and 3 and INCLUDe the PK column in the index duplicate values of column 2 &amp; 3 will still be noticed (the inserts fails or when IGNORE_DUP_KEY = ON it is ignored)]]></description>
		<content:encoded><![CDATA[<p>You can Include a column in a (Unique) Index. Although this extra column (p.e. a primary key) can always make this index Unique it does not affect the uniqueness of the other columns.<br />
So If you have a identity seed table with a PK on the ID and you create a Unique Index on column 2 and 3 and INCLUDe the PK column in the index duplicate values of column 2 &amp; 3 will still be noticed (the inserts fails or when IGNORE_DUP_KEY = ON it is ignored)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hiram</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-133211</link>
		<dc:creator><![CDATA[Hiram]]></dc:creator>
		<pubDate>Fri, 06 May 2011 15:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-133211</guid>
		<description><![CDATA[CREATE TABLE dbo.Madhu(
ID int NOT NULL,
AccNo int NOT NULL,
Type int NOT NULL,
PRIMARY KEY (ID,AccNo,Type));

go

CREATE VIEW dbo.MadhoIDAccNo WITH SCHEMABINDING AS
SELECT ID, AccNo, COUNT_BIG(*) c
FROM dbo.Madhu
GROUP BY ID, AccNo;

go

CREATE UNIQUE CLUSTERED INDEX OnlyOneAccNoPerID ON dbo.MadhoIDAccNo(ID);]]></description>
		<content:encoded><![CDATA[<p>CREATE TABLE dbo.Madhu(<br />
ID int NOT NULL,<br />
AccNo int NOT NULL,<br />
Type int NOT NULL,<br />
PRIMARY KEY (ID,AccNo,Type));</p>
<p>go</p>
<p>CREATE VIEW dbo.MadhoIDAccNo WITH SCHEMABINDING AS<br />
SELECT ID, AccNo, COUNT_BIG(*) c<br />
FROM dbo.Madhu<br />
GROUP BY ID, AccNo;</p>
<p>go</p>
<p>CREATE UNIQUE CLUSTERED INDEX OnlyOneAccNoPerID ON dbo.MadhoIDAccNo(ID);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-128442</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Tue, 12 Apr 2011 08:22:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-128442</guid>
		<description><![CDATA[One possible way is to use make use of insert trigger and check this]]></description>
		<content:encoded><![CDATA[<p>One possible way is to use make use of insert trigger and check this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Madhukumar N</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-128246</link>
		<dc:creator><![CDATA[Madhukumar N]]></dc:creator>
		<pubDate>Mon, 11 Apr 2011 09:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-128246</guid>
		<description><![CDATA[Hi i need a table as follows

ID, Accno, Type
1 ,    1 ,         1
1 ,    1,          2
1,     1,          3
1 ,    2 ,         1 it can not be allowed
2 ,    1,          1 it can be allowed
how can i create this type of table?
ID cannot be used for any Other Account Number but it can be used multiple times for same Account Number??

Thanks in advance
Madhukumar N]]></description>
		<content:encoded><![CDATA[<p>Hi i need a table as follows</p>
<p>ID, Accno, Type<br />
1 ,    1 ,         1<br />
1 ,    1,          2<br />
1,     1,          3<br />
1 ,    2 ,         1 it can not be allowed<br />
2 ,    1,          1 it can be allowed<br />
how can i create this type of table?<br />
ID cannot be used for any Other Account Number but it can be used multiple times for same Account Number??</p>
<p>Thanks in advance<br />
Madhukumar N</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabio Franco</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-126850</link>
		<dc:creator><![CDATA[Fabio Franco]]></dc:creator>
		<pubDate>Tue, 05 Apr 2011 20:59:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-126850</guid>
		<description><![CDATA[Additional information here:

http://social.msdn.microsoft.com/Forums/en/sqldocumentation/thread/fc8f2d2d-0378-4f5f-94bc-033b44842aa7]]></description>
		<content:encoded><![CDATA[<p>Additional information here:</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en/sqldocumentation/thread/fc8f2d2d-0378-4f5f-94bc-033b44842aa7" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/sqldocumentation/thread/fc8f2d2d-0378-4f5f-94bc-033b44842aa7</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FC Wright</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-121904</link>
		<dc:creator><![CDATA[FC Wright]]></dc:creator>
		<pubDate>Fri, 04 Mar 2011 20:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-121904</guid>
		<description><![CDATA[Tushar,

Having same Oracle --&gt; SQL Server conversion problem.  Its only to be maintained for historical reporting so your work around is perfect! 
I tried ANSI_PADDING ON  (at db level and at table create and insert time) but no luck and gave up.

&quot;My work around is to replace trailing blanks in key fields with ~ character. Again a temporary fix till SQL Server provides a way to have sound string data type comparisons&quot;

A container to hold 6 beers at the same time!  BRILLIANT!!

THX
FC Wright]]></description>
		<content:encoded><![CDATA[<p>Tushar,</p>
<p>Having same Oracle &#8211;&gt; SQL Server conversion problem.  Its only to be maintained for historical reporting so your work around is perfect!<br />
I tried ANSI_PADDING ON  (at db level and at table create and insert time) but no luck and gave up.</p>
<p>&#8220;My work around is to replace trailing blanks in key fields with ~ character. Again a temporary fix till SQL Server provides a way to have sound string data type comparisons&#8221;</p>
<p>A container to hold 6 beers at the same time!  BRILLIANT!!</p>
<p>THX<br />
FC Wright</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor Krupitsky</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-83266</link>
		<dc:creator><![CDATA[Igor Krupitsky]]></dc:creator>
		<pubDate>Fri, 06 Aug 2010 14:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-83266</guid>
		<description><![CDATA[To retrieve “Unique Constraints” :
sp_helpconstraint MyTable,&#039;nomsg&#039;  

To retrieve “Unique Index&quot;:
select name, type_desc, is_unique, is_primary_key
from sys.indexes
where object_id  = object_id(&#039;MyTable&#039;)  

Igor]]></description>
		<content:encoded><![CDATA[<p>To retrieve “Unique Constraints” :<br />
sp_helpconstraint MyTable,&#8217;nomsg&#8217;  </p>
<p>To retrieve “Unique Index&#8221;:<br />
select name, type_desc, is_unique, is_primary_key<br />
from sys.indexes<br />
where object_id  = object_id(&#8216;MyTable&#8217;)  </p>
<p>Igor</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: José Américo Antoine Jr</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-82250</link>
		<dc:creator><![CDATA[José Américo Antoine Jr]]></dc:creator>
		<pubDate>Thu, 29 Jul 2010 21:58:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-82250</guid>
		<description><![CDATA[I think you can&#039;t obtain these values direct from sql server, probably you can do using the system tables.
I did this in .net C# via OLEDB
Above the code:

using System;
using System.Collections;
using System.Data;
using System.Data.OleDb;

namespace namespace_name {
	public class class_name {
		private string table_name = &quot;tabela_teste&quot;;
		private string var_OleDbConnection = &quot;Provider=sqloledb;Data Source=127.0.0.1;Initial Catalog=database_name;User Id=sa;Password=;&quot;;
		#region public indices_colunas[] indexes
		private indexes_columns[] Indices;
		public indexes_columns[] indexes {
			get {
				if (Indices == null) {
					ArrayList ar = new ArrayList();
					DataView dv = GetOleDbSchema(System.Data.OleDb.OleDbSchemaGuid.Indexes, new object[] {null, null, null});
					for (int i = 0; i &lt; dv.Count; i++) {
						if (dv[i][&quot;TABLE_NAME&quot;].ToString().Trim().ToLower() == table_name.ToLower()) {
							if (dv[i][&quot;TABLE_NAME&quot;].ToString().Trim().ToLower() == table_name.ToLower()) {
								indexes_columns ind = new indexes_columns();
								ind.table_name = dv[i][&quot;TABLE_NAME&quot;].ToString();
								ind.column_name = dv[i][&quot;COLUMN_NAME&quot;].ToString();
								ind.index_name = dv[i][&quot;INDEX_NAME&quot;].ToString();
								ind.primary_key = Convert.ToBoolean(dv[i][&quot;PRIMARY_KEY&quot;]);
								ind.clustered = Convert.ToBoolean(dv[i][&quot;CLUSTERED&quot;]);
								ind.unique = Convert.ToBoolean(dv[i][&quot;UNIQUE&quot;]);
								ar.Add(ind);
							}
						}
					}
					Indices = new indexes_columns[ar.Count];
					ar.CopyTo((indexes_columns[]) Indices);
				}
				return Indices;
			}
		}
		#endregion
		#region public struct indexes_columns
		public struct indexes_columns {
			public string table_name;
			public string column_name;
			public bool clustered;
			public bool unique;
			public bool primary_key;
			public string index_name;

		}
		#endregion
		private DataView GetOleDbSchema(Guid SchemaGuid, object[] parametros) {
			DataView dv = new DataView();
			OleDbConnection myConnection = new OleDbConnection(var_OleDbConnection);
			try {
				myConnection.Open();
				dv = new DataView(myConnection.GetOleDbSchemaTable(SchemaGuid, parametros));
			}
			catch {
				throw;
			}
			finally {
				myConnection.Close();
			}
			return dv;
		}
	}
}]]></description>
		<content:encoded><![CDATA[<p>I think you can&#8217;t obtain these values direct from sql server, probably you can do using the system tables.<br />
I did this in .net C# via OLEDB<br />
Above the code:</p>
<p>using System;<br />
using System.Collections;<br />
using System.Data;<br />
using System.Data.OleDb;</p>
<p>namespace namespace_name {<br />
	public class class_name {<br />
		private string table_name = &#8220;tabela_teste&#8221;;<br />
		private string var_OleDbConnection = &#8220;Provider=sqloledb;Data Source=127.0.0.1;Initial Catalog=database_name;User Id=sa;Password=;&#8221;;<br />
		#region public indices_colunas[] indexes<br />
		private indexes_columns[] Indices;<br />
		public indexes_columns[] indexes {<br />
			get {<br />
				if (Indices == null) {<br />
					ArrayList ar = new ArrayList();<br />
					DataView dv = GetOleDbSchema(System.Data.OleDb.OleDbSchemaGuid.Indexes, new object[] {null, null, null});<br />
					for (int i = 0; i &lt; dv.Count; i++) {<br />
						if (dv[i][&quot;TABLE_NAME&quot;].ToString().Trim().ToLower() == table_name.ToLower()) {<br />
							if (dv[i][&quot;TABLE_NAME&quot;].ToString().Trim().ToLower() == table_name.ToLower()) {<br />
								indexes_columns ind = new indexes_columns();<br />
								ind.table_name = dv[i][&quot;TABLE_NAME&quot;].ToString();<br />
								ind.column_name = dv[i][&quot;COLUMN_NAME&quot;].ToString();<br />
								ind.index_name = dv[i][&quot;INDEX_NAME&quot;].ToString();<br />
								ind.primary_key = Convert.ToBoolean(dv[i][&quot;PRIMARY_KEY&quot;]);<br />
								ind.clustered = Convert.ToBoolean(dv[i][&quot;CLUSTERED&quot;]);<br />
								ind.unique = Convert.ToBoolean(dv[i][&quot;UNIQUE&quot;]);<br />
								ar.Add(ind);<br />
							}<br />
						}<br />
					}<br />
					Indices = new indexes_columns[ar.Count];<br />
					ar.CopyTo((indexes_columns[]) Indices);<br />
				}<br />
				return Indices;<br />
			}<br />
		}<br />
		#endregion<br />
		#region public struct indexes_columns<br />
		public struct indexes_columns {<br />
			public string table_name;<br />
			public string column_name;<br />
			public bool clustered;<br />
			public bool unique;<br />
			public bool primary_key;<br />
			public string index_name;</p>
<p>		}<br />
		#endregion<br />
		private DataView GetOleDbSchema(Guid SchemaGuid, object[] parametros) {<br />
			DataView dv = new DataView();<br />
			OleDbConnection myConnection = new OleDbConnection(var_OleDbConnection);<br />
			try {<br />
				myConnection.Open();<br />
				dv = new DataView(myConnection.GetOleDbSchemaTable(SchemaGuid, parametros));<br />
			}<br />
			catch {<br />
				throw;<br />
			}<br />
			finally {<br />
				myConnection.Close();<br />
			}<br />
			return dv;<br />
		}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jati</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-81008</link>
		<dc:creator><![CDATA[Jati]]></dc:creator>
		<pubDate>Wed, 21 Jul 2010 02:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-81008</guid>
		<description><![CDATA[How retrieve &quot;Unique Constraints&quot; and &quot;Unique Index&quot; from database using SQL?

thanks]]></description>
		<content:encoded><![CDATA[<p>How retrieve &#8220;Unique Constraints&#8221; and &#8220;Unique Index&#8221; from database using SQL?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evans</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-76547</link>
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Wed, 16 Jun 2010 19:51:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-76547</guid>
		<description><![CDATA[Love this site!!]]></description>
		<content:encoded><![CDATA[<p>Love this site!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-53054</link>
		<dc:creator><![CDATA[Brian Tkatch]]></dc:creator>
		<pubDate>Wed, 17 Jun 2009 11:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-53054</guid>
		<description><![CDATA[@Reed

Very interesting!

CREATE TABLE A(A INT UNIQUE);
INSERT INTO A(A) VALUES(1);
INSERT INTO A(A) VALUES(1);
DROP TABLE A;

CREATE TABLE A(A INT);
CREATE UNIQUE INDEX AA ON A(A);
INSERT INTO A(A) VALUES(1);
INSERT INTO A(A) VALUES(1);
DROP TABLE A;]]></description>
		<content:encoded><![CDATA[<p>@Reed</p>
<p>Very interesting!</p>
<p>CREATE TABLE A(A INT UNIQUE);<br />
INSERT INTO A(A) VALUES(1);<br />
INSERT INTO A(A) VALUES(1);<br />
DROP TABLE A;</p>
<p>CREATE TABLE A(A INT);<br />
CREATE UNIQUE INDEX AA ON A(A);<br />
INSERT INTO A(A) VALUES(1);<br />
INSERT INTO A(A) VALUES(1);<br />
DROP TABLE A;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reed</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-53052</link>
		<dc:creator><![CDATA[Reed]]></dc:creator>
		<pubDate>Wed, 17 Jun 2009 09:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-53052</guid>
		<description><![CDATA[Just discovered another difference between declaring a unique index vs. a unique constraint.

SQL will raise an error with an error code of 2601 when violating a unique index, while it will use error code 2627 for violating a unique constraint.

Minor difference, but while they are very similar, they are NOT the same.]]></description>
		<content:encoded><![CDATA[<p>Just discovered another difference between declaring a unique index vs. a unique constraint.</p>
<p>SQL will raise an error with an error code of 2601 when violating a unique index, while it will use error code 2627 for violating a unique constraint.</p>
<p>Minor difference, but while they are very similar, they are NOT the same.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-47201</link>
		<dc:creator><![CDATA[SQLAuthority News - Best Articles on SQLAuthority.com Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Tue, 24 Feb 2009 12:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-47201</guid>
		<description><![CDATA[[...] SQL SERVER - Difference between Unique Index vs Unique Constraint [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER &#8211; Difference between Unique Index vs Unique Constraint [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER - Explanation about Usage of Unique Index and Unique Constraint Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2007/04/26/sql-server-difference-between-unique-index-vs-unique-constraint/#comment-42490</link>
		<dc:creator><![CDATA[SQL SERVER - Explanation about Usage of Unique Index and Unique Constraint Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Sun, 07 Sep 2008 01:31:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/04/26/difference-between-unique-index-vs-unique-constraint/#comment-42490</guid>
		<description><![CDATA[[...] Cristiano asked following questions : [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Cristiano asked following questions : [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
