Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQLSERVER 2012
I want to load multiple image files from a specified directory to SQL Table. In one column I can save the image whereas in another I want to save its respective name which is in the directory. The Tasks I used
SQLSERVER 2012
1.Foreach loop container -- To read the files
2.Script task --- to get the filename but I can't.
I can successfully load the file in DB but I not getting its respective name...
also in my script task it not showing:-
REVERSE(String) Function
screen shot http://oi49.tinypic.com/2uhlufc.jpg[^]
http://tinypic.com/view.php?pic=sor7lu&s=6[^]
Posted
Updated 11-Jan-13 6:32am
v3
Comments
Wendelius 11-Jan-13 11:59am    
Can you post the content of the script task.
Raju9959 11-Jan-13 12:03pm    
i have idea how to get file names but the thing is in script task it not showing REVERSE string function except that it shows Substring,Replace,Find and all other functions..

If the problem is only that the intellisense does not show the reverse function in a script task, why not just try to write it. For the syntax, see REVERSE (SSIS Expression)[^]

Also since you have problems in finding the file, perhaps the following example would help you forward: Detecting an Empty Flat File with the Script Task[^]
 
Share this answer
 
Comments
Raju9959 11-Jan-13 12:36pm    
i also checked that it shows error which is in screen shot..that simple thing make me headache...
Wendelius 11-Jan-13 13:06pm    
If you're using SSIS that way, could you simply try:
string rev = string.Concat(text.Reverse().ToArray());

Don't forget to define

using System.Linq;
Raju9959 11-Jan-13 14:47pm    
yes yes thanks allot for the solution...
Is any other methods to get that reverse function result. If there just teach me..another question
eg
string name="sql-rocks-in-db";
string output="sql"---i want this as o/p
in this case i wanna use first - symbol to get its position to use in substring(function)
Wendelius 11-Jan-13 15:08pm    
I would say this can be done in multiple ways...

To get the first occurrence of a character like -, have a look at IndexOf[^]
Here is the perfect example for your request.
http://www.sqldts.com/304-2.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900