Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Reg
Starting Member
7 Posts |
Posted - 2007-12-07 : 06:06:32
|
| I have a table called "jbtest"eg..jbtestjbID int,jpostname varchar(200)I have a select CURSOR ,,eg...DECLARE jp_Cursor CURSOR FORSELECT jpid, jpostnameFROM jbtestOPEN jp_CursorFETCH NEXT FROM jp_CursorWHILE @@FETCH_STATUS = 0BEGIN FETCH NEXT FROM jp_CursorENDCLOSE jp_CursorDEALLOCATE jp_CursorI have inserted data into [colun_jpostname]How can i delete repeating "jpostname" from using CURSOR?Please !Rg |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-07 : 06:39:39
|
You mean you want to delete duplicate records for column jpostname? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-07 : 07:14:40
|
| Can you explain what you are trying to do?Probably you need distinct jpostnameMadhivananFailing to plan is Planning to fail |
 |
|
|
Reg
Starting Member
7 Posts |
Posted - 2007-12-10 : 00:51:49
|
| yes, I am trying to delete duplicate jpostname.select * from jbtest where jpostname > 1if i write like this.... ERROR MGS...Conversion failed when converting the varchar value 'Cadet Planter' to data type int.Rg |
 |
|
|
Reg
Starting Member
7 Posts |
Posted - 2007-12-10 : 01:01:03
|
| or delete from jbtest where jpostname > 1I am still geting the same ERROR MGS....Conversion failed when converting the varchar value 'Cadet Planter' to data type int.Rg |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Reg
Starting Member
7 Posts |
Posted - 2007-12-19 : 02:15:00
|
| I got it!Thank you madhivananRg |
 |
|
|
|
|
|