Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Concatenation with char variable in SQL Server doesn't work?
Rahul Bansal
10y
792
1
Reply
For example:-
declare @a char(4)
set @a='ab'
set @a=@a+'c'
print @a
--it gives the output 'ab' but if declare the @a as varchar like
declare @a varchar(4)
set @a='ab'
set @a=@a+'c'
print @a
--then it gives the output 'abc'
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
SQL to JSON
simplify the query or give alternative to the query