Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent help-IDentity column

Status
Not open for further replies.

sdh

Programmer
Apr 30, 2001
121
0
0
GB

on a replicated db this has started to return NULL
for scope_identity any ideas why?


INSERT

INTO "dbtophorse"."dbo"."tbOrder"("tbOrd_total","tbOrd_datetime","tbUsr_id","tbshipingID")
VALUES(@orderTotal,GETDATE() ,@User,@tbshippingId)

SET @tbOrd_id=Scope_Identity()

Thanks
SDH
 
The only time SCOPE_IDENTITY will return NULL is if you haven't inserted into a table with an identity column yet. Are you sure the tbOrder table still has an identity column?

--James
 
Yes

If i append return @tbOrd_id to my sp I get a value
on the replication master
However on the replicated databases running the same procedure I get NULL

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top