Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
veronika.np
Starting Member
29 Posts |
Posted - 2011-07-11 : 12:16:03
|
hi friends, i have two column name and family.i want to have some spaces between name and family .how can i do this.i want to like thisname family |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-07-11 : 12:20:36
|
Assuming name and family are character type columnsselect name + ' ' + family as NameAndFamilyfrom YourTable |
 |
|
veronika.np
Starting Member
29 Posts |
Posted - 2011-07-11 : 13:04:09
|
quote: Originally posted by sunitabeck Assuming name and family are character type columnsselect name + ' ' + family as NameAndFamilyfrom YourTable
no,i want to have some spaces like thisname family |
 |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-07-11 : 14:28:31
|
May be I am not following the exact thing you are trying to do. If you want more spaces, you can insert more spaces into the query:select name + ' ' + family as NameAndFamilyfrom YourTable But I suspect that is not what you are looking for. In most cases, if you are doing this for display purposes, it is easier and better to do it in the code that displays the data. Nonetheless, can you explain once more what you are after? |
 |
|
veronika.np
Starting Member
29 Posts |
Posted - 2011-07-12 : 10:35:41
|
quote: Originally posted by sunitabeck May be I am not following the exact thing you are trying to do. If you want more spaces, you can insert more spaces into the query:select name + ' ' + family as NameAndFamilyfrom YourTable But I suspect that is not what you are looking for. In most cases, if you are doing this for display purposes, it is easier and better to do it in the code that displays the data. Nonetheless, can you explain once more what you are after?
i write select name+space(10)+family from mytablein sql space show but in asp.net doesn,t show space. |
 |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2011-07-13 : 09:19:02
|
If you are using ASP.NET, then add the spaces THERE, not in SQL Server.http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-07-13 : 09:40:13
|
In ASP... or HTML rather... you'll need to add to represent each space.Corey I Has Returned!! |
 |
|
|
|
|
|
|