Funny Characters And Repeating Digits

Jan 17, 2003

How do l filter out funny characters in a field like (',','@','#','"'.'/')etc And Repeating digits Like 5555555,2222,111111,00,
000000000.

Tried using the patindex but my method is too long.How do l do that ?

View 3 Replies


ADVERTISEMENT

Query Return Funny Characters

Apr 18, 2006

I run a query in QA which return funny characters (suppose to be chinese characters). I try saved as CSV and open in excel, still it remain as those funny characters... What can I do to get those output into the chinese character. It doesn't need to be in QA... but I need it in Excel.
Thanks

View 2 Replies View Related

Tech's Are So Funny

Aug 16, 2004

Ok a network tech put an executive assistants database on sql with the upsize wizard in access. Only problem is that she cant input anything into the database, my guess is that its due to no Primary key in the new sql table. I have had this problem before am I correct in my assumptions???

View 6 Replies View Related

Funny Search Error

Oct 28, 2004

I have two fields I am searching on .... address and zipCode

When I have both pieces of data, everything is fine, i get back the expected results, but i am unable able to search on the individual pieces. Here is the SQL I am using. It's placed within a store procedure in Sqlserver that I amreferencing from my VB.net code.... any help??


IF ((NOT @address IS NULL) AND( NOT @zipCode IS NULL))
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @address AND ShpAddr_ZipCode = @zipCode
END

ELSE IF NOT @address IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @address
END

ELSE IF NOT @zipCode IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_ZipCode = @zipCode
END


any help would be great. thanks

View 3 Replies View Related

Funny Network Behaviour

Jul 20, 2005

Hi,In order to establish a security enhanced SQL server setup, I triedto switch off network access by disabling all networking protocols,so that the server can only be reached through a pipe. Neverthelessthe server was visible in the network and could be accessed fromall clients. Does anybody know what is going on here?Georg

View 1 Replies View Related

Weird And Funny Question

Sep 22, 2006

I specified configuration like shown below

"select * from table where id<>***" always doesn't work

however i changed that like

"id != ***" working!

Who can tell me why?

View 3 Replies View Related

Funny Problem (bug?) Using MAX() On SQL Mobile

Feb 8, 2006

This sure looks like a bug, but I'm still new...

First I create a simple database:

SqlCeEngine eng = new SqlCeEngine(@"Data Source=My Documents est.sdf");
eng.CreateDatabase();
eng.Dispose();

Then I put something in it:

SqlCeConnection conn = new SqlCeConnection(@"Data Source=My Documents est.sdf");
SqlCeCommand cmd = new SqlCeCommand("CREATE TABLE myTable (ID int, name nchar(10))");
cmd.Connection=conn;
conn.Open();
cmd.ExecuteNonQuery();
cmd.CommandText="INSERT INTO myTable (ID, name) VALUES (1,'bill')";
cmd.ExecuteNonQuery();

Then I try to get the maximum value from the first column.

cmd.CommandText = "SELECT max(ID) FROM myTable";
int index = (int)cmd.ExecuteScalar();

At this point I get an InvalidCastException raised. Using the datareader to extract the value produces the same exception, however I can go through the Query Analyzer on the device and execute the query and it comes out fine...???

This has really got me confused. Any thoughts?

View 8 Replies View Related

Funny Error During Runs

Jan 26, 2007

Can any one please help explain why this error has happened, it is not a normal error of SSIS,

"SSIS Debug host has encountered a problem and needs to close. We are sorry for the inconvenience"

It has 2 buttons Debug and Close, this error happened in the middle of a script task.

View 1 Replies View Related

Purchase Order Query: Very Funny And Challenge ^_^

Mar 1, 2006

i query a purchase order table, there is one column called PO_No, format: LP-0245111-0004
i make following statement to query: the middle code act as my id, using it search my records, the last 4 digit used to find the last purchase order number
SqlSelectCommand2.CommandText = "SELECT PO_No FROM [PURCHASE ORDER] WHERE PO_No Like '%" & GetYearCode() & "%' ORDER BY Right(PO_No, 4) DESC"
i checked my database, last record is LP-0545381-0300
in my debuging process, surprisingly found that selected record is LP-0545381-301   !
any one hav any suggestion? ^_^

View 2 Replies View Related

Funny SQL Server Error Messages - Anyone Has An Explanation?

Apr 3, 2006

I am getting a new server online at a customer, and our system shows very funny erorrs under full load. No explanations could be found. Anyone has some?
Here we go:
Server failed to resume the transaction, desc: 360000054a. The transaction active in this session has been committed or aborted by another session.,
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
and
New request is not allowed to start because it should come with valid transaction descriptor.
System.Data.SqlClient.SqlException
I am a little lost on those. Simple fact is that I do not find any description of those. Anyone an idea what causes these?

View 2 Replies View Related

How Can I Store Over 16000 Characters To Sql Table Field With Language Specific Characters?

Feb 19, 2008

In my application I must store over 16000 character in a sql table field . When I split into more than 1 field it gives "unclosed quotation mark" message.
How can I store over 16000 characters to sql table field (only one field) with language specific characters?
 
Thanks
 
 

View 3 Replies View Related

Reg Exp For Digits

Sep 18, 2005

Hi,This is not SQL Server database problem, however, net search has failedto generate a solution to the problem, I'm trying my luck at this NGnow.Problem, remove the special character, [ from text.e.g. text ="this is [1] and [stuff] and some [2] and hat [3] and dog"Desired result ="this is 1 and [stuff] and some 2 and hat 3 and dog"I know [[:digit:]] would find all the instances of digits insidebrackets such as [1], [2], [3]. However, I don't know how to get ridof the special characters of [ and ].Any regular expression expert out there?Thanks.Don

View 8 Replies View Related

I Need 2 Decimal Digits

Apr 14, 2008

Hello All,

Current Format :-
40.349.462.875.589.2100112127


Required Format
40.3049.4062.8075.5089.20100.00112.00127.00


Currently mine above row data type is float. i need two points after precisions.

Thanks

View 3 Replies View Related

Right 10 Digits From Column

Oct 7, 2014

Following function in not giving me correct output:

update dbo.raw
set PhnNumber = RIGHT(calling_pty,10)

What I want is....if in case column "calling_pty" i have values like 911111111111 so it should give me the output in column "PhnNumber" as 1111111111 means only right 10

View 3 Replies View Related

Smallmoney With 2 Digits

Jan 2, 2008

I have a table for products and the price field is smallmoney data type. When I view the data stored it shows it with millionths. How do I get it to store only hundredths?

View 2 Replies View Related

Add Digits To The Front

Jul 20, 2005

Hi all,I have a number like so 778625 and want to make this a more meaningfuldate (UK) so how difficult is it to add two digits in this case 19 tothe front of this number?Many thanksSam*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 3 Replies View Related

Splitting Digits And Alphabets..

May 14, 2008

is there any builtin functions or any other ways to split digit and numbers in sql server2005.
   for example in  Patel1234 , i am want to split patel and 1234 seperately.
                                    thanks,

View 5 Replies View Related

Decimal Rounding To 2 Digits

Feb 16, 2012

This give me 6 digits to the right of the decimal point - can round it to 2???

CONVERT (decimal(18 , 2), 1.0 * NULLIF (vVotesR, 0) / NULLIF (vVotesR + vVotesD, 0) * 100)

View 3 Replies View Related

Find Value 9 Digits In Length

Apr 17, 2008

Just looking for some guidance on how to find a value thats 9 digits in length

View 2 Replies View Related

How To Find Records Containing Only Digits?

Mar 12, 2008

Hello,

I would like to find all the records that contain only digits. So far, I have this:


SELECT *
FROM tmp1
WHERE (word LIKE N'[0-9]')


It returns only ten results, each containing a single digit. What I need is to find all the records of any length containing only digits, like '378', '2005', etc. but not records containing both digits and other stuff (e.g. letters) like 'I95' or 'P2P'.

Any idea?

Cornelius

View 7 Replies View Related

Random Number-9 Digits Only

Mar 25, 2008

Hi,

I need to generate random numbers that will always contain 9 digits.
How can I do that?
Thanks

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.

View 1 Replies View Related

Separate Lowercase Characters From Uppercase Characters

Mar 5, 2008


Hi everybody,
I would like to know if there is any property in sql2000 database to separate lowercase characters from uppercase characters. I mean not to take the values €˜child€™ and €˜Child€™ as to be the same. We are transferring our ingres database into sqlserver. In ingres we have these values but we consider them as different values. Can we have it in sqlserver too?

Hellen

View 1 Replies View Related

Removing Non-numeric Digits From Column

Jun 14, 2002

Using the following:

select hl, substring(hl,1,patindex('%/%',hl)) as test
from appointment

returns

hl test
A PCM/RODRIGUEZ A PCM/
Y OPTOMETRY/VISUAL FIELD TESTSY OPTOMETRY/
W DENTAL/DUNDON W DENTAL/
Y LAB
Y PCM/NEMES F/U Y PCM/
W NUTRITION/FIRM-A (ROOM E116)W NUTRITION/
W FIRM-A/SILVER/ABBOUD IIW FIRM-A/

I want to be able to remove the first 2 digits and the / to just have the clinic only remaining. Note that Y LAB is not listed in the test column..why? Any help is greatly apprecitated. Thank you....

View 4 Replies View Related

SQL 2012 :: Select Column Where Only 4 Digits In The Raw

Jun 25, 2015

How can I do this in TSQL, there are alot of wild chars but I could not find how to count them, in case below I only want id =1 and 2

this sql is not correct yet...

DECLARE
@a VARCHAR(22) = ' alpha1234 qwerew', @b VARCHAR(22) = '3456_Bravo', @c VARCHAR(22) = ' only_three123_Delta'
--SELECT 1 id, @a c UNION select 2 id, @b c UNION SELECT 3 id, @c c
SELECT * FROM
(SELECT 1 id, @a c UNION select 2 id, @b c UNION SELECT 3 id, @c c) b
WHERE c LIKE '%[1_3]%'

View 3 Replies View Related

Count Number Of Digits In Text

Jul 20, 2006

Hi guys,

I'm trying to write a producure to count the number of digits in a text.

i.e :
text
---------
12 fff 3 a.z
12345 ggg6gg a
123

Result:
--------
3
6
3

It seems to be real easy via RegEx in C# , but i cant figure it out in SQL.

Thank YOU!

View 11 Replies View Related

Adding The Cubes Of A Strring Of Digits

May 9, 2007

I need to take a numeric value and add together the cubes of each single digit. The string length may vary from row to row.

As as example the number 1234 has individual cube values of 1 (1 cubed), 8 (2 cubed), 27 (3 cubed) and 64 (4 cubed). The resulting sum of the cubes is then 1+8+27+64 = 100. The same result would occur for 1243.

The purpose is to look for numeric values in a table where the same digits occur in two different rows but in a different order.

How can I create a function to apply to a varchar column to produce my integer result ?

View 13 Replies View Related

Convert Time To Include 2 Digits

Mar 29, 2008

Hi,

I want to convert time 2:8:6 to 02:08:06 in the easiest possible way. How to do it without using Left() or Right()

thanks.

View 2 Replies View Related

Appending 2 Digits Infront Of A Column

Apr 17, 2008

I have a simple select statement. What I need is to append a 2 digit number infront of the relationship_type_id.


select distinct



customer_id,
acct_id,

parent_flag,

relationship_type_id

from customer_account sca


inner join account act


on sca.acct_id = act.account_number








the logic is that

If primary flag = 0 then 1st two digit of relationship_type_id = 10
else 1st two digit of relationship_type_id = 00

For Example:

Primary Flag Relationship_type_id After appending





Relationship_type_id


1 5 005
1 3 003
0 3 10
1 5 005
0 3 103



Can anyone help me with that?

Thanks

View 8 Replies View Related

Move Data Basedn On X Amt Of Digits In Column

Nov 8, 2005

I am looking for a solution to move all Part Numbers for a specific manufacturer that is 9 digits long to a new column.

Let me explain............

I have a product table that has three columns of product codes associated with that product (Part Number as PN, Series as Series, and Industry Code as ICDE). I now want to create a fourth column (Manufacturer Code as MCDE) as my database has grown for another product specific numerical designator that is specific for one manufacturer.

Currently I have the specific 9 digit codes in the same column as the Part Numbers, though they all have their specific rows (Part Numbers & Manufacturer Codes are not in the same cell).

Now the Part Numbers have various numbers, letters, and special characters, but the specific 9 digit manufacturer codes are pure numbers.

So my question is............

How does one go about moving these specific 9 digit codes to their new column and out of the Part Number column?

They will all be exactly 9 digits, no special characters, no letters, no spaces.

Is there a way to tell MS SQL to just move anything for that specific manufacturer that has the 9 digit manufacturer numbers to the new column, bypassing anything with letters, special characters or any part number that is not a pure 9 digit number?

View 2 Replies View Related

Patindex To Find Special Character And Next 6 Digits

Dec 6, 2007

I am creating a view to pull data for a UPS integration I am doing. I currently have this view where I pull my data from. All is well accept for my PATINDEX,

Currently I have this PATINDEX So when a user puts this into delivery instructions "#999999" UPS_FINAL returns 999999 which is good for me to use. But The PATINDEX will also grab all kinds of neat stuff out of the delivery instructions field when I really only want whatever is after the # sign in the field.

I am new to sql and dont quite understand how this search is working but I think I am in need of a better way to search the field



Code:


WHEN SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions, PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) IS NULL

THEN dbo.Address_Table.ups_code

ELSE SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) END AS UPS_FINAL


-------------------------------------------------------------------------------------
What I am looking to accomplish is a SUBSTRING that will search delivery_instructions



Code:


SELECT

TOP (100) PERCENT P21PLAY.dbo.p21_view_oe_pick_ticket.pick_ticket_no,
P21PLAY.dbo.p21_view_oe_hdr.order_no, P21PLAY.dbo.p21_view_oe_hdr.customer_id,
P21PLAY.dbo.p21_view_oe_hdr.ship2_name, P21PLAY.dbo.p21_view_oe_hdr.ship2_add1,
P21PLAY.dbo.p21_view_oe_hdr.ship2_add2,
P21PLAY.dbo.p21_view_oe_hdr.ship2_city,
P21PLAY.dbo.p21_view_oe_hdr.ship2_state,
P21PLAY.dbo.p21_view_oe_hdr.ship2_zip,
P21PLAY.dbo.p21_view_oe_hdr.po_no,
P21PLAY.dbo.p21_view_oe_pick_ticket.carrier_id AS Carrier,
P21PLAY.dbo.p21_view_oe_pick_ticket.carrier_id AS Supplier,

P21PLAY.dbo.p21_view_oe_hdr.cod_flag,
P21PLAY.dbo.p21_view_oe_hdr.terms,
P21PLAY.dbo.p21_view_oe_hdr.ship2_country,
P21PLAY.dbo.p21_view_oe_hdr.ship_to_phone,
P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
dbo.Address_Table.ups_code,

-----------Looks for special character and returns next 6 spaces as UPS_Shipper----------

SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions, PATINDEX('%[^a-z ]%',

P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6)
AS UPS_Shipper,

------------------Checks view for email address or assigns alternate------------------
(CASE WHEN charindex('@', p21_view_contacts.email_address) > 0 THEN p21_view_contacts.email_address ELSE

'email@domain.com' END) AS alternate_address,

'Y' AS QVN, 'email@domain.com' AS failureaddress,

P21PLAY.dbo.p21_view_contacts.email_address,

------------When carrier_id is not one of these # then Null; else ------------------------------

CASE WHEN P21PLAY.dbo.p21_view_oe_pick_ticket.carrier_id NOT IN (105188, 105191, 105194, 105197, 105200,

105203, 105206, 105209, 105212) THEN NULL

----------------- Looks for special Character in delivery_instructions; if NULL then ups_code;
ELSE return value from delivery_instructions as UPS_Final--------------------

WHEN SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) IS NULL
THEN dbo.Address_Table.ups_code
ELSE SUBSTRING(P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions,
PATINDEX('%[^a-z ]%', P21PLAY.dbo.p21_view_oe_hdr.delivery_instructions) + 1, 6) END AS UPS_FINAL


FROM dbo.Address_Table INNER JOIN
P21PLAY.dbo.p21_view_oe_pick_ticket INNER JOIN
P21PLAY.dbo.p21_view_oe_hdr ON P21PLAY.dbo.p21_view_oe_pick_ticket.order_no =

P21PLAY.dbo.p21_view_oe_hdr.order_no ON
dbo.Address_Table.id = P21PLAY.dbo.p21_view_oe_hdr.customer_id LEFT OUTER JOIN
P21PLAY.dbo.p21_view_contacts ON P21PLAY.dbo.p21_view_oe_hdr.contact_id = P21PLAY.dbo.p21_view_contacts.id

WHERE
(P21PLAY.dbo.p21_view_oe_hdr.completed <> 'Y')
AND (P21PLAY.dbo.p21_view_oe_hdr.delete_flag <> 'Y')
AND (P21PLAY.dbo.p21_view_oe_hdr.will_call <> 'Y')
ORDER BY P21PLAY.dbo.p21_view_oe_pick_ticket.pick_ticket_no



Hope this makes since

View 4 Replies View Related

SQL 2012 :: Remove Digits From Fields Of Table

Apr 3, 2014

I have table like

name
22rajuvar
45 vamsgui
87 praveen
67kumar
32 vamshi

Above field mix with digits and character. I want to remove digits. I want o/p like ............

name
rajuvar
vamsgui
praveen
kumar
vamshi

View 8 Replies View Related

T-SQL (SS2K8) :: Arithmetic Formula To Stuff Digits

Apr 6, 2015

I have a column which needs to be 9 digits long. The first four digits are independent from the other digits. The following digits need to be 5 and I have to add leading zeros if they're less than 5. This is an awful design and I'd love to change it but I can't.

SELECT Cg.Fiid,
--Original Formula
SUBSTRING( CONVERT( varchar, Cg.Fiid ),1, 4 ) + RIGHT( '00000' + SUBSTRING( CONVERT(varchar, Cg.Fiid ), 5, 10 ), 5 ),
--My solution
STUFF(Cg.Fiid, 5, 0, REPLICATE('0', 9 - LEN(Cg.Fiid)))
FROM (VALUES(71927),
(498932),
(498934),
(38061278))Cg(Fiid)

View 9 Replies View Related

Wants To Increase Digits Of Numeric Data Type.

Sep 20, 2007



Hi! Every one,
I need to increase my numeric digit in a table.previous column name was "Amount",Precision=18 and scale=6, when I increase Precision=28 it show "Airthmatec Error",
even when increase precision in a new table it work properly.








Thanks.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved