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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:43:54+00:00 2026-05-12T06:43:54+00:00

this statement I use in a sproc (where the search phrase ‘reiseportal*’ is a

  • 0

this statement I use in a sproc (where the search phrase ‘reiseportal*’ is a parameter) does not work with a wildcard, as I recognized:

DECLARE @strSQL NVARCHAR(MAX)

SELECT @strSQL= 'SELECT FileName, path, size, vpath from "GRIP-SERVER"."Web2"..SCOPE() where contains
('SELECT @strSQL=@strSQL  + CHAR(39) + CHAR(39)+ 'reiseportal*' + CHAR(39) + CHAR(39)+')'

SELECT @strSQL='SELECT DISTINCT DOC.ID_Kandidat, IDXS.* FROM
OPENQUERY([GRIP-SERVER],'+ CHAR(39) + @strSQL + CHAR(39) +') AS IDXS INNER JOIN
tblK_Dokumente AS DOC
ON DOC.Link = IDXS.[FileName]
ORDER BY ID_Kandidat'

EXEC sp_executesql @statement = @strSQL

these are the contents of the @strSQL variable:

after 1st select:

select FileName, path, size, vpath from "GRIP-SERVER"."Web2"..SCOPE() where
contains(''reiseportal*'')

2nd select:

SELECT DISTINCT DOC.ID_Kandidat, IDXS.* FROM
OPENQUERY([GRIP-SERVER],'select FileName, path, size, vpath from "GRIP-SERVER"."Web2"..SCOPE() where
contains(''reiseportal*'')') AS IDXS INNER JOIN
tblK_Dokumente AS DOC
ON DOC.Link = IDXS.[FileName]
ORDER BY ID_Kandidat'

GRIP-SERVER is the linked Index Server (=Microsoft Server 2003 – our file server).

I don’t get it … it returns results with “reiseportals” but not “reiseportal*” or “reiseportal%”. Do you have any hints for me?

Your help is greatly appreciated, thanks a lot!

  • 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-12T06:43:55+00:00Added an answer on May 12, 2026 at 6:43 am

    I found the answer myself.

    The problem is not the wildcard, but the string-markers. The index server does not use apostrophes but quotation marks. So the correct SQL should be like:

    SELECT DISTINCT DOC.ID_Kandidat, IDXS.* FROM
    OPENQUERY([GRIP-SERVER],'select FileName, path, size, vpath from "GRIP-SERVER"."Web2"..SCOPE() where
    contains(''"reiseportal*"'')') AS IDXS INNER JOIN
    tblK_Dokumente AS DOC
    ON DOC.Link = IDXS.[FileName]
    ORDER BY ID_Kandidat
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use this sql statement. The first 2 parts work fine, I am
Can you use int blah = Convert.ToInt32(cmd.ExecuteScalar()); When the sproc's last statement does: RETURN
i use this statement for a single where condition ('SELECT * FROM users WHERE
I'm using Python 2.5. I'm trying to use this 'with' statement. from __future__ import
I followed this link to make use of recent files list but statement below
I'm sure this will equate down to the use of the COUNT statement but
This statement doesnot work in Entity Framework context.sleep.Where(o=>o.clientDateTime.TimeOfDay>new TimeSpan(18,0,0)).ToList(); Please suggest me a workaround.
In this statement, taken from the Pagerank source code: Pattern.compile(\\[.+?\\]); What does the pattern
When I use this statement if(count($this->input->post('p_id') =0)) , I keep getting this error: Fatal
I have a table in sql, I use this statement to make a select:

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.