Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Where do I put custom SQL functions in kentico. View modes: 
User avatar
Member
Member
vcarter - 5/24/2013 12:08:32 PM
   
Where do I put custom SQL functions in kentico.
I am referencing this article:

http://www.kenticosolutions.com/Developer-Tips/Tip/May-2011/Many-to-Many-relationships-in-the-Kentico-CMS-Cont.aspx

Essentially my goal is to create a filter that allows me to select news documents based on content editor selection of multiple custom document type attributes. Business Units, Regions, etc., which are being stored in the custom doc type table as pipe delimited lists.

Referencing the above article he creates a SQL function to split this column data allowing content to be filtered. What I am not understanding is WHERE I am supposed to create this function. When I create a custom query under the given document type, it does not seem to be available to the other queries under that same type. When I try and create it under system tables as a stored proc, the syntax does not appear to be correct and, as I am not a DBA, I am not sure how to resolve the issues created.

To me, it seems as if I am simply not putting this function in the correct place and/or I am not referencing it properly.

Any help with this would be greatly appreciated.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 5/24/2013 1:24:22 PM
   
RE:Where do I put custom SQL functions in kentico.
You will need to add the function into the database via SQL Server Management Studio. Then my suggestion would be to create a custom query in one of the document types so you can use a custom query repeater to display what you need. Others may say to just create the stored procedure or query in the database, I say use the UI, thats what it's for. :)

User avatar
Member
Member
vcarter - 5/24/2013 2:24:11 PM
   
RE:Where do I put custom SQL functions in kentico.
Thanks, that was what I needed to know. It appears this solution is not going to work for me as I am not going to have direct access to the database. I was hoping to do this(add the function) via kentico. There are other ways to accomplish what I am going for, this split function just seemed interesting.

Appreciate the info.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 5/24/2013 2:34:05 PM
   
RE:Where do I put custom SQL functions in kentico.
There is a module in the Marketplace that will allow you to execute SQL via the UI, although I'm not sure about creating any functions, stored procedures or views. Doesn't hurt to try though.

User avatar
Member
Member
vcarter - 5/24/2013 2:45:16 PM
   
RE:Where do I put custom SQL functions in kentico.
Thanks, I will take a look.