How to Generate script of tables in SQL Server that is compatible for MySQL?
Dear All,
I want a part of the tables of my database of SQL Server 2008 R2 to move to MySQL database. For that, I generated script in SQL Server. But that did not run in MySQL. The MySQL database is in different server. So, have anyone any better idea?
Thank and Regards,
Anujit Karmakar
Anujit Karmakar Sr. Software Engineer
Microsoft does not have any tools to migrate TO MySQL. I suggest you post your question to a MySQL forum. Or hire a consultant.
Similar Messages
-
How to Create a Temporary Table with SQL Server
I know you can create a temporary table in SQL Server 2000, but not quite sure how to do it in CFMX 7, i.e., does the SQL go inside a <CFQUERY dbtype="query"> tag?
I'm pulling the main set of records from an Oracle server (1st data source), but it does not contain employee names, only employee IDs. Since I need to show the employee name along with the Emp ID, I'm then pulling a list of "current" employee names from a SQL Server (2nd data source), which is the main database on our CF server.
I've got a QofQ that works fine, except it only matches EmpIDs that exist in both result sets. Employees who are no longer employed, don't match, and don't display. Since I can't do a LEFT OUTER JOIN with a QofQ, what I need to do is get the records from the Oracle server into the SQL Server. Preferably in a temporary table.
I was hoping if I could get those Oracle records written to a temp table on the main SQL Server, in same database as the Employee Name table, I could then write a normal <CFQUERY> that uses a LEFT OUTER JOIN.
I think I could probably write a Stored Procedure that would execute the SQL to create the temporary table, but am trying to avoid having to write the SP, and do it the simplest way.
This query will be a program that can be run hundreds of times per day, with a form that allows users to select date ranges, locations, and other options. That starts the queries, which creates the report. So I just need the temp table to exist only until all the SQL has run, and the <CFOUTPUT> has generated a report.
If the premise is right, I just need some help with the syntax for creating a SQL Server temp table, when you want to write records to it from an external data source. I'm trying the following, but getting an error:
<CFQUERY name="ITE_Temp" datasource="SkynetSQL">
CREATE TABLE #MyTemp
( INSERT INTO #MyTemp
ITE2.TrueFile char (7) NOT NULL,
ITE2.CountOfEmployee int NULL,
ITE2.DTL_SUBTOT decimal NULL,
ITE2.EMPTYPE char (3) NULL,
ITE2.ARPT_CD char (3) NULL
</CFQUERY>
So I actually created a permanent table on the SQL Server, and wrote the below SQL, which does work, and does write the records to table. I can then write another CFQUERY with a LEFT OUTER JOIN, and get all the records, including those that don't have matching employee name:
<CFQUERY datasource="SkynetSQL">
<CFLOOP index="i" from="1" to = "#ITE2.RecordCount#">
INSERT INTO ITE_Temp
(FullFile,
EmployeeCount,
DTL_Amount,
EmployeeType,
station)
VALUES ('#ITE2.TrueFile[i]#',
#ITE2.CountOfEmployee[i]#,
#ITE2.DTL_SUBTOT[i]#,
'#ITE2.EMPTYPE[i]#',
'#ITE2.ARPT_CD[i]#')
</CFLOOP>
</CFQUERY>
But, I hate to have to create a table and physically write to it. For one, it seems slower, and doing it in temp would be in memory, and probably much faster, correct? Is there some way to code the above, so that it does something similar, but in a TEMPORARY TABLE? If I can figure out how to do this, I can pull data from multiple data sources and servers, and using SQL Server temp tables, work with the data as if it was all on the same SQL Server, and do some cool reports.
Everything I've done for the past few years, has all been from data from a single source, whether SQL Server, or another server. Now I need to start writing reports where data can come from 3 or 4 different servers, and be able to do joins (inner and outer). Thanks for any advice/help. Much appreciated.
GaryWhile waiting to hear back, I was able to write the query results from an outside Oracle server, to a table on the local SQL Server, and do the LEFT OUTER JOIN required for the final query and report to work. That was with this syntax:
<CFQUERY name="AddTableRecords" datasource="MyTable">
TRUNCATE TABLE ITE_Temp
<CFOUTPUT query="ITE2">
INSERT INTO ITE_Temp
(FullFile,EmployeeCount,DTL_Amount,EmployeeType,station)
VALUES
('#TrueFile#', #CountOfEmployee#, #DTL_SUBTOT#, '#EMPTYPE#', '#ARPT_CD#')
</CFOUTPUT>
</CFQUERY>
However, I was not able to write to a temporary table AND read the results. I got the syntax to run to write the above results to a temporary table. But when I tried to read and output the results from the temp table, I got an error. Also, it wouldn't take the single "#" (local) only the global "##" table var, using this syntax. Note that if I didn't have the DROP TABLE in the beginning, the 2nd time you run this query, you get an error telling you the table already exists.
<CFQUERY name="ITE_Temp2" datasource="MyTable">
DROP TABLE ##MyTemp2
CREATE TABLE ##MyTemp2
FullFile char (7) NOT NULL,
EmployeeCount int NULL,
DTL_Amount decimal NULL,
EmployeeType char (3) NULL,
station char (3) NULL
<CFOUTPUT query="ITE2">
INSERT INTO ##MyTemp2 VALUES
'#ITE2.TrueFile#',
#ITE2.CountOfEmployee#,
#ITE2.DTL_SUBTOT#,
'#ITE2.EMPTYPE#',
'#ITE2.ARPT_CD#'
</CFOUTPUT>
</CFQUERY>
So even though the above works, I could use some help in reading/writing the output. I've tried several things similar to below, but they don't work. It't telling me ITE_Temp2 does not exist. It's not easy to find good examples of creating temporary tables in SQL Server.
<CFQUERY name="QueryTest2" datasource="SkynetSQL">
SELECT *
FROM ITE_Temp2
</CFQUERY>
<CFOUTPUT query="ITE_Temp2">
Output from Temp Table<br>
<p>FullFile: #FullFile#, EmployeeCount: #EmployeeCount#</p>
</CFOUTPUT>
Thanks for any help/advice.
Gary. -
Need Guide to create a table in SQL Server and Process data for JDBC
Dear All,
Scenario:JDBC to JDBC
I need to practice JDBC to JDBC scenario and for that i need to create a table in SQL server for sender ,receiver and update i have installed SQL Server and no idea about creation of table and Connection string for PI.
I want you to explain each and every step for the Table Creation ,Driver and connection string.
Thanks in Advance.Try searchin in the forum and then google. This forum is not for teaching the basics.
VJ -
How to update or populate table in SQL server from PL/SQL
Hello - I am starting in the fascinating world of PL/SQL. One of the first task I've been assigned is to rewrite a code (basically I was thinking of creating a package with proc included) on PL/SQL that updates and/or populates tables in MS SQL Server. How should I do this? Is it doable? I guess it is. How can I call tables from others databases from PL/SQL? How to establish the conecction? where? It should be included in the package?
Any help will be appreciated
Thanks,
CCSee PL\SQL and SQL Server
-
How to provide joins between oracle tables and sql server tables
Hi,
I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
how to provide joins between oracle tables and sql server tables ? Any help on this
Regards,
Malliuser10675696 wrote:
I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join. -
How can we find the most usage and lowest usage of table in Sql Server by T-SQL
how can we find the most usage and lowest usage of table in Sql Server by T-SQL
The table has time stamp column
StartedOn datetime
EndedOn datetimeThe Below query has been used , but the textdata column doesnot include the name of the table ServiceLog.
SELECT
FROM
databasename,
duration
fn_trace_gettable('F:\Program
Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\log_148.trc',
default)
WHERE
DATABASENAME='ZTCFUTURE'
AND TEXTDATA
IS
NOT
NULL
--AND TEXTDATA LIKE 'SERVICE%'
order
by cpu
desc; -
Hi,
I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job. Actually I have to automate this job. Few files are in same format(with same column names
and datatypes) where others are not.
1. Do I need to create 20 different projects ?
or
Can I implement this in only one project by having 20 packages?
or
Can I do this in one project with only one package?
Thanks in advance.As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
Public
Sub Main()
' Add your code here
Dim f1
As FileStream
Dim s1
As StreamReader
Dim date1
As
Object
Dim rline
As
String
Dim Filelist(1)
As
String
Dim FileName
As
String
Dim i
As
Integer
i = 1
date1 =
Filelist(0) =
"XYZ"
Filelist(1) =
"123"
For
Each FileName
In Filelist
f1 = File.OpenRead(FileName)
s1 = File.OpenText(FileName)
rline = s1.ReadLine
While
Not rline
Is
Nothing
If Left(rline, 4) =
"DATE"
Then
date1 (i)= Mid(rline, 7, 8)
i = i + 1
Exit
While
End
If
rline = s1.ReadLine
End
While
Next
Dts.Variables(
"date").Value = date1(1)
Dts.Variables(
"date1").Value = date1(2)
Dts.TaskResult = ScriptResults.Success
End
Sub -
How to use create-default-dbms-tables in SQL Server 2000
Hi everyone,
I'm new in EJB development. I'm trying to deploy a CMP to Weblogic 8.1 SP1 using
JBuilderX. I configured a ConnectionPool and DataSource to allow the CMP to access
the SQL Server 2000. However, I cannot deploy the CMP if I didn't create the table
in SQL Server manually. Does anyone know how to use the create-default-dbms-tables?Refer to
http://e-docs.bea.com/wls/docs81/ejb/DDreference-cmp-jar.html#1162249
"Keith" <[email protected]> wrote:
>
Hi everyone,
I'm new in EJB development. I'm trying to deploy a CMP to Weblogic 8.1
SP1 using
JBuilderX. I configured a ConnectionPool and DataSource to allow the
CMP to access
the SQL Server 2000. However, I cannot deploy the CMP if I didn't create
the table
in SQL Server manually. Does anyone know how to use the create-default-dbms-tables? -
How to transfer database tables from sql server 2000 to oracle 10g
Hi,
I have a database and tables in sql server 2000. I have to transfer those data to Oracle 10g. I have installed Oracle warehouse Builder ETL Tool. Using this how can i transfer data. Any help is vary helpful for me.
Thanks in advance.you have to do it using ODBC HS.
1. Configure ODBC connection through gateway.
2. Create a initxxx.ora file with HS config.
restart gateway listener services
3. on target o/s add entries to your tnsnames.ora
4. On your target o/s create a db link
restart listener on target
cheeck this out.Non-Oracle connection through HS issue
Edited by: Darthvader-647181 on Jan 29, 2009 2:02 AM -
How to delete HFM Application Tables in SQL
Hi Gurus
1.How to delete HFM Application Tables in SQL?
Manually its deleting but each application having 120-150 tables? how to do this in a single shot?
I have deleted few applications using workspace/ shared services, but still its showing under HFM server under SQL Tables.
Please help me
regards
SmileeHi Smilee,
1. If the application can be opened in Financial Management web interface, go to the Manage Taskflows module and make sure that no taskflows still exist for this application. Delete any existing taskflows.
2. If the application exists in Shared Services, right click on the application in Shared Services and try to delete the application from there
3. Stop Hyperion Shared Services and all Financial Management Windows processes and take backups of the relational database schemas of both.
4. Check the relational database repository of Hyperion Shared Services, in the table "ces_apps" and make sure that there are no more rows containing the appname "EXAMPLE". If row still exists you should seek help from Oracle Global Software Support to clean up the Hyperion Shared Services before proceeding.
5. It is possible to remove all content for a deleted application from the Financial Management relational database. Extreme care should be taken when manually manipulating database tables as permanent damage can be done to the intended application and other applications if the wrong content is deleted.
a) Begin by deleting all tables, indexes, sequences and package objects that begin with the application name
b) Delete any tables beginning HSV_appname_xxxxxx
c) Delete any rows from the HSX_CLUSTER_xxxxx tables referring to the application.
d) Delete any rows from the HSV_ACTIVITY_KILL_USERS, HSV_ACTIVITY_NO_ACCESS, HSV_ACTIVITY_SESSIONS and HSV_ACTIVITY_USERS and HSV_USERS_ON_SYSTEM that refer to the application name.
d) Delete the row containing name of the application from the HSX_DATASOURCES table.
6. The next time all the Hyperion services are started again, the application should be safely removed from Windows client.
You can contact your DBA to write a query on how to delete it.
Hope this helps,
Thank you,
Charles Babu J -
How to Generate scripts in ITK?
How to generate scripts in ITK. We have a Option "Generate Scripts" is not enabled.We have options to
How to ask questions.
(Are you sure to ask in the InDesign forum? "Generate Scripts" is not a concept mentioned anywhere in the documentation.) -
How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?
I tried using DROP Tables, Truncate Database, Delete and many more but it is not working. I want to delete all tables using Query Analyzer, i.e. through SQL Query.
Please help me out in this concern.
Nishith ShahInformative thread indeed. Wish I saw it early enough. Managed to come up with the code below before I saw this thread.
declare @TTName Table
(TableSchemaTableName
varchar
(500),
[status] int
default 0);
with AvailableTables
(TableSchemaTableName)
as
(select
QUOTENAME(TABLE_SCHEMA)
+
+
QUOTENAME(TABLE_NAME)
from
INFORMATION_SCHEMA.TABLES)
insert into @TTName
(TableSchemaTableName)
select *
from AvailableTables
declare @TableSchemaTableName varchar
(500)
declare @sqlstatement nvarchar
(1000)
while 1=1
begin
set @sqlstatement
=
'DROP TABLE '
+ @TableSchemaTableName
exec
sp_executeSQL
@sqlstatement
print
'Dropped Table : '
+ @TableSchemaTableName
update @TTName
set [status]
= 1
where TableSchemaTableName
= @TableSchemaTableName
if
(select
count([Status])
from @TTName
where [Status]
= 0)
= 0
break
end -
Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql
Hello All,
I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
Table Name OracleRowsCount SqlRowCount Diff
Customer 150 150
0
Sales 2000 1998
2
Devisions 5 5
0
(I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
What the simplest way to do it ?
Thank you
Best Regards
DanielHi Daniel,
According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
package by querying this table.
Regards,
Mike Yin
TechNet Community Support -
Create oracle table from sql server
Dear Gurus,
I need to create some tables from sql server 2008 to a oracle 11g database. Some tables contain vbinary datatype. Now my queries are
1. How can I do that?
2. If DB link is a solution then would you please provide me a step by step process to do so?
3. Is there any issue with datatype?
SQL Server db is on windows 2008 R2
Oracle is in RHEL 5.5
Will appreciate ur help.well suppose i generate flat files from sql server and load in oracle by sqlloader then will there be any issue with vbinary datatype? what should be the equivalent data type in oracle table?
-
Can Oracle view refer a table in Sql Server Database
Can a view created in Oracle database refer a table created in SQL Server database. If yes, how do we do it. Code will be very help full.
Again, if yes does it require any special software and what would be price of that software.
Thanks for your response in advance.
Venkat SathiamurthyYou would need to configure Oracle Heterogeneous Connectivity to create a database link to the SQL Server system. This can either be done via the Oracle Transparent Gateway for Microsoft SQL Server, which retails for $15,000 per server at http://store.oracle.com or by configuring Oracle Generic Connectivity and using ODBC to go after the SQL Server data. Depending on the operating system you run Oracle on, there may be a free (or cheap) ODBC driver for SQL Server that could be used.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC
Maybe you are looking for
-
NullPointerException trying to execute CallableStatement
oracle.jbo.domain.Number jobId = null; Connection conn = getCurrentConnection(); statement = getDBTransaction().createCallableStatement("{ ? = CALL submit_refresh_actuals(1) }", 0); statement.registerOutParameter(1, OracleType
-
Does anyone know if BiBeans 9.0.3 will work with JDeveloper 10g? I tried install BI Beans but it was looking for a different version of JDeveloper.
-
Refill safety stock based on a certain leadtime
Hello, is there a way to refill / replenish your safety stock based on a certain leadtime ? as now MRP requests to get in components today or in a week , while they have a leadtime of several weeks. for example : i have put a fixed safety stock of 30
-
Incremental loading - select taking a lot of time - urgent please
Hi, I have a huge source oracle table with millions of records. I am using a last_update_date field from this table to select the new records. I have the last_update_date indexed. Also, please note number of distinct values of this field is not high.
-
my iphone 4 won't connect to my apple id account it keeps saying that my account limit has been reached