I am using matlab database toolbox to extract data from Server. I am not familiar with SQL database apart from how to establish a connection from matlab using sql query. How can I check matlab is using which drivers to access the database as I mistakenly changed the drivers via 'Define ODBC data source' in query builder to MYSQL ODBC 5.1 Driver, due to that
con_semilib = database('checkdatabase','root','*******')
e=exec(con_semilib,['SELECT *FROM movies WHERE movie_id=1 ']);
e=fetch(e);
e.Data %e.Data is giving me ans=0
Any suggestions, I am not so familiar with database toolbox. Thanks
Adding to it, it was working fine before I messed with this define ODBC datasource
Related
I am having problems extracting data from Sybase using Advantage 11 OLE DB Provider in SSIS (2017).
I can connect to the database, see the list of tables, and, when selecting a table as a data source I can see the columns.
However, when I click Preview (or run the data flow task), I get this error:
The provider cannot derive parameter information from the command.
Use SetParameterInfo. (Advantage OLE DB Provider)
I am using no parameters, my Data Access mode is set to Table or View (see attached screenshot)
In project properties, Run64bitRuntime is set to False.
What am I missing? Thanks!!
While searching on this issue, i found an old official reference that is related to advantage ole db provider release 1.0 (since 2000), they mentioned that:
Title:
"The Provider Cannot Derive Parameter Information From the Command. Use SetParameterInfo". Occurs When Using a Client Side Cursor with OLE DB
Problem Description:
"The provider cannot derive parameter information from the command. Use SetParameterInfo" occurs when setting the CursorLocation to use a client-side with the Advantage OLE DB Provider.
Solution:
This is a known issue in the 1.0 release of the Advantage OLE DB Provider, and is being looked into by the Advantage R&D team. The 1.1 release of the Advantage OLE DB Provider should have this problem fixed. Meanwhile, set the CursorLocation to use a server-side cursor as a work around. Server-side cursors work with the Advantage Database Server and the Advantage Local Server.
I searched on how to set CursorLocation to server side, maybe you have to set Advantage Server Type property in the connection string. Really i didn't worked with this type of connections but you can refer to the following articles to see some examples:
Advantage OLE DB Provider connection strings
Sybase Advantage connection strings
Also i found some official Microsoft articles concerning the CursorLocation property, but really i don't know where to change this property:
The Significance of Cursor Location
The Microsoft Cursor Service for OLE DB
Recordset Object (ADO)
CursorLocation Property (ADO)
Update 1 - OLE DB Services
Try working around with the OLEDB Services values in the OLEDB connection manager:
Also try to change the OLEDB Services value manually in the connectionstring referring to the following article:
Connection pooling in OLE DB .NET Data Provider applications
Update 2 - Other Providers
Try using other providers to connect to Sybase such as Sybase Adaptive Server Enterprise Data Provider or ODBC, there are many links that describe the whole process:
Import and Export from SQL Server to Sybase DB using SSIS
SSIS with Sybase Connectors
connecting to Sybase from Sqlserver SSIS
Extracting data from Sybase SQL Anywhere using SSIS through ODBC
Powerful SAP Sybase ADO.NET driver
So I finally solved this, but not with OLE DB. Instead, I used Advantage .NET Data Provider Release 11.1. Then in Visual Studio, I used ADO.NET connection manager, where I changed provider to Advantage Data Provider and that did the trick.
I want to use exist db on mysql from mvc asp.net.
I installed mysql plugin for vs and mysql connector net.
Add connection string to config.
When I start vs in server explorer I see working connection, but when in project I try to add new ado.net entity data model -> generate from database wizard don't know about mysql in general, there are defaultconnection to MS sql and only two varients for new connection:
Microsoft SQL Server
Microsoft SQL Server Database file
Other
Maybe I forgot something install?
Thanks for help.
I have installed the latest .net connector, I can add MySQL databases as Data Sources, I can even browse through the data from Business Intelligence Studio.
The problem is that I cannot create a datasource view, or if I do create one without tables, trying to add them after the fact gives me the same error.
Specifically it looks like the data source view wizard tries to submit queries against the MySQL database using square brackets/braces, and the query bombs.
I get an error message like:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[my_db].[cheatType]' at line 2
How can this be done?
Get the MySQL ( 6.3.5 ) .net connector ( from MY SQL )
Edit the connection string ( in the designer paste in the connection string ) so that it has the new "SQL SERVER MODE=True" option.
Apparently it affects performance - but what can you do
My sample connection string...(passwords & userids omitted )
server=svr215;User Id=;password=;Persist Security Info=True;database=dw;sql server mode=true
For any of you facing this issue more recently, there are two approaches that you may want to consider as well
Use the DevArt dotConnect connector at http://www.devart.com/dotconnect/mysql/. Using the .NET data source, you can connect your SSAS cube directly to MySQL.
Some have worked with doing OpenQuery connections to MySQL by connecting to SQL Server for the DSV and then using a linked server connection to MySQL. Some of those details are noted within http://dennyglee.com/2012/09/26/sql-server-analysis-services-to-hive/.
Try using Caps when adding it to the connection string:"....;Sql Server Mode=True"
Tried using named queries instead of tables?
Create a new named query in the DSV, as SELECT * FROM MySQLTable, then build in the DSV on top of that.
I would recommend using SQL Server. You will save yourself a lot of time and headache trying to do it this way. If your tables don't need transforming, just use SSIS to move the data from MySQL to SQL Server.
This is what we did at my previous employer - OLTP was MySQL and we built the warehouse in SQL Server, then used SSAS off of that warehouse for the cube.
I have tried with Visual Studio 2015 and SQL Server Data Tools 2015 on Windows 7 Machine, experiencing problems with the following versions:
net connector 7.0.4
net connector 7.0.3
net connector 7.0.2
net connector 6.9.8
net connector 6.9.7
net connector 6.9.6
net connector 6.9.5
net connector 6.9.4
net connector 6.9.3
net connector 6.9.2
net connector 6.9.1
net connector 6.9.0
net connector 6.3.5
from here: https://downloads.mysql.com/archives/c-net/
As a result:
The SSIS is working but SQL builder always failing.
The SSAS is not woriking as it cannot retrieve the database schema.
Finally, after hours i got it working with the following installation of new product of MYSQL Community from here: http://dev.mysql.com/downloads/file/?id=466291
Now, the only problem i expirienced was that the connector was unable to translate some queries due schema mapping, so setting sqlservermode=true to the connection string will fix that problem too!
I am working with SSIS and trying to import data from MySql to SQL Server. I am having issues trying to convert mySql datetimes to SQL Server Datetimes. Any suggestions?
Can you provide an example of the error or problem? I found some values in MySQL were out of range to SQL Server. In these instances, I used a NULLIF on the MySQL side to remove the bad values first. Rafal Ziolkowski's solution of converting to strings could work as well, but I personally would prefer to push the conversion off to the MySQL query if it is only impacting data columns.
Try convert date to string and then to datetime again.
What is the issue? Which SSIS data type are you using? DT-DBTIMESTAMP should work for both.
this took me few days to figure out...so I thought I would share my notes
How to connect and load data from MySQL to SQL Server
Download the 32 bit ODBC driver.
go to the MySQL website and download: “mysql-connector-odbc-5.2.4-ansi-win32.msi”
NOTE: Do not use the 64 bit driver on BIDS 2008. BIDS 2008 is 32 bit. You will get a mismatch error when creating SSIS’s connection manager: “The specified DSN contains an architecture mismatch between the Driver and Application”
Create a User DSN
You need to open the using windows 32 ODBC admin tool. DO NOT open the regular ODBC admin, in control panel. Open the ODBC admin located here: c:\Windows\SysWOW64\odbcad32.exe. If you use the default ODBC admin…it will not work. Additionally you must create a “User DSN” - NOT a System DSN. Otherwise it will not show up in SSIS
NOTE: the screens look the same so you will have no way of knowing whether you are in 32 BIT ODBC Admin tool or not.
Create a new SSIS package and create an ADO.NET connection manager:
Change the Source ADO.NET properties.
You will get validation errors and your package will not run. You need to change the “ValidateExternalMetadata” to FALSE (in the “Advanced Editor” dialog box) of the ADO.NET source It will also give you metadata error…that’s ok…just click ok. It will still pull the metadata (column names/data types). You cannot select the tables as you would in SQL server. You need to type the SQL select statement.
Run the package and should run and load normally.
Is there any way to connect SQL Server 2008 Reporting Services to a Sybase SQL Anywhere database (ASA or ASE)? Maybe using ODBC...
If so, have you done it? Kindly share experiences and any notable considerations.
Our environment is x64 SQL RS but needs to connect x86 SQL Anywhere 9.0. 64bit SQL doesn't recognize 32bit ODBC SQL Anywhere. We resolved the issue by installing a x86 SQL Server 2008 R2 express, setup a System ODBC for SQL anywhere and linked server to SQL Anywhere on SQL instance.
Check "Allow inprocess" in the the linked servers->Provider->ASAProv.90. Restart SQL Service
Linked server -> Server Options: Set RPC and RPC Out both to True.
I have had success setting up the Data Source Type (DPE) as OLEDB and using the ASA 9.0 OLEDB provider. The connection string editor in VS2008 does not allow me to create a connection string that works, so I just type in the entire connection string as follows:
Provider=ASAProv;Eng=[ASAInstanceName];Dbn=[ASADatabase];Uid=[ASAUser];Pwd=[ASAPwd];Links=tcpip(host=[servername])
Replace the the portions with square brackets with the values that are appropriate for your installation. The square brackets should NOT be in your final connection string and quotes are not need either. The links statement at the end is probabaly not necessary if the database is on your local machine. Even though I included the database username and password, it didn't seem to be used. I also had to set them in the DataSource Credentials. When deployed to SSRS, I also set them in the DataSource to be saved on the server.
I've noticed that performance is VERY slow when previewing the report in local mode in VS 2008. Instead, I have started deploying my report everytime I want to "preview" it so I can look at it on the SSRS server through a browser. Performance is much better that way.
I am looking for a BETTER solution than what I've described as I've quickly found that multiple-value parameters are not supported with this type of connection to ASA. If you find a better solution, perhaps using the ASA ADO.NET Provider, please post. From what I've found though, there is no DPE that exists for ASA.