Skip to main content

Posts

Showing posts with the label filename

How to add multiple log files in SQL Database

Below query can create ldf file.Its creating second ldf file on Testdb Database. You can create as many as you want. USE [master] GO ALTER DATABASE [TestDb] ADD LOG FILE ( NAME = N'TestDB_Log2', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\DATA\Testdb_Log2.ldf' , SIZE = 1024KB , FILEGROWTH = 10%) GO I Hope this could be your expected solution.

procedure to Insert image using sql by using LOB ,BLOB,CLOB data types

Insert image using sql create or replace procedure load(filename varchar2) as f_lob bfile; b_lob blob; begin insert into images values(filename,substr(filename,instr(filename,'.')+1),empty_blob()) return content into b_lob; f_lob:=BFILENAME('PAVAN',filename); dbms_lob.fileopen(f_lob,dbms_lob.file_readonly); dbms_lob.loadfromfile(b_lob,f_lob,dbms_lob.getlength(f_lob)); dbms_lob.fileclose(f_lob); commit; end;