How can I import my word documents into SQL server 2000?> How can I import my word documents into SQL server 2000?
i assume what you want is to insert them into a table?
You're going to want to create a table with a column of type "image", which
is a BLOB field (Binary Large OBject).
Then you'll want to read the documentation on your database access
technology (ADO, OLEdb, ODBC, Hibernate, etc) on how to insert blobs into a
table.|||Futher to Ian's post, some ADO.NET examples (in c#):
stream=>database
http://groups.google.co.uk/group/mi...>
7e3782e59a93
database=>stream
http://groups.google.co.uk/group/mi...>
73f1db2951f1
Marc|||Thank you very much Ian & Marc, it was helpful and I really appriciate it
"Raghad" wrote:
> How can I import my word documents into SQL server 2000?|||This works in MSSQL 2005 (untested in 2000). It assumes that the file is
accessible by the server (on one of its local disks, or a network shared
drive). This example updates an existing record, but you could do something
similar with an insert. I do it this way because I don't have the photo yet
when I first create the record.
CREATE TABLE [dbo].[COURSES](
[COURSEID] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL,
[COURSENAME] [nvarchar](40) NOT NULL,
[MAP] [varbinary](max) NULL
)
GO
create procedure spInsertPhoto
@.inCourseID int,
@.inPhotoFileName nvarchar(100)
AS
declare @.SQL nvarchar(1000)
set @.SQL =
'UPDATE COURSES
SET MAP = (
SELECT Photo.*
FROM OPENROWSET
(BULK '+ QUOTENAME(@.inPhotoFileName, '''') + ' , SINGLE_BLOB) Photo)
WHERE courseid = ' + cast(@.inCourseID as varchar)
exec (@.SQL)
GO
insert into COURSES
values('Test Course', NULL)
GO
exec spInsertPhoto 1, 'c:\temp\test2.jpg'
--
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.com
"Raghad" <Raghad@.discussions.microsoft.com> wrote in message
news:52A8884D-4DAD-4713-AC71-67ACAC99A993@.microsoft.com...
> How can I import my word documents into SQL server 2000?|||AQ> This works in MSSQL 2005 (untested in 2000). It assumes that the
AQ> file is accessible by the server (on one of its local disks, or a
AQ> network shared drive).
The bulk provider isn't support for OpenRowSet in 2000. :)
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/
Showing posts with label document. Show all posts
Showing posts with label document. Show all posts
Monday, March 19, 2012
How to import word document to sql server?
How can I import my word documents into SQL server 2000?
> How can I import my word documents into SQL server 2000?
i assume what you want is to insert them into a table?
You're going to want to create a table with a column of type "image", which
is a BLOB field (Binary Large OBject).
Then you'll want to read the documentation on your database access
technology (ADO, OLEdb, ODBC, Hibernate, etc) on how to insert blobs into a
table.
|||Futher to Ian's post, some ADO.NET examples (in c#):
stream=>database
http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/msg/314e7e3782e59a93
database=>stream
http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/msg/fcd173f1db2951f1
Marc
|||This works in MSSQL 2005 (untested in 2000). It assumes that the file is
accessible by the server (on one of its local disks, or a network shared
drive). This example updates an existing record, but you could do something
similar with an insert. I do it this way because I don't have the photo yet
when I first create the record.
CREATE TABLE [dbo].[COURSES](
[COURSEID] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL,
[COURSENAME] [nvarchar](40) NOT NULL,
[MAP] [varbinary](max) NULL
)
GO
create procedure spInsertPhoto
@.inCourseID int,
@.inPhotoFileName nvarchar(100)
AS
declare @.SQL nvarchar(1000)
set @.SQL =
'UPDATE COURSES
SET MAP = (
SELECT Photo.*
FROM OPENROWSET
(BULK '+ QUOTENAME(@.inPhotoFileName, '''') + ' , SINGLE_BLOB) Photo)
WHERE courseid = ' + cast(@.inCourseID as varchar)
exec (@.SQL)
GO
insert into COURSES
values('Test Course', NULL)
GO
exec spInsertPhoto 1, 'c:\temp\test2.jpg'
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.com
"Raghad" <Raghad@.discussions.microsoft.com> wrote in message
news:52A8884D-4DAD-4713-AC71-67ACAC99A993@.microsoft.com...
> How can I import my word documents into SQL server 2000?
|||AQ> This works in MSSQL 2005 (untested in 2000). It assumes that the
AQ> file is accessible by the server (on one of its local disks, or a
AQ> network shared drive).
The bulk provider isn't support for OpenRowSet in 2000.
Thanks,
Kent Tegels
http://staff.develop.com/ktegels/
> How can I import my word documents into SQL server 2000?
i assume what you want is to insert them into a table?
You're going to want to create a table with a column of type "image", which
is a BLOB field (Binary Large OBject).
Then you'll want to read the documentation on your database access
technology (ADO, OLEdb, ODBC, Hibernate, etc) on how to insert blobs into a
table.
|||Futher to Ian's post, some ADO.NET examples (in c#):
stream=>database
http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/msg/314e7e3782e59a93
database=>stream
http://groups.google.co.uk/group/microsoft.public.dotnet.languages.csharp/msg/fcd173f1db2951f1
Marc
|||This works in MSSQL 2005 (untested in 2000). It assumes that the file is
accessible by the server (on one of its local disks, or a network shared
drive). This example updates an existing record, but you could do something
similar with an insert. I do it this way because I don't have the photo yet
when I first create the record.
CREATE TABLE [dbo].[COURSES](
[COURSEID] [int] PRIMARY KEY IDENTITY(1,1) NOT NULL,
[COURSENAME] [nvarchar](40) NOT NULL,
[MAP] [varbinary](max) NULL
)
GO
create procedure spInsertPhoto
@.inCourseID int,
@.inPhotoFileName nvarchar(100)
AS
declare @.SQL nvarchar(1000)
set @.SQL =
'UPDATE COURSES
SET MAP = (
SELECT Photo.*
FROM OPENROWSET
(BULK '+ QUOTENAME(@.inPhotoFileName, '''') + ' , SINGLE_BLOB) Photo)
WHERE courseid = ' + cast(@.inCourseID as varchar)
exec (@.SQL)
GO
insert into COURSES
values('Test Course', NULL)
GO
exec spInsertPhoto 1, 'c:\temp\test2.jpg'
Alain Quesnel
alainsansspam@.logiquel.com
www.logiquel.com
"Raghad" <Raghad@.discussions.microsoft.com> wrote in message
news:52A8884D-4DAD-4713-AC71-67ACAC99A993@.microsoft.com...
> How can I import my word documents into SQL server 2000?
|||AQ> This works in MSSQL 2005 (untested in 2000). It assumes that the
AQ> file is accessible by the server (on one of its local disks, or a
AQ> network shared drive).
The bulk provider isn't support for OpenRowSet in 2000.

Thanks,
Kent Tegels
http://staff.develop.com/ktegels/
Sunday, February 19, 2012
How to I load XML into SQL Server 2000
I feel like I must be missing something because there
doesn't seem to be a simple solution to this problem. I
have an XML document and a DTD document and I want to load
this information into SQL Server.
I try to use DTS import but I keep getting the error
message "SQLOLEDB must be specified as the data provider".
Am I asking too much here?Bob: This can be accomplished using OPENXML in SQL 2000:
http://www.sqlxml.org/faqs.aspx?faq=39.
Jay Nathan
http://www.jaynathan.com/blog
"Bob Smith" <anonymous@.discussions.microsoft.com> wrote in message
news:10ca01c4e54a$cdc35e10$a401280a@.phx.gbl...
> I feel like I must be missing something because there
> doesn't seem to be a simple solution to this problem. I
> have an XML document and a DTD document and I want to load
> this information into SQL Server.
> I try to use DTS import but I keep getting the error
> message "SQLOLEDB must be specified as the data provider".
> Am I asking too much here?
doesn't seem to be a simple solution to this problem. I
have an XML document and a DTD document and I want to load
this information into SQL Server.
I try to use DTS import but I keep getting the error
message "SQLOLEDB must be specified as the data provider".
Am I asking too much here?Bob: This can be accomplished using OPENXML in SQL 2000:
http://www.sqlxml.org/faqs.aspx?faq=39.
Jay Nathan
http://www.jaynathan.com/blog
"Bob Smith" <anonymous@.discussions.microsoft.com> wrote in message
news:10ca01c4e54a$cdc35e10$a401280a@.phx.gbl...
> I feel like I must be missing something because there
> doesn't seem to be a simple solution to this problem. I
> have an XML document and a DTD document and I want to load
> this information into SQL Server.
> I try to use DTS import but I keep getting the error
> message "SQLOLEDB must be specified as the data provider".
> Am I asking too much here?
How to I load XML into SQL Server 2000
I feel like I must be missing something because there
doesn't seem to be a simple solution to this problem. I
have an XML document and a DTD document and I want to load
this information into SQL Server.
I try to use DTS import but I keep getting the error
message "SQLOLEDB must be specified as the data provider".
Am I asking too much here?
Bob: This can be accomplished using OPENXML in SQL 2000:
http://www.sqlxml.org/faqs.aspx?faq=39.
Jay Nathan
http://www.jaynathan.com/blog
"Bob Smith" <anonymous@.discussions.microsoft.com> wrote in message
news:10ca01c4e54a$cdc35e10$a401280a@.phx.gbl...
> I feel like I must be missing something because there
> doesn't seem to be a simple solution to this problem. I
> have an XML document and a DTD document and I want to load
> this information into SQL Server.
> I try to use DTS import but I keep getting the error
> message "SQLOLEDB must be specified as the data provider".
> Am I asking too much here?
doesn't seem to be a simple solution to this problem. I
have an XML document and a DTD document and I want to load
this information into SQL Server.
I try to use DTS import but I keep getting the error
message "SQLOLEDB must be specified as the data provider".
Am I asking too much here?
Bob: This can be accomplished using OPENXML in SQL 2000:
http://www.sqlxml.org/faqs.aspx?faq=39.
Jay Nathan
http://www.jaynathan.com/blog
"Bob Smith" <anonymous@.discussions.microsoft.com> wrote in message
news:10ca01c4e54a$cdc35e10$a401280a@.phx.gbl...
> I feel like I must be missing something because there
> doesn't seem to be a simple solution to this problem. I
> have an XML document and a DTD document and I want to load
> this information into SQL Server.
> I try to use DTS import but I keep getting the error
> message "SQLOLEDB must be specified as the data provider".
> Am I asking too much here?
Subscribe to:
Posts (Atom)