| Author |
Topic |
|
petek
Posting Yak Master
192 Posts |
Posted - 2009-07-14 : 02:46:20
|
| Hi,Firstly thanks for looking......;I need to replace column data from my production server to my test box.Is there a way replace the column data with random data?cheersPeteKind RegardsPete. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-14 : 03:03:47
|
you have to write a query to do that. Make use of rand() or newid() to generate random data KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
petek
Posting Yak Master
192 Posts |
Posted - 2009-07-14 : 03:25:31
|
| Hi have something like .......select top 10 newid() as [ContactName], [ContactName], [ContactTitle] FROM [Northwind].[dbo].[Customers]this generates a uniqueidentifier; can this be modified to use less letters???ideally i need to mix the contents up....Kind RegardsPete. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-14 : 03:31:43
|
use LEFT() to limit the numbers of required charactersselect left(convert(varchar(38), newid()), 10) KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-14 : 03:33:40
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2008/04/04/populating-sample-data.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
petek
Posting Yak Master
192 Posts |
Posted - 2009-07-14 : 03:58:59
|
| Thanks both for your input.....both great help.but i lets say i have two columns [FirstName] and [SecondName] and i want to generate date from them.ideally i would like to replace FirstName with SecondName and then randomally sort both columns with a update.....Kind RegardsPete. |
 |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-07-14 : 04:36:00
|
hi, madhi...sorry t bother...can you explain abit to me what is checksum...i looks at books online and it looks like something to do with index(don't understand index at all)sorry sorry Hope can help...but advise to wait pros with confirmation... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-14 : 05:05:23
|
quote: Originally posted by waterduck hi, madhi...sorry t bother...can you explain abit to me what is checksum...i looks at books online and it looks like something to do with index(don't understand index at all)sorry sorry Hope can help...but advise to wait pros with confirmation...
http://www.mssqltips.com/tip.asp?tip=1023MadhivananFailing to plan is Planning to fail |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-07-14 : 05:06:30
|
quote: Originally posted by petek Thanks both for your input.....both great help.but i lets say i have two columns [FirstName] and [SecondName] and i want to generate date from them.ideally i would like to replace FirstName with SecondName and then randomally sort both columns with a update.....Kind RegardsPete.
Post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-07-14 : 05:16:40
|
thx madhi ^^ Hope can help...but advise to wait pros with confirmation... |
 |
|
|
|