I tried the same with SQL server and unique identifier, but to no avail. Unique identifier is not returned.
Extract my definition:
CREATE TABLE [dbo].[MyTable](
[ID] [uniqueidentifier] NOT NULL,
[Data] [nvarchar](255) NULL
)
ALTER TABLE [dbo].[MyTable] ADD DEFAULT (newid()) FOR [ID]
When I insert with Sequel:
DB[:MyTable].insert( :Data => 'data' )
the dataset is added with a unique identifier, but the return code if Dataset # insert is nil.
WITH
DB[:MyTable].insert(:ID => Sequel.function(:newid), :Data => 'data' )
.
key = Sequel.function(:ID)
DB[:MyTable].insert(:ID => key, :Data => 'data' )
"" - , . Sequel.function(:ID).f " ". "- error
, :
class MyTable < Sequel::Model(:MyTable); end
entry = MyTable.create(:Data => 'data')
$uniqueidentifier = entry[:ID]