By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,363 Members | 2,450 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,363 IT Pros & Developers. It's quick & easy.

Flag in SQL

P: 92
Hi,

Is there any Flag function in SQL Server. I want to set Flag=1 at 1st time entry. if i change that value or edit its value same record values, it's value should become 2.
I dont Know whether itz front end work or SQL holds any Flag function. So, can any one suggest me.

Thanks in Advance.
May 24 '08 #1
Share this Question
Share on Google+
4 Replies


debasisdas
Expert 5K+
P: 8,127
You need to add an additional field to database and keep that updating as per your requirment.
May 24 '08 #2

P: 92
You need to add an additional field to database and keep that updating as per your requirment.

Thanks for replying me,

Can u give me more explanation to this. yes i m hving one field has Flag. But i dont know hw to do this.

Can u explain me with Query Example. Please.

Limno
May 24 '08 #3

debasisdas
Expert 5K+
P: 8,127
You need to write a trigger for the purpose.
May 24 '08 #4

ck9663
Expert 2.5K+
P: 2,878
1. Create a field on your table for this flag.

2. Set the default value of this field to 1.

3. Create a trigger that will handle the replace of the value for this field for every update or delete.

-- CK
May 25 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.