How to use UNC name (remote computer) in the @outputfile parameter of sp_makewebtask ?
-
Hi friends, In my application (developed in asp.net 1.1), I am going to implement the Cache dependency mechanism. I want to automatically invalidate the Cache object, once any manipulations done on a particular table in SQL Server. My application and DB is running in different system. I found in one of the site, to create a trigger on the table which in tern calls the sp_makewebtask System stored procedure and write output of the query into a file. EXEC sp_makewebtask @outputfile = 'c:\testcache.txt' @query = 'select top 1 Problem_Category_Code from SMD_Problem_Category' But the 'C:\testcache.txt' is pointing the local system in which SQL is running. I want to write a file which is available in remote system. I shared a folder from the system and made a mapped drive in the SQL system. (as z:\ drive) I used the statements as : @outputfile = 'Z:\testcache.txt' also as @outputfile = '\\10.160.1.4\wc\testcache.txt' But in both the cases I got the error as: Msg 16821, Level 11, State 1, Procedure sp_makewebtask, Line 131 SQL Web Assistant: Could not open the output file. But in one site it is mentioned that, we can use the UNC name if we want to write file in remote system. How can I run the SP? Can anyone please help me to solve this problem? I need some swift reply on this issue, as it is very urgent for me.
Thankfully, jm
-
Hi friends, In my application (developed in asp.net 1.1), I am going to implement the Cache dependency mechanism. I want to automatically invalidate the Cache object, once any manipulations done on a particular table in SQL Server. My application and DB is running in different system. I found in one of the site, to create a trigger on the table which in tern calls the sp_makewebtask System stored procedure and write output of the query into a file. EXEC sp_makewebtask @outputfile = 'c:\testcache.txt' @query = 'select top 1 Problem_Category_Code from SMD_Problem_Category' But the 'C:\testcache.txt' is pointing the local system in which SQL is running. I want to write a file which is available in remote system. I shared a folder from the system and made a mapped drive in the SQL system. (as z:\ drive) I used the statements as : @outputfile = 'Z:\testcache.txt' also as @outputfile = '\\10.160.1.4\wc\testcache.txt' But in both the cases I got the error as: Msg 16821, Level 11, State 1, Procedure sp_makewebtask, Line 131 SQL Web Assistant: Could not open the output file. But in one site it is mentioned that, we can use the UNC name if we want to write file in remote system. How can I run the SP? Can anyone please help me to solve this problem? I need some swift reply on this issue, as it is very urgent for me.
Thankfully, jm
This means that SQL Server does not have the required permission to write into the shared folder. You ought to give write permission to the account under which SQL Server is running to the shared folder. Make sure you give permission under the "Sharing" tab and "Security" tab.
SG Cause is effect concealed. Effect is cause revealed.