I want to fill the varbinary(MAX) column of a SQL Server database table when ever a new record is created with a default picture. How do I do this using a trigger or in that case by any other means?
Any help is highly appreciated. Thank You
This is the T-SQL code I have tried:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Trg_DoctorDemographic_DefaultImage]
ON [ECGManagementSystem].[dbo].[DoctorDemographic]
AFTER INSERT
NOT FOR REPLICATION
AS
BEGIN
INSERT INTO[ECGManagementSystem].[dbo].[DoctorDemographic]
(DPhoto)
SELECT * FROM OPENROWSET(Bulk N'D:\Programs\MSVC\Exercises\BEMS\BEMS\res\Doctor.bmp',SINGLE_BLOB)AS BLOB
END;