How to bring my tables in sql workbench? - database

I am trying to see the tables I've made in my project with h2 in the sql workbench, but after connecting to my database I only see this snapshot:
how can I see and access the contents of my database?

Tables can be show by using show tables
You can write queries by going to view > statement.

Related

Copy a number of views from a linked Oracle database to create tables in SQL Server

I have an Oracle linked server in SQL Server and would like to copy the contents of a number of views to a database in SQL Server, these views from Oracle are to become tables in SQL Server. I have done this one at a time but am looking for a solution to be able to refresh these views, 104 of them, overnight every night.
I am fine with setting the job running manually but am looking for a solution that will either drop and recreate the tables from the views or that will just refresh the data in the SQL Server tables that exist.
Hope I have explained this well enough!
Many thanks in advance for any help on this one.
If you don't already have the table structures in the MSSQL database, I'd say go through one time for all 104 views, and say the following:
SELECT *
INTO MSSQLNewTable (this will be the name of your new table)
FROM <However you reference your Oracle view from within MS SQL Server>
After you do that, then create a SQL Script that says:
TRUNCATE TABLE MSSQLTable_Name
INSERT INTO MSSQLTable_Name
SELECT * FROM OracleTable_Name
.....for each table. Create a job in the database instance that runs on a schedule you set.
use the sys. tables to generate the statements so you don't have to type everything 104 times.

Automatically update SQL Server database from tables in MS Access

I'm new to SQL Server and trying to automatically update tables in SQL Server from tables in MS Access.
I have an Access database of metadata that must be kept updated for sending records to other groups. I also have a database in SQL Server which also has these same metadata tables. Currently these tables in the SQL Server database get updated manually by exporting the Access tables as Excel files, and then importing them into the SQL Server tables.
It's not the most efficient process and could lead to errors in the SQL Server database if someone forgets to check that they are using the most recent data from Access. So I would like to integrate some of the tables from Access to my database in SQL Server. Ideally I would like for the tables in my SQL Server database to be updated whenever Access is updated or at least update the tables automatically in the SQL Server database when I open it.
Would replicating the Access tables be the best? I am using SQL Server 2014 Developer so I think I have this capability. From my understanding, mirroring is for an entire database not just pieces of it. However, I do not want to be able to alter the metadata from SQL Server and have it reflected in Access. I cannot tell if reflecting the tables would do this...?
I also looked at this post about writing multiple insert statements but was confused (What is the best way to auto-generate INSERT statements for a SQL Server table?). Someone else suggested importing all the data into SQL Server and then using an ODBC driver to connect the two, but I'm also not sure how this would update the database in SQL Server anytime Access is updated.
If you have any suggestion and a link to easy to follow tutorial I would really appreciate it!
Thanks
In Access, go to 'External Data', ODBC Database, and connect to the SQL Server database directly - make sure you select 'Link to the data source by creating a linked table' on the first page of the wizard. Now, this linked table is available in Access, but is actually the SQL Server table.
Get rid of the local Access tables, using the new linked tables in their place in whatever queries, forms, reports, etc that you have in Access.
Now, any changes to the tables you see in this Access db ARE changes to the SQL Server database.

SSMA Oracle To SQL 2008 - Oracle db To blank SQL Database

I am new to Oracle, I am using the SSMA for Oracle tool to do the migration work.
I am having some issues migrating data from an Oracle database to a blank SQL Database. I have followed the guides I have found online but still no luck.
I cannot seem to get the data(I only need tables) from the Oracle Database into the Blank SQL Database.
I have the tables within a Schema named System. I have expanded the Schema and selected the tables checkbox on my Oracle connection, when doing the migration I always get:
Data migration was not performed because no objects were selected. When selecting migrate data and putting in my connection details etc.
I have tried to select the destination database under the Server explorer at the bottom and right clicked and selected Synchronize with database however I get:
Nothing to process by this operation, because all objects are equal.
Can someone please shed some light on what I have failed to do?
Could it be related to the System Schema?
Thanks,
Managed to work around this. you cannot migrate from the SYSTEM schema as per: https://support.microsoft.com/en-us/kb/2020714
However what I did was used Redgate Oracle Compare(free trial) to migrate objects from the SYSTEM Schema to my target Schema. I could then right click this schema in SSMA to convert Schema and proceed with the migration.

Can't find table object name

I have an application in classic ASP, and a database in SQL server 2005.
I transfer the database in SQL server express edition and I have one strange problem, I can see the tables in the database in this way:
information_Schema.dbo.test, so when I execute SQL command
select * From test
I get error that it can't find the table.
When I execute
select * From information_Schema.dbo.test
I do get results.
The problem is that my application is many many files and I can't rewrite the SQL commands.
Is there any way to find a solution in SQL without changing anything in my application?
I would guess you are not connecting to the information_Schema database but to some other db that does not contain the table. Did you put the table in the wrong place(Information_Schema doesn't sound like a typical application db location to me) or is your connection wrong?

Is there a way to script diagrams in SQL 2000 (or save them another way)?

It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load tables, stored procedures, views, etc. with SQL scripts, but we have to create the diagrams by hand.
Is there a way to script out the diagrams? Or can they be saved outside of the database some other way?
It can be done for SQL Server 2005 - see here.
And info. on SQL Server 2000 - here.
If you have Visio you can use the "Reverse Engineer" to diagram the DB.

Resources