Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

reorganize records in table?

$
0
0
PartyID	PartyFunctionTypeID	Surname	FirstName	MiddleName	MiddleName2	DisplayName
1	4	Yudin	Michael	NULL	NULL	Michael Yudin
2	4	Diggins	Ben	NULL	NULL	Ben Diggins
3	4	Strait	Derrick	NULL	NULL	Derrick Strait
4	4	Mazur	Michelle	NULL	NULL	Michelle Mazur
5	4	Paluga	Nicki	NULL	NULL	Nicki Paluga
6	4	Penny	Kirk	NULL	NULL	Kirk Penny
7	5	Prefab Sprout	NULL	NULL	NULL	Prefab Sprout
8	4	Sandino Moreno	Catalina	NULL	NULL	Catalina Sandino Moreno
9	4	Pyne	Dan	NULL	NULL	Dan Pyne
10	4	iShine Auge	NULL	NULL	NULL	iShine Auge
11	4	Esposito	Mike	NULL	NULL	Mike Esposito
12	4	Eason	Eric	NULL	NULL	Eric Eason
13	4	Lee	Kristy	NULL	NULL	Kristy Lee
14	5	Rubiks' Cube	NULL	NULL	NULL	Rubiks' Cube
15	4	Funk	Matthew	C.	NULL	Matthew C. Funk
16	4	Qin	Haiyan	NULL	NULL	Haiyan Qin
17	4	Borman	Arthur	NULL	NULL	Arthur Borman
18	4	Tinker	Mark	NULL	NULL	Mark Tinker
19	4	McKeand	Carol	Evan	NULL	Carol Evan McKeand
20	4	Willis	Patrick	NULL	NULL	Patrick Willis
21	5	Every Avenue	NULL	NULL	NULL	Every Avenue
This is the party table in database. party id is primary key column, records which has party function type 5 or else not required to touch. I am dealing with only partyfunction type = 4 only, partyid upto 6 is perfect. On partyid 8 sandino must be on middle name column but that one null. Another things to fix is in partyID 10 both first name and surname on same column surname should be Augue not null. One way to fix this is manually but I have thousands of record and trying to write script to fix this scenario any Idea?

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>