Reputation: 6403
I'm new to Mssql 2008. In Oracle when im trying to create stored prod based on the value from another table i can use something similar like this;
Select username into temp_value from logintbl;
Then i insert the temp_value
to my table. How do i achieve this in MSSQL? Any comments,reference or advice is highly appreciated. Thanks.
Upvotes: 0
Views: 156
Reputation: 21034
Try:
DECLARE @Username nvarchar(100)
SELECT @Username = username FROM logintbl
INSERT INTO table1 (usernames)
VALUES (@username)
Upvotes: 2