I'm using replace in a stored procedure to eliminate carriage returns
a user might have entered in an Access field.
The problem is that even though it seems to strip out the carriage
return I can't get rid of the "□" character.
This is my code:
DECLARE @myReturn nvarchar(1)
SELECT @myReturn = NCHAR(10)
REPLACE(UserAddress,@myReturn,' ') AS myTEXT
For example, the user has entered:
123 Oak Street
Suite 101
What I get after running the replace is: 123 Oak Street □ Suite
101
lq 2 11442
Lauren Quantrell (la*************@hotmail.com) writes: I'm using replace in a stored procedure to eliminate carriage returns a user might have entered in an Access field. The problem is that even though it seems to strip out the carriage return I can't get rid of the "□" character.
This is my code:
DECLARE @myReturn nvarchar(1) SELECT @myReturn = NCHAR(10)
REPLACE(UserAddress,@myReturn,' ') AS myTEXT
For example, the user has entered:
123 Oak Street Suite 101
What I get after running the replace is: 123 Oak Street □ Suite 101
Not really sure what the problem is, but to get rid of CR, pass nchar(13)
as the second argument to replace(), and to get rid of □ pass
nchar(9633):
declare @x nvarchar(200),
@y nvarchar(200)
select @x = 'This is text with char 9633 (' + nchar(9633) +
') and a CR (' + nchar(13) + ')in it.'
select @y = replace(@x, nchar(13), '/')
select @y = replace(@y, nchar(9633), '/')
select @x
select @y
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
Erland,
Thanks for your response. If I remove only NCHAR(10) or only NCHAR(13)
I still get the character □ (which is a small square box.) But
thanks to your pointing out NCHAR(13) I am now using the following and
it works to remove both the return and the square box character:
REPLACE(REPLACE(UserAddress,NCHAR(13),''),NCHAR(10 ),'')
Thanks!
lq
Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>... Lauren Quantrell (la*************@hotmail.com) writes: I'm using replace in a stored procedure to eliminate carriage returns a user might have entered in an Access field. The problem is that even though it seems to strip out the carriage return I can't get rid of the "□" character.
This is my code:
DECLARE @myReturn nvarchar(1) SELECT @myReturn = NCHAR(10)
REPLACE(UserAddress,@myReturn,' ') AS myTEXT
For example, the user has entered:
123 Oak Street Suite 101
What I get after running the replace is: 123 Oak Street □ Suite 101
Not really sure what the problem is, but to get rid of CR, pass nchar(13) as the second argument to replace(), and to get rid of □ pass nchar(9633):
declare @x nvarchar(200), @y nvarchar(200) select @x = 'This is text with char 9633 (' + nchar(9633) + ') and a CR (' + nchar(13) + ')in it.' select @y = replace(@x, nchar(13), '/') select @y = replace(@y, nchar(9633), '/') select @x select @y This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: vaishaliekhar |
last post by:
Hello,
I have created a stored procedure using SPUFI. The stored procedure is
defined to execute an external Assembler routine. There was no error
while creating the stored procedure.
While calling the stored procedure from a Java program I am getting the
following error:
Exception: java.sql.SQLException: SQL0444N
|
by: Aragorn |
last post by:
I want to load into a SqlCommand objet an existing stored
procedure. I know that by using the Parameters collection
I can add parameters, but how can I retrieve the
parameters already defined from the SP? I would like by a
reflection-like mechanisms be able to get the parameters
declared into the SP.
Strangely, if you're using the Server...
|
by: icebrrrg |
last post by:
Hi. I have some functionality in a C# DLL that I would like to be able
to call from inside SQLServer. I know this was possible in C++, using
an Extended Stored Procedure, but I haven't been able to find a similar
process for C#. Does anyone know if such an animal exists?
I believe I could call the C# routines from within a C++ extended...
|
by: Ing. Rajesh Kumar |
last post by:
Hi everybody
I have a DECIMAL column with scale = 2. When I insert data into this column from a web page using Stored procedure, the data is rounded up. but when I use a query instead, then things are OK.
For example :
I want to insert : 24.60
With SP it insert 25
With direct Insert query it insert : 24.60
Why so with SP ?
Thanks
Raja
|
by: Scott |
last post by:
Front-end Access 2000
I have a stored procedure that has 2 parameters BusinessUnitID and
Year.
It returns multiple record sets (5 to be exact).
I thought I could use a Pass through query but that only returns the
first record set.
I thought I could use ADO but that does not seem to work. I get an
Error
| |
by: Karthik |
last post by:
I'm attempting to call a storedprocedure from within an ActiveX task in
a DTS and am getting a "Command Text was not set for the command
object" error. I have no problem if I replace the stored procedure call
with the actual SQL.
Is it possible to directly call a SP via an ActiveX task? If yes, could
somebody help me with the syntax please?...
|
by: satish mullapudi |
last post by:
Hi,
I am using DB2 v8.2 & jdk 1.4.
1. I have a java program which returns an array which contains 1 to 5
numbers.
The code:
public class ArrayTest
{
public static final int ARRAY_SIZE = 5;
public static int array()
{
|
by: Venkat |
last post by:
Hi,
Is there any way to give feedback to the application while a stored
procedure execution is in progress? I am using sql server and my application
is built using c#. The stored procedure tries to delete around 200K records
and there is no way to give the progress of the deletion to the user. Some
times i get time out error as it takes...
|
by: sunilkes |
last post by:
Hello
I am a newbie to this, so I would appreciate any help, I am struggling
to get this to work
CREATE PROCEDURE .
@strfinalint as varchar(1000),
@startdate as datetime
@enddate as datetime
|
by: Carlton Kirby |
last post by:
I need to execute a job on a SQL Express 2005 instance (no SQLAgent).
The job will be executed manually by a user, so it doesn't need to be
scheduled to run automatically. I thought I could execute the job
through a stored procedure, but it appears that SQL Agent is necessary
even for that.
The job was given to me by a software vendor to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |