How would you to this in (say) MySQL?
Munson, Jacob wrote: > Keep in mind that most other databases (besides SQL Server) don't allow > you to send two queries with at once like this. It's very insecure, > because of sql injection possibilities. But since you guys are all > talking about MS SQL, this works fine. :) > >> Moreover, a better solution would be something like this >> (assuming SQL Server): >> >> <cftransaction> >> <cfquery name="qInsertData" datasource="#APPLICATION.dsn#"> >> INSERT INTO t_doctors (#ColNames#) >> VALUES (#preserveSingleQuotes(ColValues)#); >> SELECT SCOPE_IDENTITY() AS newpkey; >> </cfquery> >> </cftransaction> >> >> Pete > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236885 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

