Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to find field that is an identity for a table

Status
Not open for further replies.

shanghai2004

Programmer
Dec 16, 2004
37
CA
Dear Expert,

Our company installed Tenrox(an application) to SQL server. The installer assumed the collation of the SQL server is case insensitive which is Tenrox required. But the SQL server was set as case sensitive.
Now I need to fix this problem. Alter database and alter table statements don't work becaise of primary keys and unique index. The suggestion from Tenrox is:
1. create a empty database by attach the template files they provided (then is should be case insensitive)
2. find and remove the duplicates that were entered in Tenrox
3. export data from Tenrox database
4. import to the empty database

I am wondering, how do I deal with those field values that are created by system. For examples: timestamp field and identity field.

Help please

Thanks
 
The following query will show you all the fields in your database that are identity fields. Hope it helps.

Make sure you are using the database first.
Code:
select * 
From   Information_Schema.Columns 
Where  COLUMNPROPERTY(OBJECT_ID(Table_Name),Column_Name,'IsIdentity') = 1

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
And for the timestamp fields....

Code:
select * 
From   Information_Schema.Columns 
Where  data_type = 'timestamp'

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top