Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am documenting a database, and it would be great to have the functionality to update the tables automatically based on the current state of the database.
I know phpmyadmin does this, but it is a buggy gui that doesn't provide many options- so I end up having to write a script with sed to find and replace things that I don't want and add things that I do.
You can accomplish this via SHOW TABLES and SHOW CREATE TABLE command.
It may not be an easy task to reconcile what has and has not changed. But, the basic approach here is to get a list of the tables in a database, and then run the SHOW CREATE TABLE table_name command for a full spec on the schema. Also, you could use the EXPLAIN command; however, though it's similar, it also contains higher-level information. I'd argue that SHOW CREATE is best since that's all you need to see to replicate the schema.
If I had more specifics about how you wanted to use this information, I'd ammend this with more information. Especially what programming language you're using to connect to mysql. You can actually even use the command line to get this info, but you'll want some intelligent processing in order to do a reconciliation against existing fields in your replicated data containers.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have a lot of different databases and tables that contain user information. I would like to write a query, that would find all the necessary information. So when I use "where" clause (e.g. where Email = 'Example#example.com', or where Name = 'Mister Holmes' etc), it should bring up the results I'm looking for and search from all the related databases and tables.
My idea is to make a new view, bring all the related tables in there, and then join the necessary columns somehow. Is that possible?
Can anyone please help?
I had the same problem. I just describe my way - Because I have many different databases with different storaged infos about users, I collect all of them with INSERT and every time I am looking for WHERE SOMETHING, I am running this:
truncate target table (which is already prepared with necessary colls like NAME, LOGIN, RIGHTS, APPS, NOTES, ...)
filling target table with data from VIEWs, which are specific for each db / apps / or user groups
This two points I stored in procedure. Maybe it is not quickest way, but searching and filtering above one static table is much more safe and less consuming then searching in twenty views.
But, be aware, I you are not alone DBA and you have collegues which are playing the role of administrating sql in your area, I think, this solution is not lucky.
Or do you have standard user informations in server_principals, server_role_members, database_principals, database_permissions, schemas, ... ?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to generate a file that contains a stored procedure query and I want to share it, but I need to protect it from reading. This query will be used by another person in his own database and server.
I want to give a SP to another person to use in a different environment but doesn't want them to be able to read the TSQL in the SP.
How can I do that?
You can use the WITH ENCRYPTION clause. However, it is known to be ineffective and easily broken, and there are third party tools available that will let your client break it.
If you want to do it anyway, a tutorial can be found here.
If you use WITH ENCRYPTION along with a thoughtfully constructed EULA, your client should not accidentally see the code, and if he purposefully goes to the trouble to crack your code encryption, you will have civil recourse (i.e. you can sue them).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a series of fairly simple SQL update commands that are used to update order owners in one of our databases. i.e.
UPDATE POHEAD
SET BYRUSR_ID = upper('J123456')
WHERE BYRUSR_ID = upper('J654321')
AND po_st IN (1, 4, 5, 6, 10,11);
COMMIT;
I want to enable our business users to make the changes, and thought that the best solution would be to create an application file that takes the parameters (olduser, newuser) and when the user clicks OK, the file opens a connection to the database (oracle) to make the updates.
While investigating I found a number of guides for creating exe files with .net but none that used SQL or asked for parameters. I haven't used .net before, so don't know where to start.
Using a PHP webform was considered but is not feasible.
Appreciate any help you can provide.
It's a rather vague question so I hope that this is what you need:
Usually, the best way to build a standalone-application which connects to SQL is via PHP. If you know a tiny bit of HTML, you can even create an HTML page in which your users can enter data and click on a button and the PHP script in the back-end will connect to the SQL-database and return the results on the next page.
Here a link for the beginning:
http://www.w3schools.com/php/php_mysql_connect.asp
There are also alternatives to connecting PHP with SQL (SparkSQL, Hadoop, ...) but I think that this is the simplest way of creating such an app.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a project to create an MS Access Database driven, VB application.
I need to use SQL coding, so cant just use the standard add data source.
The database would need to be able to have information accessed from the database as well as being able to add more data through the application.
Any help would be great.
Thanks
It seems as though you need a place to start looking, instead of what your question is asking. I'll provide a list.
Connecting to an MS Access Database (OleDb) See here
Referring to your connection string from the config file rather than inside each sub/function. If you have to recompile with a different connection string you only need to change it in one location.
Using SQL in VB.NET. See here.
Using SQL in VB.NET is looked down upon because it's essentially an "error-less" string. People use Linq for a lot of their database needs. That might be a little advanced at this stage in the game.
Take the time to become familiar with these procedures, and look up the documentation regarding OleDb class, parameterizing queries, etc.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I gave a list of tables from our schema in a text file to my boss asking him that we need NOT back up all these tables. Now he is asking me to write a query to return the rest of the tables which REQUIRE BACK UP.
He gave me the hint that I will have to use USER_TABS and DIFF in my query.
Can anybody please help?
I am using ORACLE database.
What criteria defines a table that is "unused" and what criteria defines a table that "needs backup"? And what do you mean by "backup"?
If you're talking about backups, you'd normally be talking about physical backups in which case you back up the entire database (either a full backup or an incremental backup depending on how you've structured your backup strategy). You would not and could not include or exclude tables from a physical backup. You could potentially move the tables to a read-only tablespace which lets Oracle know that they don't need to be backed up again. But it doesn't sound like that's what you're after.