-1

I'm fairly new to SQL Server (I'm learning with SQL Server 2008), I have this question:

I have a database "two trees test" with 2 tables in it (Employee & Product), this is the design of the Employee table:

EmployeeID   INT           Not Null (Primary key)  
FirstName    nvarchar(50)  Not Null  
LastName     nvarchar(50)  Not Null  
Title        nvarchar(50)  Not Null  
HireDate     date          Null  
BirthDate    date          Null  
Phone        nvarchar(20)  Null  
Status       bit           Not Null  

You can see I have a primary key (EmployeeID), but if I go to the edit view (so I can start to insert data), I can't see the primary key.

Thanks in advance for your help & apologies if I misspelled something (English isn't my first language), I tried to attach screenshots but I can't because I don't have 10 points yet.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • By 'edit view' do you meant you right click on the table in SSMS and press 'Edit Top 200 rows'? – Nick.Mc Jun 22 '14 at 09:50
  • When I do that I do see my PK. What happens if you press CTRL-3 to view the SQL? I guess you don't have the PK in the SQL statement. What happens if you add it in? – Nick.Mc Jun 23 '14 at 23:53
  • Actually, i open ms sql server today, and now i can see all the columns, thank you so much anyway :) – Karla Lopez Jun 25 '14 at 03:41

2 Answers2

0

Maybe the primary key is Auto-Increment which might not allow you to enter a value for it.

See this to give custom values to the primary column.

Community
  • 1
  • 1
  • yes, its auto-increment, i dont want to enter a value for that column, only see it (the column with the values), i can see all the other columns but "employee ID" – Karla Lopez Jun 23 '14 at 20:42
0

Expand your table go to KEYS Option to see the List of Key's

select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME='Your Table Name'
Vinoth_S
  • 1,380
  • 1
  • 12
  • 15