Problem connecting AS400 (V7R3M0) with SQL Server 2017 via ODBC Link Server - sql-server

I have a problem connecting AS400 (V7R3M0) with SQL Server 2017 via ODBC Link Server. It is very slow.
SELECT *
FROM AS400.CATALOG.LIBDTA.TABLE1
WHERE ...
How to fix this? If you don't want to use OPENQUERY
Thanks

How to fix this? If you don't want to use OPENQUERY
You can't...MS in their infinite wisdom decided that the way a (non-MS?) linked server would work is that the entire table would be pulled back and the where performed locally.
If you use OPENQUERY, then the SQL is sent to the linked server, executed and only the results are returned.
I supposed if your WHERE clause is static, you could set up a view on the IBM i side, then just query the view. But those use cases are few and far between.

Related

Teradata SQL assistant connect to SQL Server, set preferences in using a libraries

I have one specific problem. In my Teradata SQL Assistant, I am connecting to SQL Server. But if it is possible, for me it will be best work with standard libraries in Teradata, like when I write help table, show table etc. the query is working. Right now it is necessary work with query defined in SQL Server. I think that must be possible somewhere set a preference of working queries. Or it is impossible?
Thank you a lot.
Teradata and SQL Server have different query dialects. HELP TABLE is specific to Teradata. Perhaps you should use a different tool for working with SQL Server, like Azure Data Studio or SQL Server Management Studio.

The way to connect to SQL Server using unix bash scripts

I have seen a lot of links on the internet regarding this but I am in a little fix as to how can we connect to a SQL Server database and insert some records to it using a shell script.
I want to be able to create a function which accepts the values for the row, creates an sql statement and then executes it to insert data into the SQL Server Database. I know that there is Microsoft ODBC for this but I am not sure as to how we can create the said function with it.

SQL Server Backend, Access front end connection question

I transferred my Access Back-end to SQL Server and linked the tables. I used the SQL Server Migration Wizard. When I ran my Forms, Reports and Queries, I was surprised to see that it worked perfectly fine as if I did not even migrate.
How is it the JET SQL syntax of Access able to retrieve data from SQL Server which uses T-SQL language?
Because Jet doesn't need to use Transact-SQL, it just knows how the data is stored, the same way you can use an ODBC connection to pull data from an Oracle database without using PL-SQL. Also, you can write a stored procedure in the SQL database, using T-SQL, and you can fire it off via Jet: the proc lives and runs on the SQL side, and Jet doesn't need to know how it works, just how to fire it.

SQL Server not geting rows from OraOLEDB linked server

I have two Windows 2008 Server 64x machines. One running Oracle 10.2.x.x.x (Express Edition) and other SQL Server 2008 R2 with ODAC 12c (12.1.0.2.4).
I had created linked server, tested connection and it passes. I can see all Oracle tables, but when I query them, for example:
SELECT *
FROM ORACLE..USER.PERSON
All I get back are columns without no rows. If I run query from Oracle SQL Developer I get around 13000 rows.
What could be problem? I thought it was problem with backward compatibility, but according to this link it is not. It could be something with permissions/security?
Well it was nothing to do with linked server configuration. I didn't know that after every insert I need to commit changes.
SQL> commit;

Linked servers and SQL Server 2005 on localhost

Is it possible to run SQL Server 2005 on localhost, with a schema of it's own, and then use data from another remote server?
Can this be achieved with linked servers?
Im trying to set up a proper sandbox on localhost.
Linked servers should work for what you are trying to do.
Are you looking to connect in to more than one remote server for data?
If yes, I think the linked server option is an OK way to go. I say OK because you would probably do better to create a sandbox on one of the remote servers then create linked servers from it. It seems like a waste to setup SQL Server on your desktop/laptop. However, if space/permissions is an issue, you may not have a choice.
If it is only one server, why not create the sandbox on it and connect and work in it using SQL Management Studio. Although it is a weird path to setup the management studio without installing the full SQL server, you can do it. This way you won't have to actually log into the remote server (bad idea for a number of reasons).
If you do setup the linked servers, here are a couple of snags I ran in to that may help:
If the SQL server is an instanced setup use brackets when writing it out, e.g. [SERVERNAME/INSTANCE]
Use an alias when pulling from a table or view from the linked server because you can only have 4 parts in the naming convention, so, [servername/instance].database.dbo.table.field is 5 parts and will throw an error.

Resources