Click here to Skip to main content
15,888,401 members
Home / Discussions / Database
   

Database

 
AnswerRe: Stored procedure query Pin
jschell24-Oct-11 8:44
jschell24-Oct-11 8:44 
QuestionRemove empty spaces in a String in TSQL Pin
Vimalsoft(Pty) Ltd20-Oct-11 2:08
professionalVimalsoft(Pty) Ltd20-Oct-11 2:08 
AnswerRe: Remove empty spaces in a String in TSQL Pin
Blue_Boy20-Oct-11 2:15
Blue_Boy20-Oct-11 2:15 
GeneralRe: Remove empty spaces in a String in TSQL Pin
Vimalsoft(Pty) Ltd20-Oct-11 2:36
professionalVimalsoft(Pty) Ltd20-Oct-11 2:36 
GeneralRe: Remove empty spaces in a String in TSQL Pin
Blue_Boy20-Oct-11 2:43
Blue_Boy20-Oct-11 2:43 
GeneralRe: Remove empty spaces in a String in TSQL Pin
PIEBALDconsult20-Oct-11 4:28
mvePIEBALDconsult20-Oct-11 4:28 
AnswerRe: Remove empty spaces in a String in TSQL Pin
PIEBALDconsult20-Oct-11 2:40
mvePIEBALDconsult20-Oct-11 2:40 
AnswerRe: Remove empty spaces in a String in TSQL Pin
RobLazarus31-Oct-11 21:29
RobLazarus31-Oct-11 21:29 
Here's a generic example:

SQL
create table t (s sysname)
insert into t select 'this     is the reason                         that I did this.               '

	-- convert tabs to spaces
	update	t set s = replace(s, '	',' ')
	where	charindex('	', s) > 0

	-- now do the work.
	while 1=1
	begin
		update t
		set		s = substring(s, 1, charindex('  ', s, 1)-1) + ' ' + ltrim(substring(s,charindex('  ', s, 1), 8000))
		where	charindex('  ', s, 1) > 0

		if @@rowcount = 0
			break
	end

	select	s
	from	t

QuestionHow Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright19-Oct-11 19:21
professionalRoger Wright19-Oct-11 19:21 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? PinPopular
Mycroft Holmes19-Oct-11 20:17
professionalMycroft Holmes19-Oct-11 20:17 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Chris Meech20-Oct-11 4:01
Chris Meech20-Oct-11 4:01 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 5:21
professionalRoger Wright20-Oct-11 5:21 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Chris C-B19-Oct-11 22:30
Chris C-B19-Oct-11 22:30 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 5:27
professionalRoger Wright20-Oct-11 5:27 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Chris C-B20-Oct-11 6:01
Chris C-B20-Oct-11 6:01 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Eddy Vluggen20-Oct-11 2:09
professionalEddy Vluggen20-Oct-11 2:09 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 5:28
professionalRoger Wright20-Oct-11 5:28 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Eddy Vluggen20-Oct-11 8:01
professionalEddy Vluggen20-Oct-11 8:01 
AnswerRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
jschell20-Oct-11 9:05
jschell20-Oct-11 9:05 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
Roger Wright20-Oct-11 10:25
professionalRoger Wright20-Oct-11 10:25 
GeneralRe: How Much Space Is Wasted In Unused Fields In SQL Server? Pin
jschell21-Oct-11 10:54
jschell21-Oct-11 10:54 
QuestionSQL Query Select Pin
reogeo200817-Oct-11 21:26
reogeo200817-Oct-11 21:26 
AnswerRe: SQL Query Select Pin
Blue_Boy17-Oct-11 22:34
Blue_Boy17-Oct-11 22:34 
GeneralRe: SQL Query Select Pin
AditSheth17-Oct-11 23:09
AditSheth17-Oct-11 23:09 
AnswerRe: SQL Query Select PinPopular
Mycroft Holmes17-Oct-11 22:53
professionalMycroft Holmes17-Oct-11 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.