p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > SQL Server > SQL Server 2000 > SQL Server 2000
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 17th, 2009, 08:08 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default Converting Text column to image column

Dear friends,

My old db contains a text column.
In my new db it is image datatype.
I want to migrate my old data to new db.

Is there any method to do it..

Thanks
__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.

Last edited by jomet : September 17th, 2009 at 08:13 AM. Reason: typo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 17th, 2009, 09:05 AM
Friend of Wrox
Points: 1,882, Level: 17
Points: 1,882, Level: 17 Points: 1,882, Level: 17 Points: 1,882, Level: 17
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 Posts
Default

If you are using SQL server then

text
Variable-length non-Unicode data in the code page of the server and with a maximum length of 2^31-1 (2,147,483,647) characters. When the server code page uses double-byte characters, the storage is still 2,147,483,647 bytes. Depending on the character string, the storage size may be less than 2,147,483,647 bytes.

image
Variable-length binary data from 0 through 2^31-1 (2,147,483,647) bytes.
I think conversion from text to image data type is not allowed in SQL
text and image Data Types

Automatic data type conversion is not supported for the text and image data types.

You can explicitly convert text data to character data, and image data to binary or varbinary, but the maximum length is 8000 bytes. If you try an incorrect conversion such as trying to convert a character expression that includes letters to an int, SQL Server returns an error message.
__________________
Om Prakash Pant
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to om_prakash For This Useful Post:
jomet (September 17th, 2009)
  #3 (permalink)  
Old September 17th, 2009, 09:45 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Thanks om_prakash
Tried converting text to varchar(8000) and then to image.
It is working,but my text column contains more than 8000 characters.

So now i am trying to write an application , which reads data , convert and then insert to table.
__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old September 18th, 2009, 02:03 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Any possibilities are there within sql 2000?
(using file system object or so...)

Any good links , for the usage of file system object..
__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old September 18th, 2009, 02:20 AM
Friend of Wrox
Points: 1,882, Level: 17
Points: 1,882, Level: 17 Points: 1,882, Level: 17 Points: 1,882, Level: 17
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 Posts
Default

Hi,
Please check the following link for usage of filesystem object in ASP:
http://www.w3schools.com/asp/asp_ref_filesystem.asp
__________________
Om Prakash Pant
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old September 18th, 2009, 02:30 AM
Friend of Wrox
Points: 601, Level: 9
Points: 601, Level: 9 Points: 601, Level: 9 Points: 601, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2005
Location: Cochin, Kerala, India.
Posts: 183
Thanks: 4
Thanked 0 Times in 0 Posts
Default

But i am checking whether it is possible with some SP which uses File system object
like
EXEC @hr = sp_OACreate 'Scripting.FileSystemObject', @ole_FileSystem OUT
__________________
jomet.
`````````````````````````````````````````````````` ``````````````````````
Once you start a working on something, dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old September 18th, 2009, 03:36 AM
Friend of Wrox
Points: 1,882, Level: 17
Points: 1,882, Level: 17 Points: 1,882, Level: 17 Points: 1,882, Level: 17
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 Posts
Default

If you want to export some data into flat files, then you can use DTS for this.

http://msdn.microsoft.com/en-us/library/cc917688.aspx

Other links which will be helpful..

http://vstoolsforum.com/blogs/sqlser...rver-2000.aspx
http://www.mssqlserver.com/faq/general-flatfile.asp
__________________
Om Prakash Pant
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Column Header Text vinod_yadav1919 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 November 29th, 2008 01:53 AM
To get text of ButtonField column in GridView nitinp ASP.NET 2.0 Professional 11 May 26th, 2007 01:55 PM
How To Force Column To Text ritag Excel VBA 12 August 13th, 2004 05:36 PM
Compare two Items of data(in column A and column B ever Excel VBA 6 February 13th, 2004 02:19 PM
how to capture the text in column khautinh C# 0 December 19th, 2003 01:38 PM



All times are GMT -4. The time now is 12:38 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc