Solved

Need to put a Varbinary value in field.

Posted on 2011-09-10
2
347 Views
Last Modified: 2012-05-12
I need to place a value in this field for something I'm testing :

PictureBinary      varbinary(MAX)      not null

But I get errors when I try 0, 0x0, . . . (see pic)

What (binary) value can I put in there just so I can create the row? thanks


 error
0
Comment
Question by:MikeMCSD
2 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 36517191
As the message indicates the only value you can enter is NULL.  You will have to use an INSERT statement in order to do enter something other than NULL.  As in:
INSERT YourTable (PictureBinary) VALUES  (Cast('0x0' AS varbinary(MAX)))

0
 
LVL 16

Author Comment

by:MikeMCSD
ID: 36517222
thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now