Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2009, 07:08 AM
jomet
Guest
 
Posts: n/a
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

Last edited by jomet; September 17th, 2009 at 07:13 AM.. Reason: typo
 
Old September 17th, 2009, 08:05 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 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
Click the "Thanks" button if this post helped you.
The Following User Says Thank You to om_prakash For This Useful Post:
 
Old September 17th, 2009, 08:45 AM
jomet
Guest
 
Posts: n/a
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.
 
Old September 18th, 2009, 01:03 AM
jomet
Guest
 
Posts: n/a
Default

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

Any good links , for the usage of file system object..
 
Old September 18th, 2009, 01:20 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 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
Click the "Thanks" button if this post helped you.
 
Old September 18th, 2009, 01:30 AM
jomet
Guest
 
Posts: n/a
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
 
Old September 18th, 2009, 02:36 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 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
Click the "Thanks" button if this post helped you.





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 12:55 PM
How To Force Column To Text ritag Excel VBA 12 August 13th, 2004 04: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.