Avatar of banu111
banu111
 asked on

SQL query search

HI friends
I have function  GetValue( string id)
I am passing id=abcd
I want to assign to a variable  if abcd is present in the databse
but abcd   is stored as abcd@MCKTESTAD.local
in database. I want to search the database exactly the row which contains
id@(abcd )  in the beginning and  assign that value to variable. How can I do that
Application ServersC#Microsoft SQL Server

Avatar of undefined
Last Comment
banu111

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Aneesh

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Anuradha Goli

To get data from SQL Server which matches string starts with ''id@(abcd )' is:

Declare @data nvarchar(50)
set @data = 'abcd@MCKTESTAD.local'
SELECT * FROM TableA WHERE COLUMN1 LIKE 'id@(abcd )%'

Open in new window

Aneesh

You should probably change your Grading strategy. I hope i gave you the perfect answer.
banu111

ASKER
but if have two users abcd@MCKTESTAD.local and abcd@MCKTESTAD.local will it wrk
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
banu111

ASKER
sry abcd1@MCKTESTAD.local