C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

How many columns in a Select?


Posted Date: 03 Nov 2009      Posted By: jebamani      Member Level: Silver     Points: 1   Responses: 6



Hi,
How many columns can be select in a sql server 2005 select statement? and also how many unique key and primary key can be create for a table? what is clustered constraint?




Thanks in advance...





Responses

Author: Mayura Sangeene    03 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

Using " Select * ", but can select All the Columns,but if u want to select some specific columns then write "Select <ColumnName1>, <ColumnName2>,...."


A table can have ONLY ONE primary key.

However this primary key can be a compound primary key comprised of more than ONE field/column.

On the Contrary A table can have more than 1 unique keys,It can be NULL

Regards
Mayura Sangeene



Author: greeny_1984    03 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,
You can select all columns in a table using select statement.
There is only one primary key per table and we can have many
unique keys in a table.

Regards,
Greeny_1984

Rate this Response[Excellent/Good/Poor]
FRESHERS check this link
Need help from me join here



Author: atulpatel    03 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,

SQL Server 2005 can have 1,024 columns per table. So you can access upto 1024 columns using SELECT Statement.

Only one Primary key can be created per table.

More than one Unique key can be created on the table. Exceed Limit will be nos of columns in the table

Using Clustered Constraint, Data is stored in order physically. Primary Key,Unique Key can be Clustered Index.

Thanks,
Atul



Author: Shameer    03 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Only one primary key can be created for one table


Author: sudha    12 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Hi,

The table must contain only one primary key. But it can have more than one unique key. We can select no of columns in the table using SELECT statement.



Author: sriram    23 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

u can select Any Number of Columns in sql server Query.

Each table can have only one primay key possible .
Primary key is defaule clusteres Index Constraint..


SriramRamaswamy



Post Reply
You must Sign In to post a response.
Next : Can not login to sql server using sql browser
Previous : How to find out the tables that have foreign keys?
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use