Has anyone had any experience using the openrowset function to access a dbase IV file? I can access the file using ADO from within VB but not getting anywhere using openrowset. If anyone knows the syntax or has an example it would be greatly appreciated.
I am trying to get a handle on the new SQL Server Integration Services in SQL Server 2005. There is a legacy DTS package that I need to get working on our new server (using SQL Server 2005) but I can't seem to get it to work.First, I migrated it and attempted to run the package. It gave me many errors. So, I thought I would just rebuild it in integrated services. Everything was going smooth until I got to the real data transformation part.I added a data flow task and it took me to the Data Flow tab. Then I added a DataReader Source. I am trying to read from a dBase III file and I assumed I would be using an ODBC driver for that. Well... it has been hell trying to get it to see the dBase III file and access it.I have tried two solutions from the internet.This one and this one (by Wenyang) with no positive results.No matter what I do I still get an error in the bottom of the Advanced Editor for DataReader Source that reads: "Error at Sales Transformation [DataReader Source [81]]: Cannot acquire a managed connection from the run-time connection manager."Has anyone attempted anything like this before? Are there any SSIS experts around here that can drop me a few pearls of wisdom?Thanks in advance... I'm dying here.
Can I use OPENROWSET in Query Analyzer to connect to a text file in a SELECT statement and/or an INSERT statement? I need to move data from a text file to a SQL Server db. But, I can't figure out the right parameters for the OPENROWSET method. Thanks for any help.
I am currently using the OPENROWSET command to read a XML file.
-- Use OPENROWSET to read an XML file from the file system
SELECT @xml = BulkColumn
FROM OPENROWSET(BULK 'c:file.xml', SINGLE_BLOB) TempXML
However, the file I wish to process is being generated externally and published through a web server. The file is constantly being updated, and I need to have the latest data frequently. Is it possible to do something along the lines of:
-- Use OPENROWSET to read an XML file from the file system SELECT @xml = BulkColumn
FROM OPENROWSET(BULK 'http://webserver/file.xml', SINGLE_BLOB) TempXML
If it is not possible, can someone recommend the best method to copy/download the file? I have considered standalone Windows Services and utilizing SQL Server. Are there significant pros or cons to either approach? Are there other methods I am not awere of? Any feedback on this would be greatly appreciated.
I am using OPENROWSET to import a file from disk to a varbinary(max) column in sql server.
However as far as i can see OPENROWSET is only to import into Sql Server. However i need to reverse this as well, by that i mean export a varbinary(max) column data to a file on disk. How can i do this ? (The file is a compress text file).
How does this work for file types, i mean you can import any file as binary but when you export it back to disk will the file typr still work, will a .xls or a.exe imprted and exported like this still function 100%.
I'm trying to query an excel file and I get a mistake. The query is as follows:
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:ExcelFile.xls', 'select * from Sheet1')
and I get the following error message:
Server: Msg 7399, Level 16, State 1, Line 1 OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. [OLE/DB provider returned message: The Microsoft Jet database engine could not find the object 'Book1'. Make sure the object exists and that you spell its name and the path name correctly.] OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].
Can someone please point me as to where I can find info for the following. I have seen this somewhere but I am unable to find it.
I am trying to do INSERT INTO Table SELECT ... FROM OPENROWSET(BULK '\sharedDriveDataFile.txt', FORMATFILE = '\sharedDriveFormatFile.txt', FIRSTROW = 2) AS Q
How can I make that shared drive dynamic? as such..hoping not to use dynaic SQL INSERT INTO Table SELECT ... FROM OPENROWSET(BULK @SharedDrive DataFile.txt', FORMATFILE = @SharedDrive FormatFile.txt', FIRSTROW = 2) AS Q
I am using SQLServer 2005 SP2. I enabled the Ad Hoc Distributed Queries and DisallowAdhocAccess registry option is explicitly set to 0. Query is working fine when I remote desk to the server and execute when I run same query from my workstation I am getting following error
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
I want to read from this file from T-SQL, I saw in a previous post that its possible to do it using OPENROWSET (http://msdn2.microsoft.com/en-us/library/ms190312.aspx)
I don€™t have a clue what parameters i must use on the OPENROWSET T-sql command (provider name to ttx ?)
I would appreciate if anyone could give an example of how to do this
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D: esting.xls;', 'SELECT * FROM [SheetName$]') select * from pubs.dbo.authors
I am using similiar query to above to create a excel file, however for this to work, I need to create a template file which has the same columns as the authors table. Is there a way to NOT to define template columns , as I some times will not know which columns will be available... as teh query is dynamic....
select * from openrowset(bulk '\server1c$file.txt', SINGLE_BLOB) as t works from sql server itself, but doesn't work from any other machine. I got "Operating system error code 5(Access is denied.)." I am running as the domain admin, the file.txt has full control for everyone. In server1 even log, I see Anonymous Logon.
Hi, recently I encountered the following problem: I tried to execute a stored procedure on the newly installed SQL 2005 Server (now on x64 Win Server 2003) which imports an Excel-File into a DB table. We use OPENROWSET to access the Excel data. But I recognized this is dependent on Jet OLE DB which seems is not available for x64 windows.
Is there another way to import excel data using a stored procedure.
I have to write a query that queries a database table and a text file wich is delimited using fixed width values. I have seen some examples using access or another databse but not much about a text file. Is this the best way? Idon't want to set up a linked server. I want everything to be within the query.
My understanding is that I should be able to do it since a text file can be a valed OLE DB datasource, but I am having trouble finding example syntax. Can all my connection info be passed with the OPENROWSET function? Can I do it by just writing a query? Or do I have to set up and configure other things?
Any guidence, tips, advice, examples, or links of syntax appreciated.
I have a directory with images and a table in my DB with the path of each file. The main application allow me to create reports where I can display an image, so I was thinking to use a query like:
SELECT [ID] ,[PT_CODE] ,[FILE_PATH], CASE WHEN [FILE_PATH] IS NOT NULL THEN (SELECT * FROM OPENROWSET(BULK [FILE_PATH], SINGLE_BLOB) TT) END AS IMAGE_LOADED FROM [DB].[dbo].[TABLE_MR_FILES]But I keep getting the error:
Incorrect syntax near 'FILE_PATH'.I have try multiple combinations without luck to make the OPENROWSET read the path stored in the column [FILE_PATH]. What am I missing?
Note: I am using MSSQL 2012. I don't want to import the images into the DB just load them in the fly as needed by the report runned from the application. I have full access to the DB so if a store procedure is the solution I can go with it.
I have a test server (TEST1) running SQL 2012 and Windows 2012R2. One of the developers wants to use OPENROWSET to read in data from an Excel 2010 file (an xlsx file).
I have loaded the Microsoft Drivers in "AccessDatabaseEngine_64.exe" and enabled the Ad Hoc Distributed Queries option in SQL.
This is the sample code we are working with:
SELECT X.MEMBID FROM OPENROWSET( 'MSDASQL', 'Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=etworkserverFolder1Folder2MEMBIDs.xlsx', 'SELECT * FROM [Sheet1$]' ) AS X
I can run the sample query from my laptop with SSMS (I have admin rights) and I can also run it as SA from my laptop. So all is good, right?
But if I RDC into TEST1, I cannot run the query. I get this error:
OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Excel Driver] Your network access was interrupted. To continue, close the database, and then open it again.". OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Excel Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x574 Thread 0xb74 DBC 0x1d07f08 Excel'.". OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Excel Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0x574 Thread 0xb74 DBC 0x1d07f08 Excel'.". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "(null)".But wait! It gets better.
I can run the query as SA from TEST1.
And of course, the developer can't run it either.
And it works fine in the production server.
I'm thinking the basics are there but something isn't right in some permission somewhere.
Maybe it worked once, but in most time it doesn't work, query like below
select top 10 * from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;hdr=yes;database=\ws8webablefilessitefiles4000010 eibcactive.xls', 'select * from [crap2$]')
I got error
OLE DB provider "microsoft.jet.oledb.4.0" for linked server "(null)" returned message "Unspecified error". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "microsoft.jet.oledb.4.0" for linked server "(null)".
but the same query can run without any problem on a SQL 2000 server run on a server in the same network.
In my project, I need to transfer the database from dBase to MS SQL 2000. I only have the .dbf files for the dBase database. Can someone give me a help? Thanks in advance.
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Data Source=D:Account;Extended Properties=DBASE III;', TRANS.DBF)
and I got the following message :
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Could not find installable ISAM.". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
HI, I have a Dbase Database stored in several subfolders. I allready made my connection with a sqldatasource and a gridview, and all works fine when i do a query with the tables in to root folder. The problem is when I try to include tables from the subfolders, the compiler send me a syntax error in the FROM Clausule I Allready try this. SELECT products.id, products.descri, condition.discount from products, clientscondition where products.line=condition.line SELECT producst.id, products.descri, clientscondition.discount from products, clientscondition where products.line=condition.line SELECT products.id, products.descri, condition.discount from products, condition in 'clients' where products.line=condition.line SELECT producst.id, products.descri, clientscondition.discount from products, 'clients'.condition where products.line=condition.line And many other different combinations. I would like to be helped if you know the correct syntax or a link where i can consult the syntax for VB.net and dbase with several folders Another option a tried is having a query from 2 different datasources, but I don´t know how to make a reference to the 2 sqldatassources in a new one to be linked to the gridview
I am searching for a better way to move data from DBase3 files into SQL Server 2k. The Dbase file has approximately 2 million records and after applying a SELECT statement to retrieve the data I need to move, there are still over 600,000 records. To move this data I have used DTS (data pump) to transform the data- THIS IS UNBEARABLY SLOW. Next, I created an exe to transform the data to a flat file and then used BULK INSERT to copy the data. The exe is slow, but the BULK INSERT is fast. I have moved the source and destination to the local Server to increase performance, but with little imporvement. My question: Is there a better way to move large amounts of data from DBase3 files to SQL Server without waiting 38 hours to move 600,000 rows? Thanks for your help.
I have a MS SQL database that I use MS ACESS to add data to and also to query.
My question is how can I setup the MS Access database so that it will not allow duplicate entries to be added to the MS SQL database? I know How I could do it using php via a webpage but I need to be able to do this using the MS Access program directly since thats what we use to add and search the dbase with.
I have some database files with .dbf from dBase and I want to transfer data from the .dbf files to Microsoft SQL database (2000). Can someone help me with that? Thanks.
Please anybody help me. Can't get oledb for odbc work.Need an explanation what to put in each field of linked server properties General tab to get connected. Have ODBC server DSN working fine with Crystal reports. Did this: exec sp_addlinkedserver @server = 'ODBC_TEST' , @srvproduct = 'dBase', @provider = 'MSDASQL', @datasrc = 'DB4_GBS' GO -- Adding linked server login:
EXEC sp_addlinkedsrvlogin 'ODBC_TEST', 'false', 'sqlLogin', 'sqlpassword', NULL Getting error : datasource name not found and no default driver specified.
I also attempt to create OLEDB ODBCless link and can't do it because after that I have to change path in TEMP and TMP variables and restart db, but I cann ot restart the server. :eek:
I would like to see a Clipper/dbase DBF file as a table in SQL Server7.0. How can I SELECT rows from DBF file? Should I use OLE DB Provideror ODBC, and how?
I'm not sure if this is the right place for this but I have an issue.
I have a SQL2005 server with SAN drives for the MDF/LDF files. I have updated recently to SP2.
When I detach a Dbase using the appropriate command it strips the Security on the file level (which SP2 is supposed to fix) and I am unable to attach the database.
I am using a domain account to do this with from the query analyser window.
I am having trouble connecting dbf of version dbase II. I can connect dbase III and dbase IV in ssis package,but can't connect dbase II.hope your help!
I created several SSIS packages on a 32-bit system, using odbc to to access the dbase source file. Finally, after setting up a proxy, etc., we got the package to run and import data. We then needed to move the packages to a 64-bit system. So, we built our manifests, and installed all of our packages. We are using several dtsConfig files for our packages, and in there we specify the DSN that we will be accessing. I understand that MS does not support odbc drivers in a 64-bit world (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=85703&SiteID=1). Has anyone been faced with this issue? How did you get past it? I accessed the 32-bit odbc drivers on the 64-bit system, and i setup a dsn that points to the dbase file, but when i run the job, the log file has an error that the dsn was not found. However, when I run the package itself, it runs as expected...
You guys are probably going to tell me to go to school (training, and I'd like to) My question is, I have a stored procedure in our MS_SQL 7 dbase that pukes out the info in a table with MSAccess. What I would like to do is, have a nice customized report be generated via http link. I designed and made such a report that queries the SQL sp_ with Crystal Report 8 I installed the browser plug in on a test workstation launched the report (via web) and I get prompted for access credentials (username & Password). Nothing works except the sa account in on the SQL server (and I am a sysadmin on that server),. I am giving that up in hopes to achieve this goal with a ASP page, but I really do not even know where to start. remember I have a storeed procedure that does the querying for me, so if there is a way to make "form that queries the sp_ maybe? ...I don't know really new at this.