how do i generate SQL script at runtime in VB6.0 - vb6

how do i Generate SQL Script at runtime from VB6.0 and DB as SQL Server, generate all tables,views,PK,FK.Stored Procedures,Triggers from existing database. thanks in advance.

The simplest way I found to do this sort of thing was to use the SQL Distributed Object Model that you get with SQL Server and it works great with VB6. The last time I tried it was with SQL Server 2000 but the theory should still be good.
Give this link a try as a good start and take it from there, this shows you how to get at the stored procedures http://support.microsoft.com/kb/315505
Once you have got this bit down the other bits you need should be simple enough.
I hope this helps.
Cheers

Related

Is it possible to compare databases from two different types of SQL

Is it possible to compare data from an Oracle DB and an Azure SQL DB. The data should be the same in each but I want to find out is there a way to check and confirm this?
I'm thinking maybe a Java application that could check and compare the same row of each application, or check totals/counts. Or is there a more straight forward way? Any advice appreciated.
Maybe you should give us more info about the story of the database.
Have you created an Azure SQL Database from an Oracle DB or the other way around?
My approach would be:
Use SSMA to translate the Oracle database to a SQL Server database.
Now use any compare database you find online (there are many) and compare the two.
If you tell me more about the story of the database I can understand better.

Linq DataContext.CreateDatabase on Azure

This came up once before: Use DataContext.CreateDatabase in SQL Azure
The answer accepted was "maybe it's not possible". Didn't seem like a full answer.
I have a set of classes fully defined and I am wanting to create a database on Azure for this. It's not working because the USE statement does not work: http://msdn.microsoft.com/en-us/library/azure/ee336288.aspx
So, the database gets created as blank, and internally Linq generates a USE statement to move to that database and start adding tables. This fails and it throws an exception.
So how can I create my database? Can I use Linq to add tables to an existing database? Can I enable USE on Azure somehow? Seems ridiculous this does not work.
After messing around for a while on this, I ended up creating the database against a local SQL Server instance. Then used SQL Server Management Studio -> Tasks -> Script Database, and turned on the export type to be Microsoft Azure. Then I had the script file needed to run on the Azure server. I'll leave the question open for a day or two because I am curious if this can work with Azure directly somehow. If I don't hear anything, I will close it.
The USE statement does not switch between databases in Azure SQL Database. You will have to connect to the database to create a table on that database.
Regards
Dhruv

MS Access to Oracle database

I am developing an ASP.net application with Access database. I need to convert this Access database to Oracle. How can I do that?
I saw two options
Migrating the access database to Oracle through MIGRATION WIZARD in SQL developer
In Oracle, just creating a new connection with existing MS Access database and then converting to oracle.
Kindly let me know the best solution for this
thanks in advance,
Arjun
The two choices you proffer could be rewritten like this:
Use an automated tool written by experts
Do it the hard way and figure it out for myself
This is a personal, even philosophical, choice. Do you need to get the task done quickly? Or do you want to learn something along the way?
TRY IT and then tell us.
My experience integrating all things oracle with all things microsoft has always been complicated, and a lot of manual intervention was required.
It also depends on the complexity of your existing access database, if it's only one table, then you can grab that table sql, correct it for nvarchar -> varchar2 fields and datapump the data into oracle.
If Access has 1000+ tables I would suggest getting a professional to do it. Any reasonable dba should handle it no problem.
Please check the solution at Insert into from ms access to oracle db
You can customize the code based on your requirement. You can bundle the whole code into one class and prepare it as exe application.

Oracle alternative to jsfiddle

Is there a service for oracle like jsfiddle is for javascript?
I need to test an oracle function (not against a database) and do not have an installation of oracle available.
Other features of jsfiddle would be nice, but my primary concern is just to be able to run simple functions and receive output.
Oracle Apex gives you a demo/sandbox environment(featuring Oracle Apex & database) where you can test out whatever function that you want to test.
Plus you get to add collaborators so that works.
Try http://sqlfiddle.com/.
It is not a daemon of speed, but works quite nice.

Trace MS Access DB activity

I have an Access application with a SQL server back-end, mixed with quite a few DB objects local to the Access app. I've tried running SQL Profiler, but I got very little except a cryptic sp_execute 2,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297.
I would like a trace tool that is local to the Access DB, so I also pick up any activity that doesn't go back to the SQL server.
As far as I know there is no such facility within Access but, depending on your case, you could try these few things:
Write a wrapper against SQL executables: that would mean replacing all calls to Execute, OpenRecordset etc within your VBA to an alternative version that would log the query.
This isn't going to catch everything obviously but it could help.
Move your local tables to another database and use ODBC to relink them to your original Access application. You can then use ODBC's logging facilities.
This could be the best altenative as it's fairly easy to setup for debugging.
It's not the best solution for a production environment though as all your calls to local tables will in fact go through ODBC, but again, it's a temporary solution for debugging.
Use ShowPlan and ISAMStats to view how Jet/ACE interprets your queries and get other database activity stats.
It's easy to setup by writing a key to the registry and you'll end-up with a log describing how your queries are analysed.
It's more useful for optimisation than logging but again, it could help.
Use Flextracer, a shareware, free for 30 days or so. My colleague here has just found this for us as we were going through a similar situation. Problem solved.
http://www.geardownload.com/development/flextracer-download.html
[]s,
Pedro Carneiro Jr.
pedrokarneiro#hotmail.com

Resources