Skip to content

Instantly share code, notes, and snippets.

@thePunderWoman
Created February 26, 2013 17:01
Show Gist options
  • Save thePunderWoman/5040119 to your computer and use it in GitHub Desktop.
Save thePunderWoman/5040119 to your computer and use it in GitHub Desktop.
SQL Variable usage
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