I want to create a SAS library with ODBC engine that is on the level of a SQL database and not schema.
So,I have to have multiple sql server schemas in a sas library. An additional problem to it is, that the schemas have common table names (also table with identical names) but different contents and I would like to have all tables (also union) in the SAS library.
I am currently using the following approach:
libname schemaA odbc
schema="schemaA"
noprompt="....";
libname schemaB odbc
schema="schemaB"
noprompt="....";
libname sql_database (schemaA schemaB);
But it has still the problem with the common table names.
Is there a way to solve the problem?
PROC DATASETS with CHANGE is not an option, as I may not change table names on the SQL server. I am aware of the solution making the copies of the SQL Tables (e.g. using proc import instead of libname & odbc engine) in SAS, but would like to know if there is a way to have "live" data in a sas library from miltiple SQL schemas (with common table names).
libname schemaA odbc
schema="schemaA"
noprompt="....";
libname schemaB odbc
schema="schemaB"
noprompt="....";
libname sql_database (schemaA schemaB);
Related
I want to move the data from a DB to another DB where the two DB's are in two different Sybase servers.
I have tried
"INSERT INTO <target_table_name>
LOCATION target_server.target_database
SELECT FROM (source table or query);"
I have executed the above statements from the source Sybase server in RapidSQL tool but it is throwing an error "Incorrect Syntax near LOCATION".
Thanks
You could use "Component Integration Services". A table on another Sybase server is made to appear locally, as if it were a local table.
You (or the DBA) has to set up Component Integration Services and then set up the table (as a proxy table.)
If you just need the table to be copied over occasionally Meet is right - bulk copy with bcp is the thing. Look that up in the Sybase Utilities guide.
I'm running into a problem when accessing a SQL Server table from an Oracle setup via ODBC.
I can access 90% of the tables absolutely fine, but there's a few tables that have a name that's longer than 30 characters. Whenever I try to interact with the table (describes, selects, etc) Oracle throws an "identifier too long" error and gives up.
Is there a way to coax Oracle into playing nice with the SQL Server tables?
Assuming that we are talking about an Oracle database that has a database link created to a SQL Server database via Heterogeneous Services, you would need to write code using the DBMS_HS_PASSTHROUGH package to interact with the tables in question. You'd also need to use this package if you have tables where there are column names that are not valid Oracle identifiers.
While moving an app from access to sql server I have come across a keyword that is causing errors. The keyword within the query is "IN". INSERT INTO Table IN 'file path of sql server database'. Does sql server allow you to insert data using the file path within the query? I have been researching this for a few days and have come up with nothing.
Thanks
The IN keyword in Microsoft Access in this syntax allows you to specify another database file where the table is. This is equivalent to being in another database in Sql Server.
It looks like you are taking multiple Access database files and importing them into multiple Sql Server databases. Let's say you have an Access database called One.MDB and it gets some data from a table in Access database Two.MDB, and you have imported into Sql Server into databases One and Two. So you need to get the data from the other database. Sql Server uses a syntax of Database.Schema.Table (the schema by default is the database owner schema, or dbo).
So this in Microsoft Access:
INSERT INTO MyTable IN 'Two.MDB' ...
translates to this in Sql Server:
INSERT INTO Two.dbo.MyTable ...
That's assuming you are still using separate databases. If you've put it all in the same database, you just need to reference the table directly:
INSERT INTO MyTable ...
I have two databases, one MSSQL and the other in Access.
Right now, inside the access file, the mssql tables are set up as linked tables so queries can be written using tables from both databases. (e.g. "select * db1.table1 where db1.table1.somevalue not in db2.table1", or select into tables like that one)
These queries need to be moved into a VB.NET project, but still be linked to the access file.
I think what I am needing is a Database object that can have tables from 2 different connections, (ie the SqlClient and OleDb connections)
Is this possible? If so, how? Or do I need to rewrite the queries using loops or something?
What I would do is query your access database to get some result set and that pass that result set as a parameter to a stored procedure in your MS SQL database. You would just have to transform your results from access into XML to be passed as a xml variable as a parameter. And then in your stored procedure you can convert the XML to be a table variable and you can use it just like a regular table.
THere is no reason you can't create an MS Access .mdb with Links to your MS Access Database and your SQL Server database
Access Db #1 Contains Access Tables and Data.
SQL Db Contains your MS SQL Tables.
Access Db #2 contains links to the tables in Access DB #1 as well as links to the tables in your SQL Server Db. This .mdb files ALSO contains your query defs required by your vb.net project.
I'm pretty sure you can just connect to the Access database. All the internal objects--including the links to SQL Server tables--should be accessible to your vb.net project.
I have a database schema in SQL 2005 that I want to copy to a SQL 2000 server. It contains tables that have multiple owners. When I try to create a DTS package to transfer the schema I get conflicts because some of the tables have the same name (but different owners). It looks like it is trying to make all the tables to be owned by dbo.
Is there a way to preserve the ownership on the destination server?
It seems like there is no way to do this via DTS so I ended up scripting the database and recreating it from that script.