Showing posts with label details. Show all posts
Showing posts with label details. Show all posts

Wednesday, March 21, 2012

Primary key details

I am looking for a query to get the PrimaryKey Name, primary key column
for a particular table.
The follwing query will give me the Key Name and the Table Name but not
the column Name. Can I get the column name also in this query.
select A.ID,A.Name as PrimaryKey, B.Name as MasterTable from sysobjects
A INNER JOIN sysobjects B
on A.Parent_obj= B.ID
where A.xType = 'PK'
Thanks in AdvanceWhat about
SELECT * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
HTH, Jens Suessmeyer.|||SQL novice
SELECT rc.constraint_name,
ccu_prim.TABLE_NAME AS prim_table,
ccu_prim.COLUMN_NAME AS prim_column,
ccu_for.TABLE_NAME AS for_table,
ccu_for.COLUMN_NAME AS for_column
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu_prim
INNER JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc
ON ccu_prim.CONSTRAINT_CATALOG = rc.UNIQUE_CONSTRAINT_CATALOG
AND ccu_prim.CONSTRAINT_SCHEMA = rc.UNIQUE_CONSTRAINT_SCHEMA
AND ccu_prim.CONSTRAINT_NAME = rc.UNIQUE_CONSTRAINT_NAME
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu_for
ON ccu_for.CONSTRAINT_CATALOG = rc.CONSTRAINT_CATALOG
AND ccu_for.CONSTRAINT_SCHEMA = rc.CONSTRAINT_SCHEMA
AND ccu_for.CONSTRAINT_NAME = rc.CONSTRAINT_NAME
ORDER BY rc.constraint_name, for_table, prim_column
"SQL novice" <balacr@.gmail.com> wrote in message
news:1132221814.286212.141430@.g14g2000cwa.googlegroups.com...
>I am looking for a query to get the PrimaryKey Name, primary key column
> for a particular table.
> The follwing query will give me the Key Name and the Table Name but not
> the column Name. Can I get the column name also in this query.
> select A.ID,A.Name as PrimaryKey, B.Name as MasterTable from sysobjects
> A INNER JOIN sysobjects B
> on A.Parent_obj= B.ID
> where A.xType = 'PK'
>
> Thanks in Advance
>|||you could use 'sp_help <nametable>' which will inform you about that.
"SQL novice" wrote:

> I am looking for a query to get the PrimaryKey Name, primary key column
> for a particular table.
> The follwing query will give me the Key Name and the Table Name but not
> the column Name. Can I get the column name also in this query.
> select A.ID,A.Name as PrimaryKey, B.Name as MasterTable from sysobjects
> A INNER JOIN sysobjects B
> on A.Parent_obj= B.ID
> where A.xType = 'PK'
>
> Thanks in Advance
>|||Thanks Jens and Uri,
This was very helpful.

Wednesday, March 7, 2012

Pricing Model

Can any one provide me some details on the pricing of SQL server ?
I have seen a software maker selling Client-Server application with a SQL
Server as backend for only $300!.
Also, is there a small version of the SQL server that can be used as a db ?
TIA.
Well it depends on what you want to do...
By "small version" I take it that you mean a database that you never expect
to grow beyond 2 GB -> and have less than 10 users. If that is the case,
then MSDE might be your solution:
For more info, see:
http://www.microsoft.com/sql
=-Chris
"exBK" <exBK@.discussions.microsoft.com> wrote in message
news:21CDEE5C-DE2F-4AD7-B683-1A1AC2B30A09@.microsoft.com...
> Can any one provide me some details on the pricing of SQL server ?
> I have seen a software maker selling Client-Server application with a SQL
> Server as backend for only $300!.
> Also, is there a small version of the SQL server that can be used as a db
?
> TIA.
|||Thanks for your reply. I am looking for exactly what you are describing
below. So is MSDE free ?
"Christopher Conner" wrote:

> Well it depends on what you want to do...
> By "small version" I take it that you mean a database that you never expect
> to grow beyond 2 GB -> and have less than 10 users. If that is the case,
> then MSDE might be your solution:
> For more info, see:
> http://www.microsoft.com/sql
> =-Chris
> "exBK" <exBK@.discussions.microsoft.com> wrote in message
> news:21CDEE5C-DE2F-4AD7-B683-1A1AC2B30A09@.microsoft.com...
> ?
>
>

Pricing Model

Can any one provide me some details on the pricing of SQL server ?
I have seen a software maker selling Client-Server application with a SQL
Server as backend for only $300!.
Also, is there a small version of the SQL server that can be used as a db ?
TIA.Well it depends on what you want to do...
By "small version" I take it that you mean a database that you never expect
to grow beyond 2 GB -> and have less than 10 users. If that is the case,
then MSDE might be your solution:
For more info, see:
http://www.microsoft.com/sql
=-Chris
"exBK" <exBK@.discussions.microsoft.com> wrote in message
news:21CDEE5C-DE2F-4AD7-B683-1A1AC2B30A09@.microsoft.com...
> Can any one provide me some details on the pricing of SQL server ?
> I have seen a software maker selling Client-Server application with a SQL
> Server as backend for only $300!.
> Also, is there a small version of the SQL server that can be used as a db
?
> TIA.|||Thanks for your reply. I am looking for exactly what you are describing
below. So is MSDE free ?
"Christopher Conner" wrote:
> Well it depends on what you want to do...
> By "small version" I take it that you mean a database that you never expect
> to grow beyond 2 GB -> and have less than 10 users. If that is the case,
> then MSDE might be your solution:
> For more info, see:
> http://www.microsoft.com/sql
> =-Chris
> "exBK" <exBK@.discussions.microsoft.com> wrote in message
> news:21CDEE5C-DE2F-4AD7-B683-1A1AC2B30A09@.microsoft.com...
> > Can any one provide me some details on the pricing of SQL server ?
> > I have seen a software maker selling Client-Server application with a SQL
> > Server as backend for only $300!.
> > Also, is there a small version of the SQL server that can be used as a db
> ?
> > TIA.
>
>

Pricing Model

Can any one provide me some details on the pricing of SQL server ?
I have seen a software maker selling Client-Server application with a SQL
Server as backend for only $300!.
Also, is there a small version of the SQL server that can be used as a db ?
TIA.Well it depends on what you want to do...
By "small version" I take it that you mean a database that you never expect
to grow beyond 2 GB -> and have less than 10 users. If that is the case,
then MSDE might be your solution:
For more info, see:
http://www.microsoft.com/sql
=-Chris
"exBK" <exBK@.discussions.microsoft.com> wrote in message
news:21CDEE5C-DE2F-4AD7-B683-1A1AC2B30A09@.microsoft.com...
> Can any one provide me some details on the pricing of SQL server ?
> I have seen a software maker selling Client-Server application with a SQL
> Server as backend for only $300!.
> Also, is there a small version of the SQL server that can be used as a db
?
> TIA.|||Thanks for your reply. I am looking for exactly what you are describing
below. So is MSDE free ?
"Christopher Conner" wrote:

> Well it depends on what you want to do...
> By "small version" I take it that you mean a database that you never expec
t
> to grow beyond 2 GB -> and have less than 10 users. If that is the case,
> then MSDE might be your solution:
> For more info, see:
> http://www.microsoft.com/sql
> =-Chris
> "exBK" <exBK@.discussions.microsoft.com> wrote in message
> news:21CDEE5C-DE2F-4AD7-B683-1A1AC2B30A09@.microsoft.com...
> ?
>
>