SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


to check file exist or not in sharepoint using script task in ssis 2008 r2


to check file exist or not in sharepoint using script task in ssis 2008 r2

Author
Message
rajn.knit07
rajn.knit07
SSC-Enthusiastic
SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)SSC-Enthusiastic (171 reputation)

Group: General Forum Members
Points: 171 Visits: 201
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.



Thanks
Rajneesh
grantbanjo
grantbanjo
SSC Veteran
SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)SSC Veteran (282 reputation)

Group: General Forum Members
Points: 282 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;
}
else
{
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search