| |

VerySource

 Forgot password?
 Register
Search
View: 845|Reply: 7

I have the same row records in the database, how to update only one of them.

[Copy link]

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-22 16:40:01
| Show all posts |Read mode
I want to update through the SqlDataAdapter, do not delete and insert first, modify the record of a certain row directly in the returned table, and then update the data source, what should I do? After trying for a long time without success
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-2 09:18:01
| Show all posts
At least the key values ​​are not repeatable
Reply

Use magic Report

0

Threads

25

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-2-4 12:15:01
| Show all posts
select * from tablename where = condition // remove the same records
Locate a record update:
update tablename
set deptno = 20
where rownum = record number;

Not tested.
Reply

Use magic Report

0

Threads

73

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-2-5 22:30:01
| Show all posts
If the table has no key values, then it should be unlikely.
Upstairs is ORACLE, SQLSERVER does not have ROWNUM
Reply

Use magic Report

0

Threads

12

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-3-13 17:15:01
| Show all posts
You must have a primary key.The database should not allow exactly the same records.It is not possible to use identity as the primary key.
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-29 16:30:02
| Show all posts
It's OK to distinguish by ID.
Reply

Use magic Report

1

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 Hong Kong

Post time: 2020-4-5 20:00:02
| Show all posts
top 1 where ........
Reply

Use magic Report

1

Threads

5

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-5-4 15:30:01
| Show all posts
It's just annoying without a master

Very special

Hey----------------
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list