What is the most appropriate Coldfusion cfsqltype

2019-02-24 18:50发布

问题:

When connecting from Coldfusion 8 to a MS SQL 2008 datasource, what Coldfusion cfsqltype should I use for a SQL column set to 'uniqueidentifier'.

<cfquery name="user" datasource="#ds#">
    SELECT id, username
    FROM users
    WHERE id = <cfqueryparam cfsqltype="WHAT_CF_SQL_TYPE_HERE?" value="#arguments.id#">
</cfquery>

Thanks!

回答1:

CF_SQL_CHAR or CF_SQL_IDSTAMP

see: http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_18.html