4
我有2個表,custlogin
和custinfo
:SQL Server存儲過程在多個表中插入
custlogin
:
custid int primary key auto notnull
custusename varchar(25)
custpassword varchar(50)
custinfo
:
custid foriegnkey custlogin.custid ondelete set NULL
custfirstname varchar(25)
custlastname varchar(25)
custaddress varchar(100)
我想寫一個存儲過程它將插入到兩個表中
更確切地說,插入custlogin
與custusername custpassword
,這將返回custid
用作custinfo
外鍵。
我已經搜索很多,但我沒有找到任何解決方案。
你不可能搜索到硬 - http://stackoverflow.com/questions/13318924/how -do -i-insert-into-two-tables-all-at-a-stored-procedure – Goose
檢查此鏈接 - http://stackoverflow.com/questions/5762942/stored-procedure-to-插入兩桌,有關係 – SAT