Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

to check file exist or not in sharepoint using script task in ssis 2008 r2 Expand / Collapse
Posted Thursday, December 13, 2012 3:54 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, October 9, 2016 12:15 AM
Points: 55, Visits: 197
Hi All, I have sql server 2008 R2 installed on my system. I am trying to check if file exist or not in SharePoint using ssis script task. I can see the file if I use the SharePoint link in browser. But If I use the same link in SSIS variable and using that variable in script task, The script task is returning negative result.
Please tell me if this is a problem with the sql server access to SharePoint or any other problem.
I think access is not a problem because I can access the SharePoint link and in sql server I use windows authentication to login.

Post #1396096
Posted Monday, December 17, 2012 9:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 4, 2016 2:19 PM
Points: 28, Visits: 170
When you test the access by entering the UNC path to the SharePoint file in Windows Explorer, is that from your personal local computer or from the server where SSIS is running? The reason I ask is because I've had an identical situation with an SSIS package I've developed going to SharePoint 2010 using SQL Server 2008 R2 and processing files after first checking to see whether or not they exist.

Is the SSIS package automatically applying the credentials associated with your account or with a static built-in account? If the later is the case, then perhaps it lacks the required credentials. You may need to follow up with the SharePoint admin for assistance.

Another issue may be due to the code you're applying. Within a Foreach Loop Container, the first Script Task applies the following by passing to it a User::FileName variable:

        public void Main()
if (File.Exists(Dts.Variables["FileName"].Value.ToString()) )
Dts.Variables["bolFileExists"].Value = true;
Dts.Variables["bolFileExists"].Value = false;

Leading from that are two line options. One applies the Expression "@bolFileExists==True" where the file is processed and the other applies "@bolFileExists==False" skipping the processing steps.

Post #1397326
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse