default value in field  
Author Message
steelbee





PostPosted: Thu Jan 27 04:32:00 CST 2005 Top

ASP/Active Server Pages >> default value in field with "select @@IDENTITY" i get the value of the last field insered.. i would
like to get also the field.name help me plaese

Web Programming409  
 
 
Steven





PostPosted: Thu Jan 27 04:32:00 CST 2005 Top

ASP/Active Server Pages >> default value in field aHR0cDovL2FzcGZhcS5jb20vc2hvdy5hc3A/aWQ9MjE3NA0KDQotLSANCg0KUmVnYXJkcw0KDQpT
dGV2ZW4gQnVybg0KVXIgSS5ULiBNYXRlIEdyb3VwDQp3d3cuaXQtbWF0ZS5jby51aw0KDQpLZWVw
aW5nIGl0IEZSRUUhDQoNCiJMZXggTHV0aG9yIiA8bWFyY29AYnJhaW4tZmFybS5jb20+IHdyb3Rl
IGluIG1lc3NhZ2UgbmV3czojOE9iQ3JFQkZIQS4zNTg4QFRLMk1TRlROR1AxMS5waHguZ2JsLi4u
DQp8IHdpdGggInNlbGVjdCBAQElERU5USVRZIiBpIGdldCB0aGUgdmFsdWUgb2YgdGhlIGxhc3Qg
ZmllbGQgaW5zZXJlZC4uIGkgd291bGQgDQp8IGxpa2UgdG8gZ2V0IGFsc28gdGhlIGZpZWxkLm5h
bWUgaGVscCBtZSBwbGFlc2UgDQp8IA0KfCANCg==

 
 
Bob





PostPosted: Thu Jan 27 07:17:32 CST 2005 Top

ASP/Active Server Pages >> default value in field Lex Luthor wrote:
> with "select @@IDENTITY" i get the value of the last field insered..
> i would like to get also the field.name help me plaese

That's not possible. The rdbms does not return this information. You need to
know your database and you need to know what your code is doing. And even
then ... Say you run an INSERT statement which inserts data into a table
that contains both an IDENTITY column and a trigger. If the trigger inserts
a record into another table containing an IDENTITY column, @@IDENTITY will
contain the value for the trigger INSERT. In SQL2000, the SCOPE_IDENTITY
function solves this problem; however, it is still up to the developer to
know what table he is inserting records into and what the name of the
IDENTITY column is.

Sorry,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"