Created
August 26, 2010 08:06
-
-
Save zarkosusnjar/551033 to your computer and use it in GitHub Desktop.
This file contains 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
<cfquery name="test" datasource="#this.dsn#" result="testing"> | |
<!--- DECLARE temp table ---> | |
DECLARE @resultSet TABLE( no INT ) | |
<!--- INSERT last current identity value into temp table ---> | |
INSERT INTO @resultSet (no) VALUES (IDENT_CURRENT('contacts')); | |
INSERT INTO contacts ( | |
firstname | |
,lastname | |
) | |
SELECT <cfqueryparam cfsqltype="cf_sql_varchar" value="Marko"> | |
,<cfqueryparam cfsqltype="cf_sql_varchar" value="Simic"> | |
UNION ALL | |
SELECT <cfqueryparam cfsqltype="cf_sql_varchar" value="Boris"> | |
, <cfqueryparam cfsqltype="cf_sql_varchar" value="Huskic"> ; | |
<!--- INSERT last inserted identity value into temp table ---> | |
INSERT INTO @resultSet (no) VALUES (scope_identity()); | |
<!--- SELECT and return values from temp table ---> | |
SELECT * from @resultSet; | |
</cfquery> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment