Sunday, March 25, 2012

@@ identity does not work ?

By standard i try my questions in SQL Mangment.

set nocount on
insert into [order]
(orderdate,deliverydate,status,Totalprice,customerID)
values(2006-02-23,2006-02-23,'N',10000,10)
(insert into temp (orderid)values(@.@.identity))

Major Error 0x80040E14, Minor Error 25569
> set nocount on
insert into [order]
(orderdate,deliverydate,status,Totalprice,customerID)
values(2006-02-23,2006-02-23,'N',10000,10)
(insert into temp (orderid)values(@.@.identity))
Invalid set option. [ Set option = nocount ]

Without Nocount:

insert into [order]
(orderdate,deliverydate,status,Totalprice,customerID)
values(2006-02-23,2006-02-23,'N',10000,10)
(insert into temp (orderid)values(@.@.identity))

Major Error 0x80040E14, Minor Error 25501
> insert into [order]
(orderdate,deliverydate,status,Totalprice,customerID)
values(2006-02-23,2006-02-23,'N',10000,10)
(insert into temp (orderid)values(@.@.identity))
There was an error parsing the query. [ Token line number = 4,Token line offset = 1,Token in error = ( ]

How do i get @.@.identity to work. I understand that @.@.identity only can be used in the sam insert session.

You can use an alternative solution to @.@.IDENTITY: retrieve the next identity value using the INFORMATION_SCHEMA.COLUMNS data. Try this command:

SELECT * FROM INFORMATION_SCHEMA.COLUMNS

You will see all sorts of interesting info with SQL Mobile / Everywhere.

|||What is SQL everywere .. is it the same as Sql mobile or a completey other instance of Sql server ?|||

SQL Everywhere is same as SQL Mobile expect that it will be supported on Desktop as well as Devices. SQL Mobile was the compltete story for Devices, but now, with the desktop restriction removed, one can develop apps for desktop using SQL Everywhere (Earlier one needed VS2005 or ss2005 to develop app on desktop).

Also SQL Everywhere has extra features like |DataDirectory| and ClickOnce. Please let us know your specific question on this.

Sachin

No comments:

Post a Comment