Id column based on other columns I have a simple database with 2000 rows

create table [TableName](
    [variable1] [varchar](50) not null,
    [state] [varchar](50) not null, 
    [date] [date] not null
)


That look like this

[variable1] [state] [date]
 A           UT      2015-01-01
 A           UT      2015-01-02
 B           UT      2015-01-02
 B           UT      2015-01-02
 A           TX      2015-01-01
 C           TX      2015-01-01
...


I want to add and identity column that would be based on variable1 and state so the table would look like this

[MyID] [variable1] [state] [date]
 1      A           UT      2015-01-01
 1      A           UT      2015-01-02
 2      B           UT      2015-01-02
 2      B           UT      2015-01-02
 3      A           TX      2015-01-01
 4      C           TX      2015-01-01
 ...


add [MyID] [int] identity(1,1) not null doesn't work, since it just gives each row a unique id. 
I want each distinct value in variable1 column to have a unique id, but I want to also use state column incase several states have same value
Possible duplicate https://stackoverflow.com/questions/1545571/how-do-i-make-a-composite-key-with-sql-server-management-studio

It sounds like what you are wanting is a composite key.  There is a T-SQL example in the link provided.