Problem With Converting Symbol
Jun 23, 2008
hi..
sql statement
db.query(
INSERT INTO student(name, course, email) "+
"VALUES('" + name +"' , "+
"'" + course+"' , "+
"'" + email+"' ");
this sql statement doesn't content any error but if the sentences that want to insert into table contain symbol ' then it will process error when enter into table. ( data contain symbol ' can't insert into table).
May i know how to solve this problem.
i did refer to my friends they said need include java class, but they not sure what's the class that i need.
So i help i can get the help here.
Thank in advance
View 5 Replies
ADVERTISEMENT
Sep 21, 2007
Hi,
I am a bit confused on the many uses of the @ symbol, such as in assignments and in use by stored procedures. I am not quite clear on when it needs to be used and when it doesn't, what it means, etc. Could someone either point me to a good reference, or explain? (I have read several books on MS Sql server, but somehow missed this.) I use the symbol, but I don't understand when to use it and when not to, without referencing an example.
Thanks,
View 1 Replies
View Related
Apr 6, 2004
I have SQL Server 2000 SP3 and the default Code Page is:
I have a Table with a column of the type 'text'.
In this column sometimes it's necessary introduce the euro symbol (€). Now, when we write this symbol, after the SQL Server show it with a '?'.
I tried change the column collation to 'Latin1_General_CI_AI', ‘SQL_Latin1_General_CP1_CI_AI’ and ‘SQL_Latin1_General_CP850_CI_AI’ but there is the same problem.
Does any know what the cause off this problem is?
Thanks in advance!
View 2 Replies
View Related
Aug 30, 2013
SELECT ROW_NUMBER() OVER (ORDER BY BM.BILL_NUMBER_V) AS [SL_NO],PP.KID_ID_NO_V AS [KID_NO],(PP.FIRSTNAME_V + SPACE(1) + PP.LASTNAME_V)AS [PATIENT_NAME],
CONVERT(VARCHAR(10),PP.UPDATEDDATE_D,101)AS [VISIT_DATE],BM.BILL_NUMBER_V AS [BILL_NUMBER],CONVERT(VARCHAR(10),BM.BILL_DATE_D,101) AS [BILL_DATE],
ROUND(BM.BILL_AMOUNT_M,2) AS [BILL_AMOUNT],ROUND(BM.CONCESSION_AMOUNT_M,2) AS [CONCESSION_AMOUNT],ROUND(BM.TOTAL_AMOUNT_M,2) AS [TOTAL_AMOUNT],
[Code] .....
In the above query i want to concat symbol '%' for output of percentage column. How to do that?
Eg: PERCENTAGE
30.00%
50.00%
View 1 Replies
View Related
May 8, 2001
Dear experts,
I'm having a problem with the Euro symbol on my SQLServers which all have characterset 850 and Unicode collation 1033. As far as I can see charset 850 does not contain the € symbol, but if I run a query
DECLARE @nstring nchar(12)
SET @nstring = N'€'
SELECT UNICODE(@nstring), NCHAR(UNICODE(@nstring))
Result: 8364 €
So the Unicode character 8364 is the Euro symbol. My question now is how do I have to write a statement so that the € symbol is shown in the output.
I need to use something like the following:
Select 'Costs:'+ € + convert(money, table1.costs)
Result: € 123.00
I tried several options but never get the right output. Is there any way of doing it or do I have to change the characterset.
Markus
View 1 Replies
View Related
Oct 27, 1999
We are running SQL Version 7.0.
I recently set up a simple snapshot replication. After restarting enterprise manager a hand symbol showed up under the database barrel as if a share symbol.
Am I correct in assuming the symbol means replication. Is there a source that explains what the various symbols mean?
View 1 Replies
View Related
Jan 19, 2012
We are getting 67.2,62.4,81.9 these are percentages these are rounded values..so in my report I would like to add % symbol for them I have written expression like this
=left(Fields!Sales_Margin_TY____.Value,4) &
"%"
but I was getting 67.1Â in place of 67.2Â
I dont want to change the figures which is coming from source...
Just I want to add % for those values... how to do that ..
View 11 Replies
View Related
Aug 10, 2007
I am looking for a way to remove the printer symbol from the report manger because it dows not work on some client machines because they are locked down. For us it is completely sufficient to export to PDF.
Is there a setting or an entry in the web config or something else. A hint would be helpful
Thanks
HANNES
View 3 Replies
View Related
Oct 13, 2006
Hey everyone,
I'm working of a project that has each row of column data stored in this format: AAChieve Initiative - Business Development Consultant|Marketing|4F|210710
Is there a way I can break this rows apart with TSQL based of the | symbol? Thanks in advance!
View 5 Replies
View Related
Jun 12, 2015
I have such Function:
IF EXISTS (SELECT * FROM sys.objects WHERE name = 'TwoDigitsNumber' AND type = 'FN')
DROP FUNCTION MinimumOFThree;
GO
CREATE FUNCTION TwoDigitsNumber(@a int)
RETURNS nvarchar(20)
[Code] ....
The only first letter 'f', 's', 'e' is inserted in value instead 'first', 'second', 'equal'.
Why ? How can i insert whole string
View 9 Replies
View Related
Jun 9, 2006
Have an App using SQL CE 2.0.
If the App is open and the device is powered off and then back on; the following happens when an update of the data base is attempted:
1. Pocket PC 2003 €“ IPAQ No problem all is well.
2. WM 2005 €“ Dell No problem all is well
3. WM 2005 €“ Symbol MC70 SQL error 0x80004005.**
App is compiled under eVC 4.0
** Some results if App is compiled under VS2005
Is this:
a.) My problem ?
b.) WM 2005 problem ?
c.) Symbol problem ?
d.) SQLCE 2.0 problem?
Any input would be appreicated
Thanks
JEK
View 9 Replies
View Related
Oct 4, 2007
Hi,
I want to display data that is 10 as $10.00 or 10.1 as $10.10..
and i tried giving this expression
=IIf(Fields!Nav.Value = "n/a","n/a",(cstr(Format(Fields!Nav.Value,"C2"))))
But when i run the report its giving it as C2 and not $10.00 or whatever it should be.
any help will be appreciated.
Regards
Karen
View 3 Replies
View Related
Apr 9, 2008
Hai
I have amount field in my table as decimal. I need a query to display the amount with dollar or euro symbol based on country selection. The country also in same table.
For example If country is US then Amount $1200, If country is UK then Amount €1200.
Thanks in advance.
View 10 Replies
View Related
Oct 2, 2006
Hi
We are having problems getting Reporting Services 2005 to export to an ASCII CSV file and correctly produce a £(GBP sign).
I have changed my report server .config file to read:
<Extension Name="CSV1" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<OverrideNames>
<Name Language="en-UK">CSV - UTF-8</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<Encoding>UTF-8</Encoding>
</DeviceInfo>
</Configuration>
</Extension>
<Extension Name="CSV2" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<OverrideNames>
<Name Language="en-UK">CSV - UTF-7</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<Encoding>UTF-7</Encoding>
</DeviceInfo>
</Configuration>
</Extension>
<Extension Name="CSV3" Type="Microsoft.ReportingServices.Rendering.CsvRenderer.CsvReport,Microsoft.ReportingServices.CsvRendering">
<OverrideNames>
<Name Language="en-UK">CSV - ASCII</Name>
</OverrideNames>
<Configuration>
<DeviceInfo>
<Encoding>ASCII</Encoding>
</DeviceInfo>
</Configuration>
</Extension>
And so far so good I get the three options to export to,
If I Export using the ASCII Rendering my pound signs come out as question marks (?) and subsequently loads into Excel as a general data type and is not sum-able.
If I Export using UTF-8 Rendering my pound signs come out as a weird character followed by a pound sign, again opened in excel loads as a General data type and is not summable.
If I export using UNICODE rendering, by file sizes are doublesd as you would expect, and then when you open in excel it is all bunched up in column 1, both un-acceptable.
Interestingly enough If I take the UTF-8 file I have and convert it to ASCII using Ultraedit, notepad or wordpad, everything works fine, the £ is correctly encoded, Excel loads it OK and it is summable, result, but I can not use get my end users to perform this "kludge" for an export.
Any help would be appreciated
Thanks
Tim
View 5 Replies
View Related
Dec 24, 2005
the text file format use the length of character to define the field
for example,
0001130130HAUT BAGES AVEROUS 03
9 chars <0001130130> is a field
1 char <H> is a field
20 chars <AUT BAGES AVEROUS 03> is a field
one record by one record store in db
no space, no symbol, no line break between each record
----------------------------------------------------------
I try bcp method, but some error happens. Please give me suggestions. thx
I run the following code in query analyzer.
BULK INSERT Chain.dbo.POLL59
FROM 'D:POLL59.DWN'
WITH (FORMATFILE = 'D:cp.fmt')
?????
it shows the error
Server: Msg 4839, Level 16, State 1, Line 1
Cannot perform bulk insert. Invalid collation name for source column 4 in format file 'D:cp.fmt'.
***
For your information
data file
000000011301220051222000192000000000011301320051222000030000000000019067420051222000000001<there are many space >
bcp.fmt file <I use tab to separate and use ascii>
8.0
4
1 SQLCHAR 0 4 "" 1 PLUEVT ""
2 SQLCHAR 0 9 "" 2 PLUSKU ""
3 SQLCHAR 0 8 "" 3 PLUFRD ""
4 SQLCHAR 0 9 "" 4 PLUPRC ""
!!!!
I try to edit collation name in Chinese_Taiwan_Stroke_CI_AS or others, but the error also happens.
View 6 Replies
View Related
Jul 16, 2015
I would like to know how to split the phone number into two columns based on - symbol Dynamically.
for example
Phone Number
123-12323
1234-1222
so output should be
code number
123 12323
1234 1222
View 1 Replies
View Related
Jan 4, 2008
I'd like the state of the function bars to stay at whatever it was as the user moves from one report to the next rather than opening to full each time a new report is opened. Can this be done through a setting or programatically at teh report level? Is there a <default_toolbars_OpenState> tag or something?
Thanks in advance.
View 4 Replies
View Related
Oct 15, 2015
Is it possible to include a currency symbol in an amount-field in PowerPivot/Pivottable based on a Currency column in a table? Something as the same as with SSAS MD. And I don't want fixed values in my code.
View 3 Replies
View Related
Jun 2, 2007
Hi ,
I have a database with a table name called @budget_tot.
When I run a query in report designer --dataset, it throws an error thinking this is a variable rather
than a table.
Same query works without error in SQL 2005 query window.
example Query;
Select T1.U_Budget From [@budet_tot] T1
Sonny
View 3 Replies
View Related
Feb 12, 2014
I want to add $ symbol to column values and convert the column values to western number system
Column values
Dollar
4255
25454
467834
Expected Output:
$ 4,255
$ 25,454
$ 467,834
My Query:
select ID, MAX(Date) Date, SUM(Cost) Dollars, MAX(Funded) Funding from Application
COST is the int datatype and needs to be changed.
View 2 Replies
View Related
Nov 8, 2006
I have a select statement like this:
select IsVerified from AppForm
the IsVerified returns 'True' ...can I convert that value to 'Yes' by using some sort of function?
View 2 Replies
View Related
Jun 9, 2005
I have an anonymous PL/SQL block that I'd like to Convert into T-Sql and im completly stumped on 2 things:
What is the equvilent of a Cursor and how do I declare one?
How do I declare an anonymous block?
my code wrote:
Declare
-- Type Declarations
Type ct_UConstr_Cur is REF CURSOR;
v_Begin Integer := 0;
v_End Integer := 0;
v_PageSize Integer :=0;
c_Data ct_UConstr_Cur;
Begin
v_PageSize := :PageSize;
v_Begin := ( v_PageSize * :PageNumber) - 1;
v_End := v_Begin + v_PageSize;
Open c_Data For
Select * from (
Select A, B, C, ROWNUM as RN from Foo;
) where RN >= v_Begin AND RN < v_End;
:cur := c_Data;
END;
/
View 2 Replies
View Related
Sep 15, 1999
Does any one know of a tool SQL 7 has for doing this kind of conversion?
View 2 Replies
View Related
Jun 29, 2007
ok i am very very new at this, ive downloaded the SQL 2005 trial and i can not seem to figure this out. I have a .xls i want to make a active sql page out of. please please help me with this
the .xls is here http://www.mediafire.com/?5jtgzcxb232
feel free to email me @
bevanglynn@gmail.com
thanks
View 1 Replies
View Related
May 25, 2007
Hi there,
Here at my work(in Germany) i have a big problem:
Once a week there is a sqlscript, which should run and store data to a txt file.
There is a tablle in which imagedata is stored in RAW format(that one with small boxes, Qmarks and dots...).
Now i want to export it to the txtfile as HEX, so i can decode it by php further.
With the thumbnail, also stores there everything is fine, the SQL looks that way:
SELECt hex(thumbnail) FROM picTable where id_pic=54985
The Data is then displayed as HEX. But the standart picture is to big. When i use the statement:
SELECt hex(bigpic) FROM picTable where id_pic=54985
i got the error message:
An error occurred while running the query.
The data type, length, or value of argument 1 of HEX is invalid.
(SQL code = -171, SQL state = 42815)
After some research i found that the maximum lenght is 16 336 bytes for the HEX-operation. The picture is nearly 30 000 bytes... :shocked:
Have anyone an idea how to fix that?
I am not able here to accsess to the database direct...
I have been working for days on it.
View 4 Replies
View Related
May 22, 2007
Hi All,
I am in the process of changing the cursor based Proc with temp tables, I have one of the Procs which is beening used to get a value for the cursor, I am thinking if it is possible to change it to a function so that I can update the column at once.
[code]
CREATE PROCEDURE[dbo].[get_cre_tijd_id] (
@tijd_datum datetime,
@tijd_id int output
)
AS
DECLARE @datum_tekst VARCHAR(25)
DECALRE @datum_tijd DATETIME
SET @datum_tekst = CAST(@tijd_datum AS VARCHAR);
SET @datum_tijd = CONVERT(DATETIME, SUBTRING(@datum_tekst, 1, 12), 21 )
SET @tijd_id = (SELECT tijd_id FROM dim_tijd WHERE tijd_datum = @datum_tijd )
IF @tijd_id IS NULL
BEGIN
INSERT INTO dim_tijd (
tijd_datum
, jaar
, kwartaal
, maand
, dag
, periode
, week
, weekdag
)
VALUES ( @datum_tijd
, datepart(yy,@tijd_datum)
, datepart(q,@tijd_datum)
, datepart(m,@tijd_datum)
, datepart(d,@tijd_datum)
, ceiling(datepart(wk,@tijd_datum)/4.00)
,dbo.get_iso_week(@tijd_datum)
, datepart(dw,@tijd_datum)
)
SET @tijd_id = (SELECT tijd_id FROM dim_tijd WHERE tijd_datum = @datum_tijd)
END
Necessity is the mother of all inventions!
View 4 Replies
View Related
Sep 26, 2007
Hello all,
I am subtracting two datetimes (last(fields!FaultStart.value))-(first(fields!FaultStart.value)) this works fine and returns a value in a textbox 5.23:44:23. I need to convert that number to minutes I am very new to sql programming and do not know very many commands. I am using Microsoft sql server 2005 express edition along with sql server business intelligence development studio where I placed a textbox and entered the expression above. I have also tried to use datediff command
=datediff(second, (last(fields!FaultStart.value)),(first(fields!FaultStart.value)))
but the second is underlined and tooltips says WRONG NUMBER OF ARGUMENTS I€™ve tried
=datediff(€œsecond€?, (last(fields!FaultStart.value)),(first(fields!FaultStart.value)))
and
=datediff(€œ€™second€™€?, (last(fields!FaultStart.value)),(first(fields!FaultStart.value)))
also for second I€™ve tried seconds. Any help would be most appreciated
Thanks
Ed
View 3 Replies
View Related
Nov 8, 2007
I haven't seen a really good solution for this in amongst the threads about UTC. What I want to do is convert a date time to UTC, taking into account whether or not it is in DST, and be able to deploy this code to any server in the world without customizing the SQL code, and have it know how to convert, as long as a I feed it the local Time Zone.
I would think this would be easy because the OS knows at any given time what time zone has what UTC offset, and exactly at what time DST starts and ends. Right now I do this, but it is limited. I have a table that, for each site (there can be more than one site in different time zones) stores the UTC offset and whether or not the site observes DST. New York would have the "Observes_DST" set to 1, Phoenix would have it set to zero. The "Hours_To_UTC" value would be 5 for New York.
This code below assumes all sites are located in Canada or the US, as Canada and the US now use the second Sunday in March and first Sunday in November as the switch over times. (although this would work fine for countries like India and China that don't observe DST).
UPDATE a
SET Time_Arrived_UTC =
CASE
WHEN b.Observes_DST = 1 THEN
CASE
WHEN Month(Time_Arrived) IN (4,5,6,7,8,9,10) THEN
DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)
WHEN Month(Time_Arrived) = 3 AND Day(Time_Arrived)- DATEPART(dw,Time_Arrived) >= 7 AND
Day(Time_Arrived) <= 14 AND DATEPART(dw,Time_Arrived) <> 1
then DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)
WHEN Month(Time_Arrived) = 3 AND Day(Time_Arrived) > 14
then DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)
WHEN Month(Time_Arrived) = 3 AND Day(Time_Arrived) >= 8 AND Day(Time_Arrived) <= 14 AND
DATEPART(dw,Time_Arrived) = 1 AND DATEPART(hh,Time_Arrived) >= 2
THEN DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)
WHEN Month(Time_Arrived) = 11 AND Day(Time_Arrived) <= 7 AND DATEPART(dw,Time_Arrived) = 1 AND
DATEPART(hh,Time_Arrived) < 2 then DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)
WHEN Month(Time_Arrived) = 11 AND Day(Time_Arrived)- DATEPART(dw,Time_Arrived) < 0 then
DATEADD(hh,b.Hours_From_UTC - 1,Time_Arrived)
ELSE DATEADD(hh,b.Hours_From_UTC,Time_Arrived)
END
ELSE DATEADD(hh,b.Hours_From_UTC,Time_Arrived)
END FROM
Facts_Table a INNER JOIN Site_Info_Lookup_Table b
ON a.Site_Name= b.Site_Name
This works, (and is much more efficient than using a UTC lookup table) and I could probably go about hard coding various other start and end DST datetimes for other time zone DST (Australia and Europe, for example), but that wouldn't be dynamic in case one country makes a change in policy that changes when DST starts and stops, like the US just did.
SQL Server only provides current time UTC conversion--I would think it should have a function like this:
ConvertToUTC(datetimevalue,timezone)
Oracle has a function like that, but it is useless because it doesn't take into account DST, it would for instance just add 5 hours to EST for every date you entered (now that's helpuful!). It is baffling that this function doesn't exist.
I am using Integration Services so I could probably build a script task that would query the OS for DST start and stop times given a particular time zone (if available), but I'm not much of a coder--would be nice to have an easy way to do it in Transact-SQL.
Thanks,
Kayda
View 5 Replies
View Related
Oct 1, 2006
Hi All,
I'm needing to take a value inputted by a user via html form and convert it to a hex value upon inserting into SQL2000 db. I only need to store the 8 chars after "0x". Is there any T-SQL that can pull this off? CAST or CONVERT? Sorry if this is a silly question and hope I supplied enough info...
Thx,
Mike
View 1 Replies
View Related
Dec 7, 2006
Hi I am converting data from old DB to NEW DBIn the OLD table fields like "PhoneNumber" the data enterd are [ 657 985-986, (03)-987-543, 675(89)00, ect]Is their any function in sql where I can get rid of all those spaces and () and - between the numbers as my new field is only numbers and with out spaceOtherwise I have to clean them up manually as I have 1000000 records
cheers
View 1 Replies
View Related
Dec 8, 2006
I have a stored procedure which I user to retur an Email-address from aspnet_Membership (DB-table).
Here is the code:
ALTER PROCEDURE dbo.StoredProcedure2 @user nvarchar(256) AS DECLARE @id uniqueidentifier SET @id = '' SELECT @id = UserId from aspnet_Users WHERE UserName = @user SELECT Email From aspnet_Membership WHERE UserId = @id
I use StoredProcedure2 in this way:
Dim cmd As SqlCommand = New SqlCommand("StoredProcedure2", MyConnection) cmd.CommandType = CommandType.StoredProcedure
'send in UserName as @User to StoredProcedure2 cmd.Parameters.Add("@user", SqlDbType.NVarChar).Value = User.Identity.Name.ToString() 'Return EmailAddresse returnValue = cmd.ExecuteScalar()
Message I get is:
"Conversion failed when converting from a character string to uniqueidentifier"
Please help...
View 2 Replies
View Related
Mar 27, 2007
Hi,
I am developing a project that using the one of the starter kits which use the MS SQL EXPRESS database.The project is almost ready to be launch.
few questions:
I am looking for a good host with good support reasonable paid.
What is my options if I would like to convert from the current database, to other databases like MySql, MS SQL Server or any? which tools can help with this convertions?
thats all, thanks.
View 2 Replies
View Related
Feb 25, 2008
I have an old table (table1) and a new table (table2). I need to move some of the data from table1 to table2.
For my example, table1 contains 1 field that is a DateTime, we’ll call it table1_Date.
table2 also contains 1 field that is a SmallDateTime, we’ll call it table2_Date.
I want to do something like this:
Insert into table2
table2_Date
Select
table1_Date
From table1
Where …..
I am getting the following error:
The conversion from datetime data type to smalldatetime data type resulted in a smalldatetime overflow error.
How can I go about converting this on the insert?
View 9 Replies
View Related