Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > SQL SERVER (TECHNET) > Manually inserting to image column in Management Studio
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 5th September 11:45
sthrudel
External User
 
Posts: 1
Default Manually inserting to image column in Management Studio


Is it possible to manually insert some data into image column in MSSQL
Management Studio?

I have defined a table that contains image column for inserting some
binary data. I don't have the logic for inserting that data into
database but I would already like to get some data from the database.
  Reply With Quote


  sponsored links


2 5th September 11:46
jens
External User
 
Posts: 1
Default Manually inserting to image column in Management Studio


No, you can´t do that in SQLMS. But inserting data is straight
forward:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=622943&SiteID=1

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---
  Reply With Quote
3 5th September 19:46
erland sommarskog
External User
 
Posts: 1
Default Manually inserting to image column in Management Studio


(sthrudel@gmail.com) writes:

First of all, the combination of "image" and Management Studio, triggers
my "don't do that!" knee-jerk reaction.

That is, on SQL 2005 there is a new data type, varbinary(MAX), which just
like image permits storage up to 2 GB. But in difference to image,
varbinary(MAX) works just like the regular varbinary data type, and you
don't have to deal with the many quirks of image.

Of course, you may using SSMS to connect to SQL 2000, or you have a
requirement to support SQL 2000. But if you target SQL 2005 only, there
is little reason to use image.

As for your question, the answer is "in theory, yes". You can simply
say:

INSERT tbl (keycol, imagecol)
VALUES (1, 0x1212ABCC...)

To insert meaningful data this way, you would first have to get a hex-string
representation of your data.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666