Hi i am trying to use text file to write a value as soon as there is any update/insert into a table.
for that i am using a text file and made a linked server relation with it.....
and inserting into the needed value in the text file usind linked server insert command.....
Till here its working fine....
now with time the text file is growing and i only needed the latest value from the text file.....
so i want to truncate the values from table.....
whenever i am truncating or deleting i am getting the error..
I'll explain what i did....
1. create folder [C:\testSQLEvent]
2. create file Sample.ini
3. copy the follwing content
ColNameHeader = False
Format = CSVDelimited
CharacterSet = ANSI
Col1=ProductID short
Col2=ProductName char width 30
Col3=QuantityPerUnit char width 30
Col4=UnitPrice currency
Col5=Discontinued bit
4. create file named Sample2.txt
5. create linked server
EXEC sp_addlinkedserver txtsrv, 'Jet 4.0',
'Microsoft.Jet.OLEDB.4.0',
'c:\testSQLEvent\',
NULL,
'Text'
GO
6. --Set up login mappings.
EXEC sp_addlinkedsrvlogin txtsrv, FALSE, sa, NULL
GO
7. view listing of tables
EXEC sp_tables_ex txtsrv
8. view all list of that table
SELECT * FROM txtsrv...[Sample2#txt]
9. insert into table
insert into txtsrv...Sample2#txt( slNo , ItemName, ItemDescription,price,status)
values(5,'Test item','test item description',$300.00,'true')
10. view all list of that table
SELECT * FROM txtsrv...[Sample2#txt]
Errors faced
1.
update txtsrv...Sample2#txt set ItemName ='ABCED', ItemDescription='xyzw',price=$30000,status='true' where slNo=5
2.
delete from txtsrv...[Sample2#txt]
3.
drop table txtsrv...[Sample2#txt]
please help me out............
i need it asap.......