I have a column rndm
in my table [guests]. Now, for the field Default value or Binding
for the table, whenever a new row is inserted I want to automatically insert a 10-character random string into this column as the default value.
This random string may not contain special characters, only characters from a-zA-Z0-9
. What is the best approach to achieve this?
To be clear: I don't want to generate this random string in my .NET code, I want it to be generated within SQL Server. And I want to paste this string generation directly into the field Default value or Binding
for the table, so not a separate SQL statement. So for example like it works when pasting getdate()
into the field Default value or Binding
.