Monday, 15 August 2011

sql server - how to use an insert statement inside a select statement -



sql server - how to use an insert statement inside a select statement -

insert [dbo].[login] ([account_no] ,[password]) values ((select account_number sign_up ( insert sign_up values(999,'ani','m',20,'9030000018','a','a','b') ) ) ,123) go

i want insert row in sign_up , should homecoming account_number inserted login table . getting error near 'where '

you might utilize output clause accomplish 1 single query, instead.

insert sign_up output inserted.account_number,'apassword' [dbo].[login] ([account_no],[password]) values(999,'ani','m',20,'9030000018','a','a','b')

sql-server sql-server-2012

No comments:

Post a Comment