Msql: on MYSQL Query Browser and MYSQL WorkBench - mysql

I am currently learning mysql workbench, but I have gotten a book that uses mysql query browser. However, when I am trying to download query browser, it is stated that it is discontinued. So I am currently using workbench. However, I find it difficult to create procedure. What is workbench equivalence of procedure? Thanks!

If you are referring to a stored procedure, then those are listed in the schema navigator on the left panel. Expand the desired schema to see sections for Tables, Views, Stored Procedures, and Functions. Right-clicking on Stored Procedures displays an option to "Create Stored Procedure".

Is this what are you looking for?
If so, write-click on Stored Procedures and select Create.
Otherwise please clarify your problem.

Related

How to update stored procedures in multiple databases in mysql

I am very new to mysql and I have I a situation where I need to update all my stored procedure in all my database. for example I have 10 database just say:
client_1,client_2,client_3,.....client_10.
Every database have same stored procedure just say:
proc_1,proc_2,proc_3,proc_4.
So if I made any changes to one of my stored procedure then it should get updated in all other database So that I don't have to do it manually.
I know the similar question have been asked but I am looking for some different approach. So what I want is some kind of mysql query or something like that in which we will pass the name of the database like:
client_1, client_3, client_8
and changes will only made to this databases.
I am using heidiSql- 10.2 with MySQL 5.6.
Thanks.
I am not entirely sure what you are wanting to do but I think you want something like this. First save the definition of your stored procedure to a file. Make sure it doesn't contain an schema references like client1.tableA. You want it to be able to run in any copy of your schema correctly. Be sure to follow the syntax rules defined by MySQL
Defining Stored Programs
Then once the stored procedure is saved you can use the mysql command line to run it for each client you want to update.
You would first connect to the database server using the mysql command line. Then issue a USE command to activate the first client database. Then run the script using the SOURCE command. See MySQL Batch Commands Then repeat for each client.
USE client1;
source c:\temp\storedProcedure.sql
USE client2;
source c:\temp\storedProcedure.sql
If this is not exactly what you needed hopefully it gives you some ideas to get you what you need.
Note that you could do the connection to the database and execute these commands via batch file instead of manually if you wanted to.
There are no statements in MySQL that create/drop/alter multiple procedures at once. You can only change one procedure at a time.
You can write an SQL script that includes a series of statements. But it's up to you to write that script.
You may write some script in Python (or other favorite language) that outputs the SQL script.
I don't know HeidiSQL, but I doubt it has any facility to apply the same change to many procedures. Nor does any other MySQL client that I'm aware of.

how to check whether we are using a view in procedure on not

i have 150 procedure in my mysql database and also some views. i want to check whether any specific view (ex. suppose view1) are we using in those procedures or not?
is there any command or query by which we can achieve this in mysql

insert into remote server table without ssis and dts

My requirement is to create a stored procedure that joins two tables and inserts it into a remote server table.
How can I solve this without using ssis and any import/export data?
please
use the search before asking your question
Be more specific, stackoverflow is not here to write your whole program, people assist you
Use punctations marks and have a look at your format
Your question
Have a look at this, it shows you how to do that. You can first add a linked server(thats the destionation in your case) and then use it for your insert statement.

How do I save a stored procedure in SQL Server 2008 R2?

I am writing a SQL Server stored procedure for the first time and am unclear on how I can "save" my stored procedure so that it appears under Programmability, Stored Procedures in the Object tree.
The CREATE PROCEDURE procedureName statement creates the procedure.
You just need to execute it once and it will save the procedure to your database.
Make sure to select the correct database you want to save the procedure to, either by selecting it in the top left hand corner of SQL Server Management Studio, or by putting the following at the top of your code:
USE databaseName
Also note, if there are any syntax errors, it won't "save" the procedure.
While you are learning SQL Server and Management Studio, you may find it very helpful to become familiar with the built-in templates for creating everything from databases to tables to stored procedures and more. You locate the templates in Template Explorer under the View menu.
The first example in this walk-through with screenshots shows how to use the template for creating a stored procedure. That template includes a placeholder for the schema name (often just dbo).
You will also want to include a USE statement to make sure that the stored procedure is created in the correct database.
In addition to helping you to learn proper coding practice, using these templates can be a real time-saver and help you to avoid typos and syntax errors even after you becomem proficient in SQL.
And when you get really good at it, you can create your own templates.
Edit: Here is a very basic CREATE PROCEDURE statement:
USE MyDatabase
GO
CREATE PROCEDURE dbo.MyProcedure
AS
SELECT FirstName, LastName, Address, City
FROM Customers
ORDER BY LastName
GO
After you run that, you can run this line to check that the procedure has been created and that it is working correctly:
EXEC dbo.MyProcedure
you just use a create statement:
http://msdn.microsoft.com/en-us/library/aa258259(v=sql.80).aspx

I cant see SQL Queries in MySQL Stored Procedure!

I have created numbers of stored procedures in MySQL through remote access. And those procedures worked well.
After a few days when I connected to Database through remote access. All stored procedures were alive but while was trying to call those procedures, I realized that SQL queries inside procedures had gone. Anyone knows the reason?
If SHOW CREATE PROCEDURE (see docs) isn't showing you the procedures (with SQL queries inside) you probably have some permission problems -- you need to be the owner of the procedure or have SELECT access to the mysql.proc table.