473,375 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,375 software developers and data experts.

Scripting text, image columns

We have remote users running MSDE entering information into a
database. To send the data back to the home office, we've written some
routines that export the data into SQL Scripts in text files:

DELETE <table> where KeyID=<x>
INSERT INOT <table> (fields) VALUES (fields).

We then zip up these scripts, and either email or ftp the ZIPs back to
the home office, where a program opens them up and simply "runs" the
SQL statements.

The new version of my database application contains both TEXT fields
(containing rich text) and IMAGE fields (containing file attachments
like JPGs or excel spreadsheets). I'm worried that our SQL Scripter
engine (which we really like) is going to choke on the text and image
fields. Can anyone suggest a similar method to send the SQL data
around?

thanks
matt tag
Jul 20 '05 #1
4 3237
matt tagliaferri (mt******@cleindians.com) writes:
We have remote users running MSDE entering information into a
database. To send the data back to the home office, we've written some
routines that export the data into SQL Scripts in text files:

DELETE <table> where KeyID=<x>
INSERT INOT <table> (fields) VALUES (fields).

We then zip up these scripts, and either email or ftp the ZIPs back to
the home office, where a program opens them up and simply "runs" the
SQL statements.

The new version of my database application contains both TEXT fields
(containing rich text) and IMAGE fields (containing file attachments
like JPGs or excel spreadsheets). I'm worried that our SQL Scripter
engine (which we really like) is going to choke on the text and image
fields. Can anyone suggest a similar method to send the SQL data
around?


Well, the obvious tool would be replication, presumably merge replication.
But merge replication is for the faint of heart, and if you have your
scripting solution working, you may find that extending it so that
it handles text and image data is relatively simple affair.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
> Well, the obvious tool would be replication, presumably merge replication.
But merge replication is for the faint of heart, and if you have your
scripting solution working, you may find that extending it so that
it handles text and image data is relatively simple affair.


Agreed. I use Merge replication in another application where people
take data on the road with them for short periods, but come back into
the office. I'm leery of using it in situations where the remote users
are always on the road, which is the case in this new application.

I've tried taking the results of a "select * from <t>" query that
included an image column, altered it in notepad to be an "insert into
<t>" with the hex representation of the image data, and this works.

I just need to figure out how, in code, to turn the image data into
the hex representation, and I think I'll be on my way.

Any ideas how to do that?

matt tag
Jul 20 '05 #3
I would suggest you use XML. Importing XML to/from a database is
really, really easy.
Jul 20 '05 #4
matt tagliaferri (mt******@adelphia.net) writes:
I just need to figure out how, in code, to turn the image data into
the hex representation, and I think I'll be on my way.

Any ideas how to do that?


There is an undocumented UDF that you can find in master which performs
the task. I'm not sure that it handles image though.

And in any case, I would definitely do the binary-to-hex translation
in client code. That would be more effecient.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steel | last post by:
Hi at all, how is it possible to insert (Fuyll immersion) an image into a text so that the text is all around the image using CSS2+? Thank in advance Steel
9
by: Code4u | last post by:
I have an application that manipulates large arrays of image data of various types, all the usual arithmetic operations on the data objects are supported. With careful design and tricks similar to...
3
by: JOSEPHINE ALVAREZ | last post by:
I have this code that I want to use to do a rollover. However, because the company I am doing it for is continually changing the text, I want to be able to use dynamic text to change the text on...
1
by: Peter | last post by:
Hello, Thanks for reviewing my question. My SQL table has a few string columns and a image column. After inserting a new row into the dataset with the columns populated, I tried calling the...
4
by: Arif Çimen | last post by:
Hi to everybody, I have chnged a button text in design mode. But After compiling and executing the program the text of the button do not change to new value. Any Ideas? Thaks for helps.
1
by: ing42 | last post by:
I have a problem with inserting records into table when an indexed view is based on it. Table has text field (without it there is no problem, but I need it). Here is a sample code: USE test GO...
9
by: shapper | last post by:
Hello, What is the best way to place an image and a text side by side using CSS? Basicaly what I am trying to do is to make the image and the text to appear as follows: Image My Text......
14
by: Zhang Weiwu | last post by:
Hello. I have been using word processor like OOO for nearly 10 years and such layout is very usual to me: gopher://sdf.lonestar.org/I/users/weiwu/ooo_wrap_correctly.png but I found it's very...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.