ericnet
Programmer
- Mar 29, 2006
- 106
I have a table called ‘Sessions’ where I store some information about every client that visits my website. In that table I have a column called ‘Client_cookie’ where I want to store an identifier that must be unique for every client (but not for every new row. Since a client can have many sessions), and this column isn’t the PK. How can I achieve this?
This is the table:
-Sessions Table-
Session_id (bigint) IDENTITY (1, 1) NOT NULL
User_num (if user logs in) Is the user id in the DB for registered users
Client_cookie (permanent cookie that identifies the machine)
Session_type (Registered or Anonymous) Registered when user logs in during the session, and Anonymous if user doesn’ t log in
IP_address
User_Agent
Is_Carwler (‘True’ or ‘False’)
Browser_name (i.e. IE)
Browser_version (i.e. 6.0)
Javascript_enabled (‘True’ or ‘False’)
Cookies_enabled (‘True’ or ‘False’)
UrlReferrer
By the way, which is the difference between the Primary Key and the Identity? Is the same concept?
Thank you,
Cesar
This is the table:
-Sessions Table-
Session_id (bigint) IDENTITY (1, 1) NOT NULL
User_num (if user logs in) Is the user id in the DB for registered users
Client_cookie (permanent cookie that identifies the machine)
Session_type (Registered or Anonymous) Registered when user logs in during the session, and Anonymous if user doesn’ t log in
IP_address
User_Agent
Is_Carwler (‘True’ or ‘False’)
Browser_name (i.e. IE)
Browser_version (i.e. 6.0)
Javascript_enabled (‘True’ or ‘False’)
Cookies_enabled (‘True’ or ‘False’)
UrlReferrer
By the way, which is the difference between the Primary Key and the Identity? Is the same concept?
Thank you,
Cesar