Hey all I recently converted a site over from ASP to ColdFusion and the
backend is MS SQL Server. I have a very simple query that for some reason is
returning zero records using a cfquery but when I put the same SQL directly
into SQL Server Management Studio it returns over 300 results. Here is the
query:

<cfquery name="rs" datasource="stockton">
SELECT DocList.DocName AS DocList_DocName, DocList.DocTitle, DocWS.DocName
AS DocWS_DocName, DocWS.WatershedCode
FROM DocList INNER JOIN DocWS ON DocList.DocName = DocWS.DocName
ORDER BY DocList.DocName
</cfquery>
<cfoutput>#rs.recordcount#</cfoutput>

The tables are:

DocList
----------
DocName (PK, varchar(150), not null)
DocTitle (varchar(150),null)
Exhibit(varchar(50),null)

DocWS
----------
ID(PK,int,not null)
DocName(varchar(150),null)
WatershedCode(varchar(150),null)

As you can see I am simply trying to return all results where the DocName in
both tables match which happens to be 329 rows when I put the query in SQL
Server Management Studio but zero when using the query above in CF.

I'm inclined to think there is something peculiar about SQL Server that is
not allowing CF to return the query correctly. Any insights?

Any help would be appreciated!!!!!

Thanks,
Aaron


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323908
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to