|
next
|
 Subject: Xquery with SQL NEWID function Author: Ivan Pedruzzi Date: 28 Apr 2009 11:00 AM
|
See the following example
declare function ddtek-sql:NEWID() as xs:string external;
ddtek:sql-insert("subscribers",
"ID" , ddtek-sql:NEWID(),
"name" , "ivan",
"surname" , "Pedruzzi")
The subscribers table is defined as
CREATE TABLE [dbo].[subscribers](
[ID] [uniqueidentifier] NOT NULL,
[name] [nchar](50) NOT NULL,
[surname] [nchar](50) NOT NULL,
CONSTRAINT [PK_subscribers] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Hope this helps
Ivan Pedruzzi
Stylus Studio Team
|
|
|