Inserting a Random Guid?

i have a script to create client data, however, i want to insert new IDs/guids to the table for every session. But the following isn’t working if i try to insert to a uniqueidentifier column, if i add to a vchar, it works.
Any ideas?

val testGuids = Iterator.continually(Map(“testGuids” → (Random.alphanumeric.take(8).mkString + “-” + Random.alphanumeric.take(4).mkString + “-” + Random.alphanumeric.take(4).mkString + “-” + Random.alphanumeric.take(4).mkString + “-” + Random.alphanumeric.take(12).mkString)))

Lucy Healy​

Test Team Leader

2 Charter Court Newcomen Way Severalls Business Park
Colchester, CO4 9YA

Iress Coronavirus support

The contents of this email originated from Iress. For this purpose Iress includes Iress Limited and/or any of its subsidiaries, holding companies and trading entities. ​If you have received this email in error please notify the sender immediately and delete this email.


No idea about what you’re doing but SQL Server uniqueidentifers are bytes not Strings.