Your technology certification is waiting. Enroll in Cloud Class ®
Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
CREATE PROCEDURE sprGetUserInfo
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
IF NOT EXISTS(SELECT TOP 1 ID FROM table2 WHERE userid = @UserID)
--Insert first record
INSERT INTO table2 (userid,currentad_id)VALUES (@UserID,1)
UPDATE table2 SET currentad_id = currentad_id+1 WHERE userid = @UserID
SELECT table1.*, table2.currentad_id FROM table1 INNER JOIN table2 ON table1.userid = table2.userid WHERE table1.userid = @UserID
Open in new window
INSERT YourTable(UserID, ID2)
SELECT TOP 1
SELECT @UserID, 1 ID2
SELECT TOP 1
@UserID, ID2 + 1
WHERE UserID = @UserID
ID2 DESC) x
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
This course will introduce you to C++ 11 and teach you about syntax fundamentals.