Here is the query I am using to create and insert binary data in SQL Server 2008
Create query:
CREATE TABLE Employees (
Id int,
Photo varbinary(max) not null,
Name varchar(50) not null,
Sound varbinary(max) not null
)
Insert query:
INSERT INTO Employees SELECT '10',
(SELECT BulkColumn AS E FROM OPENROWSET ( BULK 'd:\1.jpg', Single_Blob) bc), 'John', (SELECT BulkColumn AS E FROM OPENROWSET ( BULK 'd:\2.wav', Single_Blob) bc)
One of the files is .jpg and the other is .wav
How can i know the extension of these files while retrieving?
Do i have to use a query for finding the extension?
OR
Do i have to see content-type after i get the resultset in jsp?