Viewing 15 posts - 31 through 45 (of 48 total)
Solved!
The trick is generate % with char function: 😀
PROCEDURE search(@name nvarchar(20)=null)
select * from TableName
where FirstName like N'' + char(37) + @name + char(37) + ''
note: char(37) = %
August 5, 2013 at 5:24 am
kapil_kk (8/5/2013)
Then change the datatype VARCHAR to NVARCHAR
I changed my datatype from VARCHAR To NVARCHAR
But N character is critical in none English statements.
I need a query to generate this:
N'%?????%'
Your query...
August 5, 2013 at 4:50 am
Thank you very much but 'N' character in condition is critical because i search none English.
I need something like:
DECLARE @name VARCHAR(20) = '?????'
SELECT * FROM Person.Person WHERE LastName LIKE N'%'+@name+'%'
Result...
August 5, 2013 at 4:24 am
Alan.B (7/9/2013)
July 9, 2013 at 9:32 am
Thanks Jeff Moden, I'm your fan in this forum.
By the way, what you've posted isn't a stored procedure. It's just a script
You wrote this Stored Procedure in one of your...
July 5, 2013 at 8:09 pm
Thank you very much.
I changed my Stored Procedure to this:
DECLARE @MyString NVARCHAR(3);
SELECT CASE
WHEN 1 = 1
...
July 5, 2013 at 9:29 am
Thank you every one.
@HanShi
If you put a double # sign in front of the table name, the table will also be created in [tempdb] database and is called a global...
July 5, 2013 at 8:02 am
Thank you everyone.
This article helped me to understand concept of Indexes.
https://www.simple-talk.com/sql/learn-sql-server/sql-server-index-basics/%5B/url%5D
For a further step I must use them in practice.
Now I see in this forum there are really professional guys...
July 3, 2013 at 11:59 pm
Sorry for replying after so long, but I found an easy solution for this and I liked to share it here, perhaps it help someone in future.
DECLARE @factorial int
SET @factorial...
July 3, 2013 at 2:30 am
GilaMonster (5/6/2013)
INSERT INTO TableName (ID,Value)
SELECT coalesce(MAX(ID),0) + 1, 'something' FROM TableName;
Thank you, hence this statement is not allowed:
INSERT INTO TableName (Value1,value2)
values(
select value1 from table1,
select value2 from table2
)
Instead you must join...
May 6, 2013 at 3:36 am
Well, found a solution
Declare @i int;
Select @i = coalesce(MAX(ID),0) + 1 FROM TableName;
INSERT INTO TableName (ID,Value)
VALUES (@i, 'something')
If you think there would be any better way to do this please...
May 6, 2013 at 2:27 am
Thank you Horatiu, mickyT, Erin Ramsay for your time and help.
May you help me to trace your code on paper please?
Im a newbie and im not sure how does it...
March 19, 2013 at 1:02 am
GilaMonster (2/5/2013)
SELECT q1, q2 FROM
(SELECT Count(a.PK) as q1 FROM Table1 as a) t1,
(SELECT Count(b.PK) as q2 FROM Table2 as b)...
February 5, 2013 at 1:04 pm
Thank you very much.
I couldn't find thanks button any where.
I'm really really thank you. It worked perfectly.
It solved my problem but I want to learn how does it works.
I will...
January 9, 2013 at 4:55 am
Viewing 15 posts - 31 through 45 (of 48 total)