How to use linked server with stored procedure? - mysql

Anyone have an idea about how to use to view a stored procedure on a linked server? I don't have the credentials to that linked server to look at it. ??

If you don't have access to the server, then you can't view anything. If you have execute permissions on the stored procedure, then sure, you can execute it. I believe the syntax is something like
exec "linkName"."dbname"."schema"."procedure"

Related

sp_send_dbmail is missing in sqlserver2008

I am unable to find the system stored procedure sp_send_dbmail,
which should be under System Databases -> msdb.
msdb.[dbo].sp_send_dbmail .
But it's missing under the location where it should be.
What should i do?
The Configuration for mail was not enabled which was the reason i couldn't find sp_send_dbmail in system stored procedures.
Fix:
server->Database->Management->Database Mail(Rt click)->Configure Database Mail->Next->First Option and Next
It will ask you to enable the configuration for database mail and click ok.

Stored procedure with EXECUTE AS cannot run xp_cmdshell

I have a sql server user, proxyAccount, which I configured as xp_cmdshell_proxy_account
In a stored procedure I use xp_cmdshell, and when I execute the stored procedure with this account, everything works fine.
However, if I add:
WITH EXECUTE AS 'proxyAccount'
to the stored procedure, I get the following error when I execute it:
The xp_cmdshell proxy account information cannot be retrieved or is invalid. Verify that the '##xp_cmdshell_proxy_account##' credential exists and contains valid information.
What might be the problem? Why can't proxyAccount run xp_cmdshell when set to EXECUTE AS, but being able to run it otherwise?
The problem was solved by the following steps:
Creating a new account that uses Windows Authentication (not using SQL Server Authentication)
Set this new account to xp_cmdshell proxy
Grant xp_cmdshell permission to the old proxyAccount

Accessing a SQL view with a stored procedure on another server instance

I have access to a SQL view on say a server called vuk030 and i wish to write and run a stored procedure on a server called vuk386. My question is how to write the sql to access the data in the view on vuk030 as it has a username and password.
the vuk030 server is sql server 2005 and the vuk386 is 2008
The best way is to set up a linked server from vuk030 to vuk386 and enabling RPC over the linked server to make it possible to run stored procedures.
Setup linked server:
http://msdn.microsoft.com/en-us/library/aa560998(v=bts.10).aspx
RPC:
http://msdn.microsoft.com/en-us/library/ms186839(v=sql.105).aspx

Unable to migrate stored procedure for Crystal Reports from SQL Server to MySQL

I have been trying to migrate a SQL Server 2005 database to MySQL 5.5.29 and having trouble with the reports done with Crystal Reports 2010. I can use the set datasource location to migrate the tables (I do have to do each one individually and rename it before it will migrate) but I got it done.
However, I'm not able to update the stored procedure as I get the message:
Database Connector Error: 'HY00:[MySQL][ODBC 5.1
Driver][mysqld-5.5.28-lof]SELECT command denied to user ... [Database
Vendor Code: 1142]
I'm using the same ODBC Source as used for the tables so I don't know what I have to do to update/migrate the stored procedure. I tried to create a new report and add a stored procedure but get the same message.
Any ideas?
Thanks,
Vic
Based on the error message, the user the report is being executed as genuinely does not have access to the specified table.
The MySQL bug report Escaped wildcard in DB name prevents user from granting database permissions may shed some light on why permissions may not be applied as you think they are when the db name contains an underscore.
This is a restriction by the provider and they refuse to change it. Because of this I am not able to include stored procedures in a Crystal Report.

Failed to execute stored procedure from the JDBC code using mysql connection

I have one database. I executed a stored procedure on it. I wrote some JDBC code to connect to this database. When I am calling this stored procedure from my JDBC code it is throwing SQLException.
One interesting thing I found is that I have one user other than root user. This user has all the privileges to this database where the stored procedure is present.
When I use the root user I am able to call the stored procedure successfully. But with the other user I am getting SQLexception. I am not able to find why it happens like this.
For sure I want this user(other than root) has to call this stored procedure successfully.
Thanks in advance.
The user should have SELECT permissions to the mysql.proc and mysql.procs_priv.
I don't know if there exists any other solution.