15,959,706 members
See more:
I've following table
SQL
```CREATE TABLE [dbo].[Customer](
[CustomerID] [int] IDENTITY(1,1) NOT NULL,
[City] [varchar](50) NULL,
[Country] [varchar](50) NULL,
[PostalCode] [nchar](10) NULL,
[Picture] [varbinary](max)
) ON [PRIMARY]```

Posted
Updated 21-Oct-13 1:28am
v3

## Solution 2

Like this
```CREATE TABLE [dob].[Customer](
[CustomerID] [int] IDENTITY(1,1) NOT NULL,
[City] [varchar](50) NULL,
[Country] [varchar](50) NULL,
[PostalCode] [nchar](10) NULL,
[Picture] [nvarchar]()
) ON [PRIMARY]				```

```INSERT INTO  [dbo].[Customer] --([City], [Country], [PostalCode], [Picture])
VALUES('Oshkosh','USA','54903',0x4F),
('Harlingen','USA','78551',0xCE)```

```SELECT [CustomerID]
,[City]
,[Country]
,[PostalCode]
,[Picture]
FROM [dbo].[Customer]
GO		```

```CustomerID	City	        Country	    PostalCode	Picture
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1	        Oshkosh	        USA	    54903     	0x4F
2	        Harlingen	USA	    78551     	0xCE```

```DECLARE @strImage nvarchar(888)
SET @strImage = 'c:\users\PT\MyImage.jpg'```

```DECLARE @strExec [nvarchar](999)
SET @strExec = N'INSERT INTO [dbo].[Customer](Picture) SELECT * FROM OPENROWSET(BULK N''' + @strImage + ''', SINGLE_BLOB) as [imageDedicated]'```

`EXEC(@strExec)`

[end edit]

v2
prashantttt 22-Oct-13 1:06am
in INSERT query what is it 0xCE ???
RedDk 22-Oct-13 1:45am
It's just a hexadecimal sequence. See the BOL ... lookup binary data type. Best idea is to go to www.codeplex.com and download and install AdventureWorks database sample (in any or all of the forms found). Many references in BOL point to the tables in these packages.
prashantttt 22-Oct-13 2:27am
but how can i get to know what to write for which file...?
the way u have written 0x4F for first image, 0xCE for second image
RedDk 23-Oct-13 0:06am
see edit
RedDk 22-Oct-13 12:01pm
PT,
See my revision @