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 6820215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:23:55+00:00 2026-05-26T21:23:55+00:00

select * from dbo.split(RTRIM(@importRow), ‘¬’) gives error: Msg 102, Level 15, State 1, Procedure

  • 0
select * from dbo.split(RTRIM(@importRow), '¬')

gives error:

Msg 102, Level 15, State 1, Procedure proc_name, Line 40
Incorrect syntax near ‘(‘.

What is the correct syntax for this line? It’s been a while since I have done SQL properly and can’t for the life of me get this part of the script to execute!

Using SQL Server 2005

I apologise for the Title. Not quite sure what to put other than that or “Syntax error”!

Edit: The code for the SPLIT:

CREATE FUNCTION [dbo].[Split]
(
        @String VARCHAR(4000),
        @Delimiter VARCHAR(5)
)
RETURNS @SplittedValues TABLE
(
  OccurenceId SMALLINT IDENTITY(1,1),
  SplitValue VARCHAR(4000)
)
AS
BEGIN
DECLARE @SplitLength INT

WHILE LEN(@String) > 0
BEGIN
        SELECT @SplitLength = (CASE CHARINDEX(@Delimiter,@String) WHEN 0 THEN
LEN(@String) ELSE CHARINDEX(@Delimiter,@String) -1  END)

        INSERT INTO @SplittedValues
        SELECT SUBSTRING(@String,1,@SplitLength)

        SELECT @String = (CASE (LEN(@String) - @SplitLength) WHEN 0 THEN ''
ELSE RIGHT(@String, LEN(@String) - @SplitLength - 1) END)
END
RETURN
END
GO

And the code for starting the procedure

CREATE PROCEDURE dbo.[procedure] 
-- Add the parameters for the stored procedure here
@RETURN_VALUE int,
@importRow VarChar(8000)
......
  • 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-26T21:23:55+00:00Added an answer on May 26, 2026 at 9:23 pm

    Move the RTRIM into the UDF itself (based on comments)

    This is good practice anyway so each use of the split UDF doeen’t need RTRIM

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CREATE PROCEDURE [dbo].[FlowClientGetNum] (@ID_ListGroupParIzm Integer, @ID_ListParIzm Integer) AS SELECT Number of my @ID_ListParIzm FROM
I have the following SQL: SELECT * FROM [Database].dbo.[TagsPerItem] INNER JOIN [Database].dbo.[Tag] ON [Tag].Id
I am using this query: SELECT DISTINCT pat.PublicationID FROM dbo.PubAdvTransData AS pat INNER JOIN
i've been using the following query: select LEN(columnname) as columnmame from dbo.amu_datastaging This works,
I've got these two queries: SELECT SELECT NamesRecord.NameID, NamesRecord.FulfillmentAddressID NameFulfillmentAddressID, ContractRecord.FulfillmentAddressID, ContractRecord.BillingAddressId FROM Magnet.dbo.ContractRecord
EXEC [dbo].[pr_cfgAddFact] @SettingName = 'TransferBatch', @RoleFK = SELECT TOP 1 rolepk FROM cfgRole WHERE
I'm executing the following query: Select guiPolygonID, dbo.fn_Yval(p1X, p1Y, p2X, p2Y, 4.003318) From [vPolygonSegments]
Given a table-valued function such as dbo.Split() from T-SQL: Opposite to string concatenation -
SELECT * FROM dbo.tbh_table WHERE TopicID IN ( SELECT value FROM dbo.fn_split('19,',') ) I
I have the following SQL query - SELECT * FROM dbo.LocalContacts WHERE name LIKE

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.