Question

<CFQUERY Name="LoadCompletions"  datasource="#request.datasource#"> 
SELECT n.*, u.UserID into ##Completions
FROM 
    OPENROWSET(
        'Microsoft.ACE.OLEDB.12.0',
        'Excel 12.0;HDR=YES;Database=#Destination_File#',
        'SELECT * FROM [Sheet1$]') n
    inner join LE_User u on 's'+n.id = u.login_name
</cfquery>

I checked all over google to see what ##Completions means. Could someone help me out please? When I try to dump it, its giving the same thing ##Completions.

Was it helpful?

Solution

The ## is to escape a literal # so it is part of the SQL passed to the database. (As opposed to marking a CFML hash expression.)

#tablename is Microsoft SQL Server syntax for a local temporary table.

The Completions bit is just an arbitrary table name (hence why searching for it wouldn't bring up anything relevant).

Note that there are also global temporary tables, written as ##tablename, which would need to be escaped to ####tablename in cfquery.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top