Extra Character
Sep 20, 2005
Hi,
I used excel to import data to my database, I found out a problem, my program is linked with the database, when the program show data from the database, it has an extra '@' symbol, In order to remove it, I need to go to the database to press space bar and backspace at the field. How could I use SQL instead of using space bar and backspace?
Thanks
Frenk
View 7 Replies
ADVERTISEMENT
Jan 15, 2014
I am trying to insert an NTEXT value from one table T1 to another table T2 within a database. Table structures are as below;
Create table T1 (T1ID INT NOT NUll, SourceColumn Ntext null)
Create table T2 (T2ID INT NOT NUll, TargetColumn NVARCHAR(MAX) null)
Every time when long text value is getting inserted into T2.TargetColumn , it is appending with an unwanted character '?' either at the beginning or at the ending of the text string. Same problem happens even when I am trying to update T2.TargetColumn = T1.TextColumn. Because of this, the same column never matches to the source column and gets updated every time even there is no change...
I am also converting NTEXT column to NVARCHAR(MAX) and replacing CHAR(10) to '' .
I am using SQL Server 2012. How can I avoid inserting '?' in T2.TargetColumn . Is there any setting which I need to set in the target table?
View 1 Replies
View Related
May 17, 2015
I have a table that contains file paths as
ServernamefolderAfilenameA
ServernameFolderBFilenameB
and I need a query to return
ServernamefolderA
ServernameFolderB
I tried
SELECT DISTINCT left(Source, charindex('', Source)- 0) AS String
FROM Table
But that removes everything after the first and I need it to return all data before the last
View 5 Replies
View Related
Aug 6, 2015
I have the following scenario, The contents of main file are like :
ServerCentral|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it
And I need the output in the following form:
ServerCentral=forum=is=the=best
so=be=on=it
The logic being that multiple and consecutive occurrences of the special character, here - pipe , should be replaced by a single special character.
View 5 Replies
View Related
Apr 15, 2004
I have data in a column that starts with 1-4 characters followed by a dash then followed by an number of characters (ex: EU-Surgery).
How do I select everything to the right of the dash when the number of characters to the left of the dash varies?
View 3 Replies
View Related
Oct 1, 2014
I'd like to return the left-most character from an 8 character string & the third from the left character too.
Like this ABC00123 returns AC
$query = "SELECT LEFT(uninum,3), RIGHT(uninum,5), clmarea, Date FROM tblunimov";
$result = mysql_query($query) or die(mysql_error());
echo "<div class='tblstyle1'>";
echo "<table class='tblstyle1'>";
echo "<tr><th>ini</th><th>item</th><th>area</th><th>date</th></tr>";
while($row = mysql_fetch_array($result)){
[Code] ....
View 5 Replies
View Related
Feb 1, 2008
Hi!
I have a table like this below and it doesn't only contain English Names but it also contain Chinese Name.
CREATE TABLE Names
(FirstName NVARCHAR (50),
LastName NVARCHAR (50));
I tried to view the column using SQL Query Analyzer, It didn't display Chinese Character.
I know that SQL Server 2005 is using UCS-2 Encoding and Chinese Character uses Double Byte Character Set (DBCS) Encoding.
I want to read the FirstName and LastName columns and display in Window Form Data Grid and ASP.NET Grid View.
I tried to use this code below and it didn't work. It convert some of the English Name to Chinese Character and it display the chinese character and some still in the original unreadable characters.
Does anybody know how to read those character from SQL Table and display the correct Chinese Character without converting the English Name into Chinese also?
Thanks
int codePage = 950;
StringBuilder message = new StringBuilder();
Encoding targetEncoding = Encoding.GetEncoding(codePage);
byte[] encodedChars= targetEncoding.GetBytes(str);
.
message.AppendLine("Byte representation of '" + str + "' in Code Page '" + codePage + "':");
for (int i = 0; i < encodedChars.Length; i++)
{
message.Append("Byte " + i + ": " + encodedChars);
}
message.AppendLine(" RESULT : " + System.Text.Encoding.Unicode.GetString(encodedChars));
Console.Writeline(message.ToString());
View 1 Replies
View Related
Jan 18, 2007
hi all,
i wonder if i could break one row to multiple row base on this case :-
status=A OriginQty=10 HoldQty=3
i want to print the status=H for the remaining originqty-holdqty
isit possible to digest this data in my SP to:-
status=A BalQty=7
status=H BalQty=3
~~~Focus on problem, not solution~~~
View 2 Replies
View Related
Jan 17, 2008
HI
When I'v click in Visual Web Developer 2008 to build web site it has made a new MDB file name ASPNETDB. MDF
So now I have 2 mdb file (MyFileName.mdf and ASPNETDB. MDF)
What is that extra (ASPNETDB. MDF) file and do I need it and why?
Thanks assaf
View 1 Replies
View Related
Apr 14, 2006
Here is the basic sql I am trying to implement:
select classid, count(*) as [COUNT], dtmready from unit
where rmpropid = '123' and classid = 'A1'
group by rmpropid, classid, dtmready
order by dtmready;
Here is my result set:
A1 3 2006-07-01 00:00:00.000
A1 10 2006-08-15 00:00:00.000
A1 11 2006-09-15 00:00:00.000
A1 10 2006-10-15 00:00:00.000
A1 10 2006-11-01 00:00:00.000
A1 10 2006-11-30 00:00:00.000
If you notice, the earliest dtmready is 7/1/2006. What I need is to return an additional row when the earliest dtmready is after today. The desired row would be:
A1 0 (today's date)
Background: I am running SQL Server 2000 SP4 and the results of the query are returned to a java program at a level where I do not have the ability to create a new row. So, it would be ideal if I could create the sql that returns a row with a dtmready of today with a count of 0.
View 4 Replies
View Related
Jun 1, 2004
I have a strange SQL statement
Select * from TableName WH
Basicly I have a code that creates a Dynamic SQL statement
in this case I thought that I will get an error on the above statement but infact I did not
I tested it on the Enterprise Manager
and it works fine
I changed the WH to WHER it works as long as its not a reserved word
so if I put my name or what ever after that sql it still works
unless I use two words with a space between them it will give an error
on the second one not the first
Can anyone tell me why is that
I do not know if its a feature or what
Thank you in advance.
View 4 Replies
View Related
Feb 5, 2002
Our company wants to run web based application
in folowing way.
Browser --> WebServer -->Sql Server
Sql server is part part of corporation domain and has about 25 more databases
Should we dedicate extra SQL server to run Web apps , or it would be safe to run web apps on corporation Sql Server?
or
If any one can point on links on this subject?.
Thank you
View 1 Replies
View Related
Jul 10, 2006
I have some fields in my database that are char(50)
I use an insert to put some text into the fields (using perl)
when I look at the fields I find that spaces are used to "pad out" the text to the field size.
This didn't happen with MySQL and PHP, is there any way to disable this?
View 5 Replies
View Related
Feb 17, 2005
I have the following sql statement:
SELECT FTE_CLASS_GROUP_NBR_DSCR
FROM dbo.DLIST_FTE_CLASS_GROUP
WHERE FTE_GRP_ID IS NOT NULL
This is an example of the result returned:
9999/00 Some lenghty text is displayed after the numbers
I want to trim everything after 9999/00
Is there a way to use rtrim to remove the characters after the numbers or another method?
Thanks,
-D-
View 1 Replies
View Related
Jul 22, 2005
Hi
I've also got an inconsistency problem!
My CHECKDB says:
Server: Msg 8952, Level 16, State 1, Line 1
Table error: Database 'Multiflex_YBS', index 'mf_InvObject.I_mf_InvObject_Archived' (ID 308196148) (index ID 2). Extra or invalid key for the keys:
Server: Msg 8956, Level 16, State 1, Line 1
Index row (1:1189627:69) with values (Archived = Jul 6 2005 10:04PM and InvObjectId = 4374699) points to the data row identified by ().
"Extra or invalid key" ? How can that happen?
Kind regards,
Thomas Holmgren
Denmark
View 10 Replies
View Related
Jan 23, 2006
Hello
Before I start just wanna say thanks for all the top advice so far - much appreciated. My current quandry is this:-
I have a table called STOCK with columns ITEM_ID, ITEM & PRICE. Most of the stock is my own produce but i do buy-in some items. What i want to do is add some extra columns to STOCK for the supplier details on those items i buy in. The problem is that a lot of the fields in the supplier details columns will be empty. Would this be a problem or would it be better to have a seperate table for supplier details?
Jill
View 9 Replies
View Related
Mar 20, 2007
I have a table sample:
DECLARE@Sample TABLE (Merchant VARCHAR(1), OldOrder INT, OrderType VARCHAR(20),
NewOrder INT, cdate datetime)
INSERT@Sample
SELECT'a', 1, 'new', 1,'1/1/2003' UNION ALL
SELECT'a', 2, 'renewal',2,'8/2/2003' UNION ALL
SELECT'a', 3, 'renewal', 3, '2/1/2004'UNION ALL
SELECT'a', 4, 'renewal', 4,'11/1/2004' UNion ALL
SELECT'a', 5, 'renewal' ,5, '3/8/2006'UNION ALL
SELECT'a', 6, 'new', 1, '3/1/2004' UNION ALL
SELECT'a', 7, 'new', 1,'12/3/2005' UNION ALL
SELECT'a', 8, 'renewal',2, '8/2/2005'UNION ALL
SELECT'a', 9, 'renewal', 3,'9/2/2006'UNION ALL
SELECT'a', 10, 'renewal',4, '10/2/2006'UNION ALL
SELECT'a', 11, 'renewal', 5, '11/2/2006' UNION ALL
SELECT'b', 1, 'new', 1,'8/2/2003'UNION ALL
SELECT'b', 2, 'new', 1,'9/2/2003'UNION ALL
SELECT'b', 3, 'new', 1,'8/2/2005'UNION ALL
SELECT'c', 1, 'new', 1,'8/2/2004'UNION ALL
SELECT'c', 2, 'renewal',2,'8/2/2005' UNION ALL
SELECT'c', 3, 'renewal',3,'9/2/2005' UNION ALL
SELECT'd', 2, 'new',1 ,'8/2/2005'UNION ALL
SELECT'd', 3, 'renewal',2, '4/2/2006'UNION ALL
SELECT'd', 4, 'renewal',3, '6/2/2006'UNION ALL
SELECT'd', 4, 'renewal',4,'9/2/2006'
I want to remve all records serials startign with type 'new' (neworder 1) which is later than ,1/1/2005' and subsquncial renewals
The desire result should be:
MerchantOldOrderOrderTypeNewOrdercdate
a1new12003-01-01 00:00:00.000
a2renewal22003-08-02 00:00:00.000
a3renewal32004-02-01 00:00:00.000
a4renewal42004-11-01 00:00:00.000
a5renewal52006-03-08 00:00:00.000
a6new12004-03-01 00:00:00.000
b1new12003-08-02 00:00:00.000
b2new12003-09-02 00:00:00.000
c1new12004-08-02 00:00:00.000
c2renewal22005-08-02 00:00:00.000
c3renewal32005-09-02 00:00:00.000
Thanks.
Jeff
View 1 Replies
View Related
Nov 20, 2007
Hi!
I need to sync an application on windows mobile 5 that uses sql server mobile with sql server 2005. I've tried Merge and it populated the tables on the server with new fields and triggers. Does RDA do the same thing?
Jesus saves. But Gretzky slaps in the rebound.
View 4 Replies
View Related
Jul 7, 2006
I have asked for the following questions and I need your advises.Utilizing the Northwind database suppied with SQL Server, create SQL tosolve each of the exercises listed.1.I want to contact all customers who have received over $1,000 indiscounts on orders this year. Give me the name and phone number of theperson to contact at the customers site. Also, list the orders wherethe total discount was greater than $100. Remember, discount is apercentage of the price.2.Give me a list of suppliers and products where we do not have thestock on hand to fill the orders to be shipped. List out the customerand order information for each of the products involved.3.Give me a list of all orders that were shipped after the requireddate for the week of Jan 7, 2001. I want to know the name of theemployees that were responsible for the orders.4.We are having a golf tournament and I need some prizes. Give me alist of the top 5 shippers by dollar amount in the last year.5.Some customers are taking us for a ride on shipping. Give me a listof customers and the orders involved where more than ½ of their ordersare being shipped to a region other than their home region.Please advise ...thanks a lot
View 2 Replies
View Related
Feb 27, 2007
I have worked with straight-forward simplistic SSIS up to now, so I apologize if this is a simple question. I have a SQL table destination that accepts daily data from an AS400 table. We now have a need to datestamp the incoming data so I added a new column to the destination table where I want today's date. Is there a data flow transformation that I need to use to default the destination column to today's date? Time is not a consideration and not needed, just the date.
Thanks for the information.
View 4 Replies
View Related
Dec 27, 2007
Hi,
I am declaring a table with 2 column Id, and Name.
Id is a integer column but Name is a Varchar.
I am declaring Name as VARCHAR(100) you can say that varchar(100) is more than enougf for a name column. But lets suppose ifn futuer user will enter data only till 100 characters but lets suppose i put or declare it as NAME VARCHAR(4000), That means a column requires only 100 memory space but i am giving 4000 to that column
So in case of SQL any drwbacks are there for this approach. Meaning my 3900 space will not be used so will it a wrong thing or we can declare it as ,,, it will put no effect???
or what are the drawback??
View 3 Replies
View Related
Sep 20, 2006
Hello,
I'm trying to make a report with the following layout:
Car Sales 2004 2005 Var %
Total 10 20 50%
Green 7 14 50%
Red 3 6 50%
I'm using a matrix and the data is coming from a cube. One dimension called 'Years' is used to fill the matrix columns and the data corresponding to the car sales is filled by a measure called 'Sales'.
I've built part of the example but I can't add the final column ( the VAR% column).
If I try to add a static column in the end it apears only one year.
The behavior that I would like to have is simillar to the situation when we add the Subtotal column. Although, instead the sum() made by subtotal I would like to calculate the variation percentage between years.
Is there any way to add a final column into a matrix avoiding the problem that I'm having or maybe change the behavior of Subtotal column?
Thanks and best regards.
vjn
View 5 Replies
View Related
May 8, 2008
Hi there
I got the following returned simple dataset as follow:
ReportViewType; Category; Name; Units; Price;
LIST_VIEW; FRUITS; Apple; 1; $10
LIST_VIEW; FRUITS; Banana; 2; $11
LIST_VIEW; CARS; Corolla; 8; $100
LIST_VIEW; CARS; BMW; 10; $200
I've managed to grouped by Category field nicely and added extra calculated column for handling to total plus as well as Total for each group plus added a new row for TOTAL in the TABLE and returned as follow:
FRUITS
Apple; 1; $10; $10
Banana; 2; $11; $22
TOTAL FRUITS; $32
CARS
Corolla; 8; $100; $800
BMW; 10; $200; $2000
TOTAL CARS: $3000
TOTAL: $3032
Now I want to put another extra row underneath TOTAL for handling the calculated but the business rule is only for displaying from the first group for instance:
TOTAL: $3032
Calculated Average per fruits: $1010.67 ($3032 / 3 UNITS).
3 UNITS is coming from Units for Apple and Banana.
I don't know if I can do this cause i did try to use
=SUM(IIF(Fields!Category.value = "FRUITS", Fields!Units.Value, 0))
But it's successfully compiled but the report result error (#Error) on that field only. Any ideas? Also ... someone mentioned that I should look at the SCOPING but I don't work it how's work anyway.
I thought a simple like this can be handled quite easily instead of creating a new report view type in the the same dataset to handle this particular extra line.
Waiting your comment/feedback.
View 2 Replies
View Related
Jul 11, 2006
Hello,
When I export to PDF or Tiff, I am getting an extra blank page at the bottom of the document. Any ideas what might be causing this blank page during my export?
BTW...SSRS 2005 SP1
TIA!!!!
View 5 Replies
View Related
Apr 3, 2007
I need to be able to add an extra column to my matrix - I've searched high and low on the net and I cant seem to find the answer anywhere.
I have grouped data which displays as it should and I can get the SubTotal part for my Dailys to run - I need to add a total for MTD and YTD (which is a part of the SQL Data) after the subtotal - is there a straight forward way of doing this?
This is an example of how I want my report to look (I can already achieve the bits highlighted bold)
Daily Data
Commission (GroupData cell 1)
Interest (GroupData CELL 2)
GroupData etc €¦
SUBTOTAL (DTD)
MTD TOTAL
YTD TOTAL
Book
Currency
=sum(Fields!DTD.VALUE)
........
=sum(Fields!MTD.VALUE)
=sum(Fields!YTD.VALUE)
and this is an example of the data being returned by my Sproc
Book
CCY
GroupedData
DTD
MTD
YTD
ABC
GBP
Commission
£0.01
£0.09
-£0.10
ABC
GBP
Interest
£0.02
£0.29
£0.11
ABC
GBP
Brokerage
£0.12
£0.06
£0.20
When I use the "Add Column" functionality - I get a repeat of the MTD and YTD under each of the groupData cells - where as i only need it as a summary after the subtotal.
Daily Data
Grouped Data CELL 1
Grouped Data CELL 2
Book Name
Currency
DTD TOTAL
MTD TOTAL
YTD TOTAL
DTD TOTAL
MTD TOTAL
YTD TOTAL
=sum(Fields!DTD.VALUE)
Does anyone out there know how to do it?
View 7 Replies
View Related
May 27, 2007
I’m using a SQLDataSource to populate a dropdown. The SQL table I use to populate the drop down has two columns. I only want one of them to be displayed in the drop down but I need to make decisions later in the code based on both columns. How do I access that second column in the datasource?
View 4 Replies
View Related
Oct 10, 2005
I'm encountering a strange problem in all the applications I'm working on and am totally dumbfounded as to why it's occuring:From a standard web form I'm inserting a record using a stored procedure. (I'm writing this to a SQL 2000 db - where the column types and variables are all consistant) No matter what I do, the columns are padded with extra characters maxing out the field length (if it's nchar or nvarchar or char) after insert or update. I've tried Trim - ing the field.text values that I'm feeding to the @variables used in my stored procedure. I've even RTRIM() - ed the @variables within the stored procedure. No matter what I do I get extra spaces padding the end of the intended column input. Ideas anyone???Thanks in advance. - Abe
View 4 Replies
View Related
Mar 9, 2006
When I enter a data in a table, SQL Server automatically completes the data with blanks up to length of column.
this happens in a web form also in Management Studiıo,
Whan am I doing wrong ?
does Collation have anything with it ?
SQL Server 2005 / Developer Edition
View 2 Replies
View Related
Mar 28, 2002
I noticed our log files are getting way too big. I found that a previous
SQL guy had set up the following scheduled job with the TSQL statement:
BACKUP LOG DEV TO DevDailyTranLog with noinit
This runs every 20 minutes.
There's also a Maint Plan to do a Complete backup every night and a
Transaction Backup every hour (could be set to 20 min)
Why do you suppose the BACKUP LOG job exists ? If the maint plan were
set to backup transaction every 20 min, wouldn't the 2 jobs be
duplicating each other ?
Also, I notice that the Tran Logs specified in the database properties
seem awfully big (4 gig), shouldn't they automatically be truncated when
the daily full backup occurs ? (full recovery model)
Feel free to call me and straighten me out or to get more info.
Win2K, SQL 2K
gdunn@taunton.com
203-426-8171 x 374
View 2 Replies
View Related
Apr 3, 2008
Help!
I have a bcp that create an extra line at the end of the file--how do u fix--
bcp "select upload_data FROM %DRI_DB%.dbo.chf_upld_wkstn" queryout %DATA_DIR%test.txt -S %DRI_SERVER% -U %DRI_USERID% -P %DRI_PW% -c
Josephine
View 1 Replies
View Related
Jul 13, 2007
I am trying to create a SSIS package with a csv flat file for the both the destination and source. I cannot control the source file. I need to be able to handle an extra comma in the source file which occasionally contains suffixes i.e. {John, Smith, Jr,} which could cause some records to be 9 fields and others 10. Any ideas?
View 1 Replies
View Related
Aug 3, 2007
Hi all
I need help ..
I want to create one SSIS...my requirement is
I have text file having three column
like
300;Dev Fot;30097
400;Kit Mol;79684
now i have to insert this in DB with SSIS but at the same time I
want another column insert in DB table with ID
like
1;300;Dev Fot;30097
2;400;Kit Mol;79684
my table structure is
Table_name (ID not null,EmpID not null;desc Not null;FinID Null)
my input to package is my text file path and ID
How shud i process??
T.I.A
View 1 Replies
View Related
Mar 12, 2008
Consider this table
Make Model Derivative Term Miles Maint CH PCH
AUDI A4 TDI 2 10000 1 100 110
AUDI A4 TDI 2 10000 0 200 210
AUDI A4 TDI 2 20000 1 300 310
AUDI A4 TDI 2 20000 0 400 410
AUDI A4 TDI 2 30000 1 500 510
AUDI A4 TDI 2 30000 0 600 610
AUDI A4 TDI 3 10000 1 700 710
AUDI A4 TDI 3 10000 0 800 810
AUDI A4 TDI 3 20000 1 900 910
AUDI A4 TDI 3 20000 0 950 955
AUDI A4 TDI 3 30000 1 975 980
AUDI A4 TDI 3 30000 0 985 990
What I'm hoping to do is consolodate these 12 rows into 1 row with the following fields
Make
Model
Derivative
2Year10kMaintainedCH
2Year10kNotMaintainedCH
2Year20kMaintainedCH
2Year20kNotMaintainedCH
2Year30kMaintainedCH
2Year30kNotMaintainedCH
3Year10kMaintainedCH
3Year10kNotMaintainedCH
3Year20kMaintainedCH
3Year20kNotMaintainedCH
3Year30kMaintainedCH
3Year30kNotMaintainedCH
2Year10kMaintainedPCH
2Year10kNotMaintainedPCH
2Year20kMaintainedPCH
2Year20kNotMaintainedPCH
2Year30kMaintainedPCH
2Year30kNotMaintainedPCH
3Year10kMaintainedPCH
3Year10kNotMaintainedPCH
3Year20kMaintainedPCH
3Year20kNotMaintainedPCH
3Year30kMaintainedPCH
3Year30kNotMaintainedPCH
Is there any way to do this?
Thanks
View 4 Replies
View Related