September 23, 2003 at 6:10 pm
I have a table which stores documents (Word, Excel etc.) and pictures as a binary data.
The problem is : When someone delete the document from DB, is it possible to restore it from DB backup as a document and save as a file.
Thankyou
September 23, 2003 at 11:42 pm
If you restore the database under another name, retrieve and save the object to disk.
September 24, 2003 at 4:15 pm
Thanks for reply.
How can I retrieve the document from database if it is in binary format?
September 24, 2003 at 5:07 pm
September 24, 2003 at 11:03 pm
Thankyou for the link.
Looks like the code can help me, but I don't know how to run it.
I've tried to put it in ActiveX but it doesn't work?
How can I run it?
Thank you.
September 25, 2003 at 12:04 am
Sorry did not read the full article.
A better solution is to use textcopy.exe
See usable example at http://www.mssqlcity.com/Articles/KnowHow/Textcopy.htm
September 25, 2003 at 1:38 am
Have you test it?
It doesn't work for me.
I've used textcopy.exe utilities.
Any thoughts?
September 25, 2003 at 3:17 pm
Step 1
quote:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Test]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)drop table [dbo].[Test]
GO
CREATE TABLE [dbo].[Test] (
[A] [int] NOT NULL ,
[image] NULL ) TEXTIMAGE_ON [PRIMARY]
GO
INSERT INTO Test VALUES (1, 0x0)
Go
Step 2
quote:
-- Load the filetextcopy /S SERVER /T TEST /C B /W " WHERE A = 1 " /F C:\jnk.ico /I /Z /D DATABASENAME /U SA /P PASSWORD
-- Save the file
textcopy /S SERVER /T TEST /C B /W " WHERE A = 1 " /F C:\jnkII.ico /O /Z /D DATABASENAME /U SA /P PASSWORD
quote:
TypeTEXTCOPY /?
for the commandline parameters
September 28, 2003 at 5:04 pm
I'm sorry but I did not understand the step2.
Do I need to load textcopy.exe file or create new one?
And where this file should be saved?
What this fragment does mean: C:\jnk.ico
September 28, 2003 at 5:52 pm
C:\JNK.ico is the filename of an icon which I have loaded into the database with the program TEXTCOPY.exe
C:\JNKII.ICO is the filename where the the image was stored, when retieved from the SQL database using TEXTCOPY.exe to retrieve the image.
TEXTCOPY.exe is in the folder C:\Program Files\Microsoft SQL Server\MSSQL\Binn and is a Microsoft supplied executable.
September 28, 2003 at 6:48 pm
I have the folllowing error message:
'TEXTCOPY' is not recognized as an internal or external command,operable program or batch file.
September 28, 2003 at 7:11 pm
Open Windows Explorer and search for TEXTCOPY.exe
If you do not find it on your own pc search the SQL server machine for it.
September 28, 2003 at 7:22 pm
I have this file on default location C:\Program Files\Microsoft SQL Server\MSSQL\Binn, but it does not work and does not give me any messages.
Can I see the LOG file?
September 28, 2003 at 9:53 pm
Open a command prompt(DOS promnpt) and change your directory to C:\Program Files\Microsoft SQL Server\MSSQL\Binn
Type
TEXTCOPY.exe /?
The program should display the help menu.
September 28, 2003 at 10:19 pm
Thank you very much.
It is working now.
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply