a little help here..i already read whatever text in the notepad using stored procedure but i don't know how to modify certain line of text..how will i solve this?
this my sp..
Code:
set nocount on
create table #file_contents (
line_number int identity,
line_contents nvarchar(4000)
)
declare @file_contents nvarchar(4000)
declare @new_line char(2)
set @new_line = char(13) + char(10)
insert #file_contents
exec master.dbo.xp_cmdshell 'type c:\sample.txt'
select @file_contents =
isnull(@file_contents, '') + @new_line +
isnull(line_contents, '')
from #file_contents
select @file_contents
drop table #file_contents
set nocount off