473,399 Members | 3,919 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,399 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 3240
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.