cancel
Showing results for 
Search instead for 
Did you mean: 

run sql custom function

former_member214617
Participant
0 Kudos

hi guys

Please tell me how to run the sql function to update the sql table through data services..

see the below sql statement which is running fine in sql management studio, but not through data services


UPDATE Article SET ArticleCategories = (SELECT dbo.[SplitAndRemoveDuplicates](';', ArticleCategories))

I have tried

Print(exec( sql( database_connection', 'UPDATE Article SET ArticleCategories = (SELECT dbo.[SplitAndRemoveDuplicates](';', ArticleCategories))'),'',8 ));

[Script:Script2680]
The script <Script2680> contains an invalid expression. Additional information: <Identifier <SplitAndRemoveDuplicates> is unrecognized. Check its spelling and usage. If it is a variable, it needs a preceding '$'; if a constant, it must be quoted; if a column, verify that such a column exists in a table.>. (BODI-1111242)

Tried creating function call in query transform as well.. but getting an error..

any help please

Accepted Solutions (1)

Accepted Solutions (1)

former_member211387
Contributor
0 Kudos

you can do it using the standard sql function.

Syntax is sql (<Datastore for the target database>, <SQL Statement>);

for your case if will be something like the below

sql('<>Enter Datastore for the target database' , 'UPDATE Article SET ArticleCategories = (SELECT dbo.SplitAndRemoveDuplicates(\';\', ArticleCategories))');

Raghu

Answers (1)

Answers (1)

former_member198401
Active Contributor
0 Kudos

Can you tell me what is the output of SplitAndRemoveDuplicates function which you have created.

Regards

Arun Sasi