You'll need something like this:

<cfloop list="#selec.columnlist#" index="field">
  #selec[columnList][currentRow]#
</cfloop>

Though I'd recommend you use a dump/import rather than a SELECT/INSERT
mechanism to do it.  Be a lot faster, and probably easier on your
brain.  MySQL has a very nice 'mysqldump' utility that'll output your
data in raw format that is customizable up the wazoo, and then you can
just import that into SQL Server directly.

cheers,
barneyb

On 9/25/05, simmyana a <[EMAIL PROTECTED]> wrote:
> Hi,
>   How can I dynamically get value of columnlist.
> I need to port data from MySql to MS SQL DB. This is what I am trying to do;
>
> <cfset InsValueList="">
> <cfquery name="getTables" datasource="db1">
>   show tables
> </cfquery>
>
> <cfloop query="getTables">
>
> <cfquery name="Selec" datasource"db1">
>
>         Select * from #tablename#
> </cfquery>
> <cfset InsValueList=Selec.columnlist>
>
> <cfset InsValueList=Replace(InsValueList,",","##,##Selec.","ALL")>
> <cfset InsValueList="##Selec." & InsValueList & "##">
>
> <cfoutput query="selec">
>   <cfquery name="Selec1" datasource="#dbname#" dbtype="query">
>
>         INSERT INTO #tablename# values(#Evaluate("Selec.columnlist")#)
>   </cfquery>
>
> </cfoutput>
>
> </cfloop>
>
> "INSERT INTO #tablename# values(#Evaluate("Selec.columnlist")#)", this 
> doesn't work as it doen't evaluate column values
> how can i get column values to insert the values into table
>
> Thanks
>

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219217
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to