Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 From ASCII String to Image column
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GregDDDD
Posting Yak Master

120 Posts

Posted - 11/20/2012 :  12:01:09  Show Profile  Reply with Quote
Someone gave me a few rows of data exported from a table. This was given to me in an Excel 2008 format (*.xlsx) and SQL Server would not import it because it was missing some library. All I really need is a single row so I can do a little programming until I can get access to the live db.

Really, I only need a half dozen columns so I exported to a CSV and tried to import from there but there is an IMAGE data type column that is causing me problems and I don't have access to create an SSIS package on this development system.

I then tried creating a INSERT query to just get the one row with the columns I needed and that is where I am stuck now. The CAST call shows only a small fraction of the string that came out of the Excel spreadsheet for the column. It goes on for hundreds of characters.

Greg

INSERT INTO [TestDB].[dbo].[Test_Table]
            ([queue_id]
            ,[enterprise_id]
            ,[practice_id]
            ,[agent_name]
            ,[agent_type]
            ,[state]
            ,[internal_msg])
      VALUES
            (NEWID()
            ,'00001'
            ,'00001'
            ,'00001'
            ,'00001'
            ,'00001'
            ,CAST('0x3C6952454D20766...' AS IMAGE)
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.01 seconds. Powered By: Snitz Forums 2000