-
1. Re: SQL Server not processing @@Identity?
Dan Bracuk Mar 12, 2012 9:15 AM (in response to sakonnetweb)That's a very specific error message. It tells you exactly what the problem is.
Maybe that column was an autoincrement field in access and is something else in sql server.
-
2. Re: SQL Server not processing @@Identity?
sakonnetweb Mar 12, 2012 10:21 AM (in response to Dan Bracuk)Thanks Dan
For future reference, Think I just solved the issue.
@@Identity AS new_bid_ID had nothing to do with it.When one exports Access tables to SQL Server, one needs to:
1) Re-Declare the key column, even though they were keys in Access, and
2) Modify each Key column - Column Properties/Table Designer/Intentity Specification/ set (Is Identity) to yes.
Thanks again
Norman
-
3. Re: SQL Server not processing @@Identity?
-==cfSearching==- Mar 12, 2012 11:12 AM (in response to sakonnetweb)sakonnetweb - I noticed your queries are not using cfqueryparam. SQL Server is vulnerable to sql injection in ways that Access is not. Be sure to add cfqueryparam to all of your cfquery's as soon as possible.
<cfquery datasource="#Request.BaseDSN#" name="get_bid_ID">
SELECT @@Identity AS new_bid_ID
</cfquery>
</cftransaction>As an aside, now that you are running SQL Server you can take advantage of cfquery's result attribute to grab the new identity value ie #theResultName.IDENTITYCOL#

