Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7419047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:59:33+00:00 2026-05-29T07:59:33+00:00

I have custom function which return a table it accepts two varchars, it splits

  • 0

I have custom function which return a table
it accepts two varchars, it splits the varchar based on the delimeter

SELECT VALUE FROM dbo.Split('xxx','_') --- working

select abc from abcd a,cde b where a.abc like (SELECT VALUE FROM dbo.Split(b.abc,'_'))-- not working


select abc from abcd a,cde b where a.abc like (SELECT VALUE FROM dbo.Split('xx','_'))-- working

select abc from abcd a,cde b where a.abc like (SELECT b.abc)-- working

How to get the not working case to work.

Error i get it
Incorrect syntax near ‘.’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:59:34+00:00Added an answer on May 29, 2026 at 7:59 am

    Using CROSS APPLY allows you to use a variable as a parameter to a function.

    SELECT abc
    FROM   abcd a
           , cde b
           CROSS APPLY (select VALUE from dbo.Split(b.abc, '_')) f
    WHERE  a.abc LIKE f.Value
    

    or

    SELECT  *
    FROM    abcd a
            , cde b        
            CROSS APPLY dbo.Split(b.abc, '_') f
    WHERE   a.abc LIKE f.Value
    

    The APPLY operator allows you to invoke a table-valued function for
    each row returned by an outer table expression of a query.

    Test script

    CREATE FUNCTION dbo.Split(@a VARCHAR(4), @b VARCHAR(4)) 
    RETURNS TABLE 
    AS RETURN
    (
      SELECT Value = 'Test'  
    )
    GO
    
    ;WITH abcd (abc) AS (
      SELECT 'Test'
    )
    , cde (abc) AS (
      SELECT 'Test'
    )  
    SELECT  *
    FROM    abcd a
            , cde b        
            CROSS APPLY (SELECT Value FROM dbo.Split(b.abc, '_')) f
    WHERE   a.abc LIKE f.Value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function which takes a custom struct as the argument. how can
I have a load of php templates which uses a custom translate function __,
I have a custom PHP function which executes a stored procedure and returns an
I have a custom validation function in JavaScript in a user control on a
i have custom cell with 2 buttons(the function of these buttons is just to
I have a custom UITableViewCell. In its function - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier, I need
I have a custom control that has the following prototype. Type.registerNamespace('Demo'); Demo.CustomTextBox = function(element)
I have used sendinput() function and windows keyboard hooks to develop a custom keyboard
I have a SQL function called get_forecast_history(integer,integer) that takes two arguments, a month and
I have several stored procedures which return a strongly typed result set. I've learned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.