Created
February 26, 2013 17:01
-
-
Save thePunderWoman/5040119 to your computer and use it in GitHub Desktop.
SQL Variable usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE CurtDev; | |
GO | |
DECLARE @id AS int; | |
--Create new ContentID for every T-Connector part in the Content table | |
--use last inserted identity value as variable, id | |
INSERT INTO Content(text, cTypeID) | |
VALUES ('Simple plug and play design eliminates the need for cutting or splicing', 2); | |
SET @id = (SELECT @@IDENTITY); | |
GO | |
--define a variable to hold contentID from Content | |
INSERT INTO ContentBridge (catID, partID, contentID) | |
VALUES(Null, 55027, @id); | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment