Questions tagged [openrowset]

OPENROWSET is a T-SQL function that can be used in Microsoft SQL Server to read remote data from an OLE DB data source. It also supports bulk operations that can read data from a file and return it as a rowset.

OPENROWSET is a T-SQL (Transact-SQL) function that can be used to read remote data from many sources, for example an OLE DB data source or a file from the file system.

This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc method of connecting and accessing remote data by using OLE DB. For more frequent references to OLE DB data sources, use linked servers instead.

OPENROWSET also supports bulk operations through a built-in BULK provider that enables data from a file to be read and returned as a rowset.

The OPENROWSET function can be referenced in the FROM clause of a query as if it were a table name. The OPENROWSET function can also be referenced as the target table of an INSERT, UPDATE, or DELETE statement, subject to the capabilities of the OLE DB provider. Although the query might return multiple result sets, OPENROWSET returns only the first one.

354 questions
0
votes
3 answers

Error while inserting picture into sql table

I am trying to insert a 'png ' image into an sql table field(called barchart,which is of type blob) with the below query. INSERT INTO disease_symptom_soc(barchart) Values ((SELECT BULKColumn FROM OPENROWSET(BULK N'/home/barchartC2936861.png',…
0
votes
2 answers

How to Import data from Excel 2010 to SQL table

I am using this , Insert into smst (id,mobile,day,month,year,time,model,imie1,imie2,FullMessage) select * FROM OPENROWSET ('Microsoft.Ace.OLEDB.14.0','Excel 14.0;Database=L:\SMS.xlsx;HDR=YES' , 'SELECT…
Kunwar
  • 1
  • 1
0
votes
2 answers

The OLE DB provider "MSDASQL" has not been registered

I'd like to extract data from a .csv file. I cannot use OpenRowSet on a 64-bit machine because it says: Msg 7403, Level 16, State 1, Line 1 The OLE DB provider "MSDASQL" has not been registered. and there is no MSDASQL entry in the Linked Servers…
JonathanWolfson
  • 861
  • 4
  • 20
  • 30
0
votes
1 answer

Importing .XLSX excel file using OPENROWSET into SQL 2000 table

Hi I can successfully import an .XLS excel file data into a table of SQL server 2000, like this:- SELECT * INTO tblCustReports FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Customer Reports.xls', 'SELECT *…
Kings
  • 1,551
  • 12
  • 32
  • 52
0
votes
0 answers

Microsoft.ACE.OLEDB.12.0 installed but not appearing as a Provider for SQL 2008R2

I've installed Microsoft.ACE.OLEDB.12.0 on a Windows7 machine but it doesn't appear under Providers in the relevant bit of the Registry (HKLM/Software/Microsoft/Microsoft SQL Server/MSSQL10_50.MSSQLSERVER/Providers) and, presumably because of this,…
0
votes
2 answers

Using OpenRowSet to connect to an Access 2000 Database from SQL Server Management Studio

I am trying to connect to an Access 2000 database from SQL Server Management Studio. My current query is: sp_configure 'show advanced options', 1; RECONFIGURE; GO sp_configure 'Ad Hoc Distributed Queries', 1; RECONFIGURE; GO Select FName From…
charles082986
  • 141
  • 1
  • 3
  • 12
0
votes
1 answer

import of excel in SQL imports 'NULL' lines

I have a stored procedure that imports differently formatted workbooks into a database table, does work on them then drops the table. Here is the populating query. SELECT IDENTITY(INT,1,1) AS ID INTO #test101 FROM OPENROWSET …
Johnno Nolan
  • 29,228
  • 19
  • 111
  • 160
0
votes
0 answers

Insert bulk data using Openrowset

I need to insert datas from a table of database A into another table belonging to the database B. using Openrowset concept INSERT INTO TableName SELECT * FROM OPENROWSET(BULK 'SQLNCLI', 'Server=(local);Trusted_Connection=yes;', …
Bharath
  • 573
  • 1
  • 7
  • 20
0
votes
2 answers

SQL Server Openrowset only imports 2000 rows from large excel (.xls) file

I have a large excel files (about 10MB) containing 60000 rows of datas. I would like to import all these rows into SQL Server database. Assuming the filepath is C:\file.xls, my query would be : SELECT * INTO ImportedExcel FROM…
0
votes
1 answer

Need Single Row Result using openrowset

I have an xml which is having images tag and inside this there is 12 URL tag. I have write this query to fetch the result from xml. Hotel.xml File :
0
votes
1 answer

Create Format File with Two Row Delimiters for SQL

I can't seem to find if this is possible, I have a completely flat file that I need to organize to import into SQL server using OPENROWSET. A sample of the file looks like this: GRP 3 DTL abc DTL def DTL ghi GRP 2 DTL wxy DTL z I wish to import…
TSQL_Noob
  • 187
  • 1
  • 1
  • 12
0
votes
2 answers

Insert text files to database using OPENROWSET

I have bunch of text files that have phone numbers separated by carriage return. I know these are all numbers. I want to insert all of these numbers into a table in my SQL database. but the problem is the text file starts with the first number; not…
Pouyan
  • 2,849
  • 8
  • 33
  • 39
0
votes
0 answers

using Sql Server OPENROWSET with Stored Procedure

Possible Duplicate: pass dynamic file path of excel to “OPENROWSET” my mind is currently out of order as I really cannot underestand what's wrong with my stored procedure definition. why OPENROWSET does not accept dynamic parameters. this code…
Pouyan
  • 2,849
  • 8
  • 33
  • 39
0
votes
0 answers

Save query results inside Excel file

I'm a little desperate because I can't use T-SQL Function OPENROWSET because I don't have privileges to test my services, anyway. are there any way to save my query results from SQL SERVER (without using OPENROWSET) to EXCEL?
Diego Pacheco
  • 193
  • 2
  • 2
  • 10
0
votes
2 answers

is it posible, create a temp #table inside a openrowset?

i am trying execute this query but i got a error: Msg 8180, Level 16, State 1, Line 1 Statement(s) could not be prepared. Msg 208, Level 16, State 1, Line 11 Invalid object name '#test1'. my code: select * from openrowset ('SQLOLEDB','DRIVER={SQL…
angel
  • 4,474
  • 12
  • 57
  • 89
1 2 3
23
24