TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rajesh S
NA
110
39.9k
Assign Tab delimite to variable in sql
Mar 3 2011 5:14 AM
Hi friends
Now we look into how tab delimit assign to variable in sqlserver.
Declare @tab char(1)
set @tab=char(9)
or
Declare @tab nchar(1)
set @tab=nchar(9)
now you can check tab space using @tab variable for example
declare @str varchar(50)
set @str=
'hai how are you'
declare @tab char(9)
declare @len int
set @tab=char(9)
set @len=len(@str)
if ((@len-len(replace(@str,@tab,'')))>0)
begin
print 'Tab delimit is there'
end
else
begin
print 'Tab delimit is not there'
end
here the variable @str has string of 'hai how are you' from this find whether the tab delimit is there or not, in above query if condition is checking whether tab delimit is there are not. so if it is tab delimit it will show the message as Tab delimit is ther or else Tab delimit is not there.
Reply
Answers (
2
)
Problems loading data from Access Database only if using VS 2010 and Rights Issues
Multible cases