Wednesday, March 28, 2012
Remove Carriage Return
this way, in the SQL Statement, I add this script:
replace(t1.address, char(13), char(32))
However, it seems that it only remove the first carriage
return but not all. Is there any suggestion ?
Thanks
try removing the line feed character as well - char(10)
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"Peter" wrote:
> I attempt to replace the Carriage Return with Space. In
> this way, in the SQL Statement, I add this script:
> replace(t1.address, char(13), char(32))
> However, it seems that it only remove the first carriage
> return but not all. Is there any suggestion ?
> Thanks
>
|||Does it mean that I have to run like this
replace(replace(t1.address, char(13), char(32)), char(10),
char(32)) ?
Thanks
[vbcol=seagreen]
>--Original Message--
>try removing the line feed character as well - char(10)
>
>regards,
>Mark Baekdal
>http://www.dbghost.com
>http://www.innovartis.co.uk
>+44 (0)208 241 1762
>Database change management for SQL Server
>
>"Peter" wrote:
In[vbcol=seagreen]
carriage
>.
>
|||Have you tried
replace(t1.address, char(13)+char(10), char(32))
as Mark suggested? It works for me (see example below).
declare @.tmp varchar(100)
set @.tmp = 'line1
line2
line3
line4
line5'
select @.tmp
select replace(@.tmp, char(13)+char(10), char(32))
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Peter wrote:
[vbcol=seagreen]
>Does it mean that I have to run like this
>replace(replace(t1.address, char(13), char(32)), char(10),
>char(32)) ?
>Thanks
>
>In
>
>carriage
>
|||Thank you for your advice.
When I use char(13)+char(10), most of the problems are
fixed.
However, for unknown reason, there is record that works
fine with char(13) only becomes like this:
Aboukir Street
MONGKOK ABN 3355
Do you have any suggestion ?
Besides, when I use Notepad, is it possible for me to see
whether it is only CR or CRLF ?
Thanks
>--Original Message--
>Have you tried
> replace(t1.address, char(13)+char(10), char(32))
>as Mark suggested? It works for me (see example below).
>declare @.tmp varchar(100)
>set @.tmp = 'line1
>line2
>line3
>line4
>line5'
>select @.tmp
>select replace(@.tmp, char(13)+char(10), char(32))
>--
>*mike hodgson* |/ database administrator/ | mallesons
stephen jaques
>*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61
(408) 675 907
>*E* mailto:mike.hodgson@.mallesons.nospam.com |* W*
http://www.mallesons.com[vbcol=seagreen]
>
>Peter wrote:
(10),
>
Remove Carriage Return
this way, in the SQL Statement, I add this script:
replace(t1.address, char(13), char(32))
However, it seems that it only remove the first carriage
return but not all. Is there any suggestion ?
Thankstry removing the line feed character as well - char(10)
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"Peter" wrote:
> I attempt to replace the Carriage Return with Space. In
> this way, in the SQL Statement, I add this script:
> replace(t1.address, char(13), char(32))
> However, it seems that it only remove the first carriage
> return but not all. Is there any suggestion ?
> Thanks
>|||Does it mean that I have to run like this
replace(replace(t1.address, char(13), char(32)), char(10),
char(32)) ?
Thanks
>--Original Message--
>try removing the line feed character as well - char(10)
>
>regards,
>Mark Baekdal
>http://www.dbghost.com
>http://www.innovartis.co.uk
>+44 (0)208 241 1762
>Database change management for SQL Server
>
>"Peter" wrote:
>
In[vbcol=seagreen]
carriage[vbcol=seagreen]
>.
>|||Have you tried
replace(t1.address, char(13)+char(10), char(32))
as Mark suggested? It works for me (see example below).
declare @.tmp varchar(100)
set @.tmp = 'line1
line2
line3
line4
line5'
select @.tmp
select replace(@.tmp, char(13)+char(10), char(32))
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Peter wrote:
[vbcol=seagreen]
>Does it mean that I have to run like this
>replace(replace(t1.address, char(13), char(32)), char(10),
>char(32)) ?
>Thanks
>
>
>In
>
>carriage
>|||Thank you for your advice.
When I use char(13)+char(10), most of the problems are
fixed.
However, for unknown reason, there is record that works
fine with char(13) only becomes like this:
Aboukir Street
MONGKOK ABN 3355
Do you have any suggestion ?
Besides, when I use Notepad, is it possible for me to see
whether it is only CR or CRLF ?
Thanks
>--Original Message--
>Have you tried
> replace(t1.address, char(13)+char(10), char(32))
>as Mark suggested? It works for me (see example below).
>declare @.tmp varchar(100)
>set @.tmp = 'line1
>line2
>line3
>line4
>line5'
>select @.tmp
>select replace(@.tmp, char(13)+char(10), char(32))
>--
>*mike hodgson* |/ database administrator/ | mallesons
stephen jaques
>*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61
(408) 675 907
>*E* mailto:mike.hodgson@.mallesons.nospam.com |* W*
http://www.mallesons.com
>
>Peter wrote:
>
(10),[vbcol=seagreen]
>
Remove Carriage Return
this way, in the SQL Statement, I add this script:
replace(t1.address, char(13), char(32))
However, it seems that it only remove the first carriage
return but not all. Is there any suggestion ?
Thankstry removing the line feed character as well - char(10)
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"Peter" wrote:
> I attempt to replace the Carriage Return with Space. In
> this way, in the SQL Statement, I add this script:
> replace(t1.address, char(13), char(32))
> However, it seems that it only remove the first carriage
> return but not all. Is there any suggestion ?
> Thanks
>|||Does it mean that I have to run like this
replace(replace(t1.address, char(13), char(32)), char(10),
char(32)) ?
Thanks
>--Original Message--
>try removing the line feed character as well - char(10)
>
>regards,
>Mark Baekdal
>http://www.dbghost.com
>http://www.innovartis.co.uk
>+44 (0)208 241 1762
>Database change management for SQL Server
>
>"Peter" wrote:
>> I attempt to replace the Carriage Return with Space.
In
>> this way, in the SQL Statement, I add this script:
>> replace(t1.address, char(13), char(32))
>> However, it seems that it only remove the first
carriage
>> return but not all. Is there any suggestion ?
>> Thanks
>.
>|||This is a multi-part message in MIME format.
--060207020402090904070407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Have you tried
replace(t1.address, char(13)+char(10), char(32))
as Mark suggested? It works for me (see example below).
declare @.tmp varchar(100)
set @.tmp = 'line1
line2
line3
line4
line5'
select @.tmp
select replace(@.tmp, char(13)+char(10), char(32))
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Peter wrote:
>Does it mean that I have to run like this
>replace(replace(t1.address, char(13), char(32)), char(10),
>char(32)) ?
>Thanks
>
>>--Original Message--
>>try removing the line feed character as well - char(10)
>>
>>regards,
>>Mark Baekdal
>>http://www.dbghost.com
>>http://www.innovartis.co.uk
>>+44 (0)208 241 1762
>>Database change management for SQL Server
>>
>>"Peter" wrote:
>>
>>I attempt to replace the Carriage Return with Space.
>>
>In
>
>>this way, in the SQL Statement, I add this script:
>>replace(t1.address, char(13), char(32))
>>However, it seems that it only remove the first
>>
>carriage
>
>>return but not all. Is there any suggestion ?
>>Thanks
>>
>>.
>>
--060207020402090904070407
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Have you tried<br>
<br>
replace(t1.address, char(13)+char(10), char(32))<br>
<br>
as Mark suggested? It works for me (see example below).<br>
<br>
declare @.tmp varchar(100)<br>
set @.tmp = 'line1<br>
line2<br>
line3<br>
line4<br>
line5'<br>
<br>
select @.tmp<br>
select replace(@.tmp, char(13)+char(10), char(32))<br>
</tt>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
Peter wrote:
<blockquote cite="mid0ea101c518a6$4f165ab0$a401280a@.phx.gbl" type="cite">
<pre wrap="">Does it mean that I have to run like this
replace(replace(t1.address, char(13), char(32)), char(10),
char(32)) ?
Thanks
</pre>
<blockquote type="cite">
<pre wrap="">--Original Message--
try removing the line feed character as well - char(10)
regards,
Mark Baekdal
<a class="moz-txt-link-freetext" href="http://links.10026.com/?link=http://www.dbghost.com</a>">http://www.dbghost.com">http://www.dbghost.com</a>
<a class="moz-txt-link-freetext" href="http://links.10026.com/?link=http://www.innovartis.co.uk</a>">http://www.innovartis.co.uk">http://www.innovartis.co.uk</a>
+44 (0)208 241 1762
Database change management for SQL Server
"Peter" wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I attempt to replace the Carriage Return with Space.
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!-->In
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">this way, in the SQL Statement, I add this script:
replace(t1.address, char(13), char(32))
However, it seems that it only remove the first
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!-->carriage
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">return but not all. Is there any suggestion ?
Thanks
</pre>
</blockquote>
<pre wrap="">.
</pre>
</blockquote>
</blockquote>
</body>
</html>
--060207020402090904070407--|||Thank you for your advice.
When I use char(13)+char(10), most of the problems are
fixed.
However, for unknown reason, there is record that works
fine with char(13) only becomes like this:
Aboukir Street
MONGKOK ABN 3355
Do you have any suggestion ?
Besides, when I use Notepad, is it possible for me to see
whether it is only CR or CRLF ?
Thanks
>--Original Message--
>Have you tried
> replace(t1.address, char(13)+char(10), char(32))
>as Mark suggested? It works for me (see example below).
>declare @.tmp varchar(100)
>set @.tmp = 'line1
>line2
>line3
>line4
>line5'
>select @.tmp
>select replace(@.tmp, char(13)+char(10), char(32))
>--
>*mike hodgson* |/ database administrator/ | mallesons
stephen jaques
>*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61
(408) 675 907
>*E* mailto:mike.hodgson@.mallesons.nospam.com |* W*
http://www.mallesons.com
>
>Peter wrote:
>>Does it mean that I have to run like this
>>replace(replace(t1.address, char(13), char(32)), char
(10),
>>char(32)) ?
>>Thanks
>>
>>--Original Message--
>>try removing the line feed character as well - char(10)
>>
>>regards,
>>Mark Baekdal
>>http://www.dbghost.com
>>http://www.innovartis.co.uk
>>+44 (0)208 241 1762
>>Database change management for SQL Server
>>
>>"Peter" wrote:
>>
>>I attempt to replace the Carriage Return with Space.
>>
>>In
>>
>>this way, in the SQL Statement, I add this script:
>>replace(t1.address, char(13), char(32))
>>However, it seems that it only remove the first
>>
>>carriage
>>
>>return but not all. Is there any suggestion ?
>>Thanks
>>
>>.
>>
>sql
Friday, March 23, 2012
Remote-server registration
I am trying to replicate between two computers on the Internet (both XP).
Is this a futile attempt ... must the publisher be a "full" instance of SQL
server?
check out this link:
http://support.microsoft.com/default...;en-us;Q324992
MSDE 2000 can act as both a Publisher or Distributor, and a Subscriber, and it can replicate between MSDE versions and regular versions of SQL Server. Additionally, you cannot use it for transactional publication, but you can use it as a Publisher of snap
shot replication, and merge replication, and as a Subscriber to all three types of publications.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Robert A. DiFrancesco" wrote:
> Does MSDE support registering a (remote) sql-server.
> I am trying to replicate between two computers on the Internet (both XP).
> Is this a futile attempt ... must the publisher be a "full" instance of SQL
> server?
>
>
sql
Monday, February 20, 2012
Remote connection error - but everything installed locally?
I have a visual basic 2005 application where I am storing some data in a Sequel Server Database. It's my first attempt using SQL Server. It was developed on my machine and the database is on my local hard drive.
It was put onto an industrial PC and shipped last December (the vb app is an HMI).
Our service guy is installing the machine and asked for some changes to the VB screens. I ran my app (on my computer) and it crashed when I selected the screen where I use the db.
So I decided to look at the database using Visual Basic and I get the following error:
Microsoft Visual Basic 2005 Express Edition
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I then tried to create a new database via Visual Basic and get the same error. My boss has it installed on his machine. Same error there. These are both machines that had no problem back in December!
I also have a industrial PC on my desk to test my app and it STILL WORKS there. That one though is not connected to the internet and hasn't gotten any updates or changes or whatever since I last had it on in December. I don't know if it was a windows update or a network change? But as I said, I'm not connecting remotely - SQL Server and the db are on our local machines.
Interesting enough, if I go to the control panel | Administrative Tools | Services, SQL Server (SQLEXPRESS) is set to automatic and is NOT started. I attempt to start it and get an error
Services
Windows could not start the SQL Server (SQLEXPRESS) on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 3417.
I am lost.
Thanks in advance for any help!
The concensus seems to be that this is related to compressed folders. Check out the posting here to check out where I got this crazy idea and the solutions that worked for others. I would also suggest checking out the log as the error recommends if you haven't already. Often the log contains more information that the error message. (Other times, it doesn't.)
Mike
|||Thanks Mike!
There were several solutions listed at the link you provided. I tried in order:
1) compressed folder/files. I went to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data, right-clicked on each file. "Compress contents" was NOT checked. However I unchecked "ready to archive". I got a different error (instead of 26 it was 40) when I tried to create a new database.
2) I ran SQLdiag found in C:\Program Files\Microsoft SQL Server\90\Tools\Binn. It ran. There didn't seem to be a difference.
3) I right-clicked on SQLExpress in Services and changed the Log On to "Local System Account" with the box check. That did it for me.
Interesting enough, the industrial PC I have on my desk works and still has the Log On as "This Account" - but that's not connected to our server with any of our group policy stuff.
THANKS AGAIN Mike! I really appreciated your help.