.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Replace special character with space throughout the database

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :Sql Server


My requirement is to replace the special characters with space throughout the databse. How can I do this? I am new to this sql server. So any one could you please help me in this aspect.

Thanks in advance

View Complete Post

More Related Resource Links

Regular Expression to avoid space and special character



I would like to have an regular expression that does not allow any spaces(before,within,after the word) and alphanumeric characters.

Thanks in advance.



TextField control add extra character space at end of it



On one of my publishing page layout i have added Content Field (field of content type) that is

<SharePointWebControls:TextField FieldName="MyName" runat="server"></SharePointWebControls:TextField>
"MyName" is single line text column in the content type.

Then i edit the page which is using this page layout and add one text "Sandip" in that MyName field. Now problem is, this filed show the text on the page but at the end of it, it add space. i.e- "Sandip "

I m not getting why it is showing this.

Please help..!

Regards Sandip Patil Sharepoint Developer http://www.worldofsharepoint.com

Regular expression: Replace anything that isn't alphanumeric with a space?

Hi there,I'm writing a function in C# that will clean up a filename that a user might upload.One of the requirements is to replace any character that isn't alphanumeric with a space, but I can't seem to get the regular expression working to do so?I've include my code below, thanks for any help :)// Replace miscellaneous characters with a space inputFilenameRegex = new Regex(@"^[a-zA-Z0-9]"); inputFilename = inputFilenameRegex.Replace(inputFilename, " ");

problem to convert special character in export to csv

I am using FIleStream object to write .csv file from dataTable/Dataset.It is working fine. But when i got special character in my DataTable like $, @, # ect. it will convert these convert in encoded form( which can't be readable i.e.  â,¬ etc). FileStream flStream;astrFileName = HttpContext.Current.Server.MapPath("~/files/FtpFiles/Download/") + astrFileName + ".csv";if (File.Exists(astrFileName)){flStream = new FileStream(astrFileName, FileMode.Truncate, FileAccess.Write);}else{flStream = new FileStream(astrFileName, FileMode.Create, FileAccess.Write);}StreamWriter objSw = new StreamWriter(flStream);DataTable objDt = idtInstance;//Get No Of Column in GridView int NoOfColumn = objDt.Columns.Count;//Create Header for (int i = 0; i < NoOfColumn; i++){objSw.Write(objDt.Columns[i]);//check not last column if (i < NoOfColumn - 1){objSw.Write("||");}}objSw.Write(objSw.NewLine);//Create Data foreach (DataRow dr in objDt.Rows){//if (dr["GCMSCaseNumber"].ToString() == "14222")//{// string desc = dr["Updates"].ToString();//}for (int i = 0; i < NoOfColumn; i++){string sData = dr[i].ToString();sData = sData.Replace("<br>", " ");sData = sData.Replace("<br/>", " ");sData = sData.Replace("\n", " ");sData = sData.Replace("\t", "

How to prevent special character encoding when using xslt value in javascript variable

Hi, I've created a dataview and inserting a little bit of javascript. I need to store one of the xslt values into a javascript variable. The problem is that when I get the value into my javascript variable, it is already encoding special characters . for example, instead of "<", I get "&lt;" Am I doing something inaccurate here? I even tried using the javascript unescape() function, but that didn't work. would you be able to advise how to get the xslt value into a javascript variable as it is without having the original data changed? <xsl:template ... ... <SCRIPT type="text/javaScript"> <![CDATA[ ...     var myData = ']]><xsl:value-of select="@sampleData" disable-output-escaping="yes"/><![CDATA['  ;  ... ]]> </SCRIPT> Pman http://www.pmansLab.com/

special character wrongly inserted

I have a gridview with checkbox column.  I loop through all the rows of gridview, if it's checked I enter the second column text into my database.The second column text at one point shows the word  Küche, but when I take that text (in order to insert it in db) it gives me K&#252;cheand that's what I see when I then read it from db.

Space usage - Database


Hi Gurus,

My sql server 2005 instance has 83 databases. I would like to know how much space is being used by all the databases and top 5 list. Please let me know how to get this information.





Special Grouping - Database


I have this data:

LEADID  LeadDeliveryLogId LDPId DeliveryStatus DeliveryDate
252761357 9256770   6536 IN_DELIVERY     8/1/2010 2:45:28.157
252761357 9256771   6536 DELIVERED       8/1/2010 2:45:28.240
252761357 9256783   6536 IN_DELIVERY     8/1/2010 2:46:15.273
252761357 9256784   6536 DELIVERED       8/1/2010 2:46:15.350

I need to group it into IN_DELIVERY-DELIVERED match, one match for each, so that I can tell the time difference between when it is IN_DELIVERY and when it is DELIVERED, but I want to make sure that the first IN_DELIVERY only gets matched to the first DELIVERED based on the timeframe, and that it is not mixed up with the second DELIVERED. The result should be something like below (notice the first column):

GROUP  LEADID  LeadDeliveryLogId LDPId DeliveryStatus DeliveryDate
1          252761357 9256770   6536 IN_DELIVERY     8/1/2010 2:45:28.157
1          252761357 9256771   6536 DELIVERED &nbs

Do I need free space when doing full database restore in SQL Server 2005?


I have a drive 'F' with 40G free space. I try to restore a database whose data + log file size is 60G.

The restore fails. Is it because a full restore needs  free disk space of 60G in this case?


Best Method to remove special character from string

I am trying to remove the special characters from a string that was entered by the user.  I am not sure the best method to do this.  i can get a foreach of all the characters but what do i check it against?
Christian - developer

Replace space from string - REGEX.



I have some problem with RegEx.

I have text:

"something here [tagQuote=Name of Author]bla bla bla[/tagQuote] something here"

And now I want to replace all the whitespace character in quote attribute with "%#%#%#%".

So I want to have: [tagQuote=Name%#%#%#%of%#%#%#%Author]bla bla bla[/tagQuote]

So remove all of the whitespaces between "[tagQuote=" and "]...[/tagQuote]"

ReportExecutionService always printing an extra space after character 'w'

I am using ReportExecutionService to print SSRS report. For some odd reason it always prints an extra space after a character 'w'. I have adjusted the resolution to 300 and 600 dpi and that's not helping. Can anyone tell me how I can get this issue resolved?

Special Character Translation

I built a view in Designer that's pulling data from a list.  When I deployed the view to SharePoint, I discovered that special characters entered into the list don't display correctly.  For example, "-" is displayed as &#39.  Is there a solution for this translation issue?

How can I replace domain user accounts with a general database account?


How can I replace domain user accounts with a general database account?


How to write storeprocedure update special character in Sql server 2005


Hi All,

I am using Sql Server 2005,My table structure is below.

Create Table ComentTable(id int,coments varchar(4000))

insert into ComentTable values(1,'sanjay I don%27t Know Tamil Language')

insert into ComentTable values(1,'sanjay I don%27t Know Kanar Language')

how to write storeprocedure update coments column replace %27 to &#39;

How can I reclaimed Content Database space.

I recently deleted a very large amount on data from a site (~500 gigs).  Unfortunately the database still shows a size of 570 gigs to the operating system.  When I did a stsadm -o ENUMSITES -url thesite.  It shows onyl 112 gig of used storage space.  I have run the DefragIndices from this KB article http://support.microsoft.com/kb/943345.  What else can I do to reclaim this space.  We are extremely close to filling up this drive array.  Thanks.

Underscore replaces space character in report name when RDL downloaded for edit


Hi Folks,

When I download a report rdl for edit from Report Manager, if there is a space character in the name then its replaced by and underscore.

For eg., if my Report name is "Test Report.rdl", when I download the rdl it comes up as "Test_Report.rdl". I have noticed this happening just recently and didn't occur earlier.

How do I get SSRS to stop replacing the space character with "_" ?

Appreciate any assistance on this.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend