Stored Procdure help | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Stored Procdure help

I’ve got a a table that has a column with two possible values a or b, however i’d like to write a stored procedure that would monitor when a change occurs between the two. I’ve written the basic procedure but I’m not sure how to compare the values to just show the result when they change. here is an example of a table… index application
1 33
2 103
3 33
4 103
5 103
6 103
7 33
8 33
9 103
10 33 return would look like this
index application
1 33
2 103
3 33
4 103
7 33
9 103
10 33 I’m trying to write a report that will display this information so I can know there is a change.
Hi,<br />dont sure but do you wants to eliminate duplicate records !? refer below links :<br /><br /<a target="_blank" href=http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=8215>http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=8215</a><br /><br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br />Regards<br /><br />Hemantgiri S. Goswami<br />[email protected]<br />"Humans don’t have Caliber to PASS TIME , Time it self Pass or Fail Humans" – by Hemantgiri S. Goswami<br />
I don’t want to delete the entries because other columns tell me different information. I just want to know when there’s a change. But maybe creating temp table then delete the dups might be an idea.
check this:
select te1.* from test1 te1
inner join test1 t1 on te1.ind=t1.ind+1
where te1.val<>t1.val <<where test1 is yourtable name>>
]]>