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 |
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-05-14 : 03:00:06
|
| i have a table in northwind Db right now i want to change it to the adventureworks Db. can u give me a suggestion.KaShYaP |
|
|
karthik_padbanaban
Constraint Violating Yak Guru
263 Posts |
Posted - 2010-05-14 : 03:08:20
|
| run the script in adventureworks DB. replace <tablename> with yours.use adventureworks select * into <TableName> from northwind..<TableName>Karthikhttp://karthik4identity.blogspot.com/ |
 |
|
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-05-14 : 03:15:54
|
| it works but i can't find the table in adv db for ex table name is actors which is in north wind can you modify your query plzKaShYaP |
 |
|
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-05-14 : 03:30:00
|
| yes it works but it is copying the table i want to replace the full data from north wind to Adventure without duplicates in northwindKaShYaP |
 |
|
|
karthik_padbanaban
Constraint Violating Yak Guru
263 Posts |
Posted - 2010-05-14 : 03:57:57
|
| try this.select col1,col2 into <tablename> from (select *,row_number()over(partition by col2 order by col2) as col3 from northwind..<tablename>) a where a.col3 = 1Karthikhttp://karthik4identity.blogspot.com/ |
 |
|
|
kashyapsid
Yak Posting Veteran
78 Posts |
Posted - 2010-05-14 : 06:02:46
|
| Example:-Filmid. FirstName. LastName.1. Audrey. Hepburn.1. Rex. Harrison.3. Anthony. Hopkins.This is the table which is present in Northwind. the Name of the table is actorsPlz considerKaShYaP |
 |
|
|
karthik_padbanaban
Constraint Violating Yak Guru
263 Posts |
Posted - 2010-05-14 : 08:50:57
|
quote: Originally posted by kashyapsid Example:-Filmid. FirstName. LastName.1. Audrey. Hepburn.1. Rex. Harrison.3. Anthony. Hopkins.This is the table which is present in Northwind. the Name of the table is actorsPlz considerKaShYaP
then this thing will work..use adventureworks select * into <TableName> from northwind..<TableName>Karthikhttp://karthik4identity.blogspot.com/ |
 |
|
|
|
|
|