Conversion Probs..
Jul 23, 2005
Hi Group,
I am trying to display the multiplication through this way
----------------------
select 1163436036*100
----------------------
Getting the error
============================
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.
============================
For that reason I was tried to convert that to nvarchar
------------------------
select convert(numeric(36,2),1163436036*100)
------------------------
But still getting the error
=============================
Server: Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.
=============================
Please help me to solve it out..
Thanks and Regards
Arijit Chatterjee
View 3 Replies
ADVERTISEMENT
Jul 20, 2005
Hi Everybody,I am facing another probs. I have created a trigger for table Tab1 forperticular column col1 for checking value ranges.But at time for usinginsert statement it is working fine but when I am importing data fromflat file through DTS the trigger is not working.How to solve this.RegardsArijit Chatterjee
View 1 Replies
View Related
Oct 3, 2006
this is my first time using sql server, so i guess i'm def doing something wrong here..
my connection:
Code:
objConn = "Driver={SQL Server};Server=SHEMPCWEBSERVER;Database=aoms;Trusted_Con nection=yes;"
Set conn=Server.CreateObject("ADODB.Connection")
conn.Open objConn
Set rsLogin = Server.CreateObject("ADODB.recordset")
'Select the data from the database using the submitted data.
rsLogin.Open "SELECT * FROM tblUsers", conn
Response.Write rsLogin("fldUsrsName")
my error:
Code:
Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'SHEMPCIUSR_XBOARDS-VRORER9'.
/aoms/testdb.asp, line 6
can anyone see what i'm doing wrong?
Thanks
Shem
View 2 Replies
View Related
Feb 13, 2008
Hello...
I am stuck with update statement...
I am having 3 tables abc,def and xyz...
i want to update column1 of abc with column2 of def values (here the probs is i dont have any common fields between them)
i am having common values between def(column10) and xyz(column10_new)
so i am using inner join something like below....
but this looks like wrong to me...bcoz when i do this (only select):
select column2 FROM def inner join xyz on def. column10 = xyz. column10_new
i am getting different as compared to the update below....
UPDATE abc
SET column1 = column2 FROM def inner join xyz
on def. column10 = xyz. column10_new
can anyone suggest how to solve this update???
Thanks
View 2 Replies
View Related
Dec 28, 2006
I keep getting errors while trying to install SQL 2000 enterprise edition.....
Internal Error: Contact MS Tech Support
Help !!!
View 3 Replies
View Related
Mar 1, 2007
Hi All,
I have this sql syntax which displays the records within the xml but instead of displaying 4 records (3 records relating to the last question ID) but instead resulting in only two records picking only the first options 'Unhelpful'.
Definitely doing something wrong here, please advise!
DECLARE @doc xml
SET @doc =
'<DivisionName>
<QuestInfo Custref="18759" SubDate="2006-01-01T00:00:00"
Polref="30018759" AgentID="4189" ClaimRef="14024-5647-890"/>
<DVName>Ho</DVName>
<DvcodeNo>1</DvcodeNo>
<ClaimGroup>
<CustSurveyNo>4</CustSurveyNo>
<ClaimGroupType>Water</ClaimGroupType>
<Questions>
<QuestionID>45</QuestionID>
<Answer>
<AnswerID>43</AnswerID>
<Ansoption />
</Answer>
</Questions>
<Questions>
<QuestionID>34</QuestionID>
<Answer>
<AnswerID>13</AnswerID>
<Ansoption>
<Options>Unhelpful</Options>
</Ansoption>
</Answer>
</Questions>
</ClaimGroup>
</DivisionName>'
DECLARE @docHandle int
EXEC sp_xml_preparedocument @docHandle OUTPUT, @doc
SELECT *
FROM
OPENXML(@docHandle, '/DivisionName/ClaimGroup/Questions/Answer/
Ansoption', 2)
WITH
(DVName varchar (20) '../../../../DVName',
DvcodeNo int '../../../../DvcodeNo',
CustSurveyNo int '../../../CustSurveyNo',
ClaimGroupType varchar (20) '../../../ClaimGroupType',
QuestionID int '../../QuestionID',
AnswerID int '../AnswerID',
Ansoption varchar (30)'Options')
EXEC sp_xml_removedocument @docHandle
View 1 Replies
View Related
Apr 19, 2004
Hi folks,
I got a strange Problem with this statement:
select * from [db1].[dbo].[table1] AS db1
INNER JOIN [db2].[dbo].[table1] AS db2
ON (db1.Text = db2.Text)
Text fields are both nvarchar(50)
I think this should work, but it doesnt?
I got a SQL Server Error 446
I know, text compares are not that good, but it exists no other way....
Thanks for any advice!!!
View 10 Replies
View Related
Nov 9, 2007
I have production server 2000. The server gets disconnected sometime by itself and sometime it is working fine.Sometimes it even doesn't get restarted. Is there any problem with service packs and some performance issues.
Can you SQL guru give me best suggestion and how should i proceed.
View 3 Replies
View Related
Jan 30, 2008
when i update i want only date portion tp be displayed from datetime datatype...
create table temp11 (datecolumn datetime)
insert into temp11 values (getdate ())
insert into temp11 values (getdate ())
insert into temp11 values (getdate ())
insert into temp11 values (getdate ())
now when i am running this query,i am getting what i want...
select convert (varchar, datecolumn,111) from temp11
but when i am tyring to update in the temp11 table using the below query...
update temp11
set datecolumn = convert (varchar, datecolumn,111)
i am getting date and time as well like...
2008-01-14 00:00:00.000
2008-01-14 00:00:00.000
2008-01-14 00:00:00.000
2008-01-14 00:00:00.000
i only want the date portion in my updated new table.....
any suggestions plzzzzzzzzz
is it poss thru any sql query???or shud be done in the front end only???
View 5 Replies
View Related
Jun 11, 2007
Hi All,
I've designed a simple sales report , first grouped by Transport type and then by item.
Example
Category Item Sales
DHL A 2000
DHL C 1500
DHL E -1700
AmEx A 200
Amex E 20
-------------------------------
when click on sales under group DHL it shouild sort -say descending-
so result should be
DHL A 2000
DHL C 1500
DHL E -1700
instead I get results
DHL A 2000
DHL E -1700
DHL C 1500
this is just an example but this is the sort of results I get when I try to use interactive sorting.
Any Ideas?
thanks
Sonny
View 5 Replies
View Related
Oct 20, 2007
You notice after installing SQL Server 2005 that there is a warning message in the SQL Server log that SQL Server cannot lock pages in memory. What must you do to allow SQL Server to lock memory pages in memory?
After installing SQL Server, your customer complains that transactions are slow. You notice that there is excessive I/O in the TempDb. You want to move TempDb to another set of disks, so you have the sytem administrator configure two more logical disks on the server. What must you do to configure the SQL Server TempDb on this new set of disks?
You are instructed to install SQL Server in an Active / Active cluster environment. What two network related pieces of information must you have prior to performing the installation?
View 3 Replies
View Related
Mar 22, 2001
Has anyone faced problems in calling one stored procedure from within another stored procedure ? I am considering using nested SPs, and would appreciate any inputs on it.
Thks,
SC
View 2 Replies
View Related
Jun 30, 2006
Hi All,
It would be great if anybody could help me how to write a T-SQL script to generate a report in spreadSheet from a table in SQLserver 2000 database.
And this report should be generated as per the following timings(Sheduled timings only).<script></script>
As well it should be able to send a mail regarding the availability of the report to user groups.
Incase if the generation of report fails then we need to send a mail reg the failure.
Any HELP is greatly appreciated!!!
Thanks in Advance!!!
Regards,
Sashi
View 1 Replies
View Related
Mar 28, 2007
Hi:
Am trying to import XLS data into SQL 2005 SP2 thro a SSIS Data Flow task. My Excel Connection string has IMEX=1, ImportMixedTypes is set to Text and the typeguessrows is set to 0.
Import works fine for cells of Format Text, but when I have a large number (in a general Format cell) it gets converted into scientific notation(e.g. 3.234175e+7) in the table.
What am I doing wrong?
TIA
Kar
View 2 Replies
View Related
Jun 26, 2006
Hi. I am trying to figure out the code for sorting a manual (non-identity) number column in my table. the purpose is to
show the user's pictures in perfect order (1,2,3,4,5,6...).
The Jist of my problem... When a user first inserts six pictures, he gets:
|1|
|2|
|3|
|4|
|5|
|6|
All is good. But, say he deletes picture |3|. Now the list order looks like this:
|1|
|2|
<- |3| is removed
|4|
|5|
|6|
And, then he inserts two more pictures, now he his this:
|1|
|2|
|4|
|5|
|6|
|7| <- |7| & |8| are added
|8|
What i want to acheive is a "reshuffling" of the number order every time a picture is removed. So, when |3| is removed, |4| becomes |3|, |5| becomes |4| and so on. There should never be a gap in the order.
I am new to stored procedures, and have been trying to figure this out. Below is my guesswork:
Code:
ALTER PROCEDURE dbo.sp_NewPersonalPic
(
@photo_name VARCHAR(50) = NULL,
@photo_location VARCHAR(100) = NULL,
@photo_size VARCHAR(50) = NULL,
@user_name VARCHAR(50) = NULL,
@photo_caption VARCHAR(150) = NULL,
@photo_default BIT = NULL,
@photo_private BIT = NULL,
@photo_number INTEGER = NULL,
@photo_date DATETIME = NULL
)
AS
BEGIN
SELECT @photo_date = CONVERT(DATETIME,convert(char(26), getdate(), 109))
END
BEGIN
SET @photo_number = 1
SELECT
@photo_number = (
SELECT COUNT(*)
FROM dbo.PersonalPhotos b
WHERE
a.photo_date < b.photo_date
)
FROM
dbo.PersonalPhotos a
ORDER BY
a.photo_date
END
BEGIN
My thinking is that it would be a safe bet to use the "photo_date" column as a litmus for my "photo_number" column (ie, the most recent record inserted by the user will always be at a later date than the previously inserted record). So:
photo_number photo_date
|1| 2006-06-26 21:43:36.653
|2| 2006-06-26 21:43:50.000
|3| 2006-06-26 21:45:25.217
|4| 2006-06-26 21:45:33.763
|5| 2006-06-26 22:39:42.670
|6| 2006-06-26 22:39:49.200
If |3| is removed above, the numbers are reordered based on the time of entry sequence.
Any suggestions on how to acheive this in my stored procedure? Currenly, i get the correct order, but it goes crazy when i delete and add.
Thanks and sorry for the verbose post.
View 5 Replies
View Related
Jan 7, 2008
Hi Experts,
I am extracting data from SQL Server 2005 to flat file destination. I am using SQL Command to specify the data selection query. One of my query uses Replicate function to derive a column value. When I execute this package it fails with the error "Data conversion failed. The data conversion for column "value" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page".
The reason for the problem is that, it is taking the InputColumnWidth of the flat file destination as 8000 and I specified the OutputColumnWidth as 4.
If I change the OutputColumnWidth to 8000, it is working without any error but resulting in the column width of 8000.
I tried using DerivedColumn Transformation's Type cast and DataConversion Transformation but still I am getting the same error in the respective Transformation components.
Can anyone suggest how to solve this issue.
View 11 Replies
View Related
Apr 12, 2000
just wondering if anyone out there has any advice or feedback regarding an upgrade conversion from 6.5 to 7.0 via the wizard? is this as straightforward as it sounds?
the only bad thing i have heard is when an upgrade is done from 6.5 to 7.0 and the 6.5 database utilized system tables . . . any feedback would be sincerely appreciated.
thank you in advance!
View 2 Replies
View Related
Jan 15, 2007
I want to convert a table in sql server2000 to DBF .
I need to this script in sql server2000
thanks
Ahmad
View 3 Replies
View Related
Nov 23, 1998
Anyone know how I can convert a Access97 database to SQL 6.5?
Or better yet.. how can I import a text file into SQL Server 6.5? The fields are seperated by fixed-width spaces.
thanks!
View 3 Replies
View Related
Jul 17, 2001
Hello, I would like to convert some of the rows in a column that has a data type of int to a decimal. Should I change the data type of the whole field to decimal or numeric, it seems like no matter what I do I cannot get certain rows to come up with a decimal number even though when I run a cast or convert it gives me the correct number of rows affected when I look at the data it is still in int format. Although this seems simple I am not having any luck getting this to work. Any help would be appreciated.
Thanks
View 1 Replies
View Related
Jun 17, 2004
Hi Techies,
We had a database MS-Access with DAO statements and we are upgrading our Database to MS-SqlServer which in need to convert the DAO statements to ADO statements.
What i want to know is there any free tool which converts automatically to convert DAO statements to ADO statements. If so what is it?
If not what is the easiest procedure to convert or otherwise should I have to do it manually convert all those DAO statements(so many). If I have to do it manually can u explain where i need to take care mainly while converting the statements.
Thank U
View 1 Replies
View Related
May 17, 2004
Hello All,
I am in the process of converting my database's columns from char/varchar/text to nchar/nvarchar/ntext.Most of the columns have foreign keys/indexes defined on them.I need to get this done programmatically.Any scripts or help would be invaluable.
Thanks!
View 3 Replies
View Related
Dec 20, 2006
I have a decimal property in a chart, when I tell for crystal if it will be null pass '-', since I can do
grato
Marcos S. Santos
View 9 Replies
View Related
Feb 24, 2007
Hi!
I have a Fact_ETL process with several Lookups.
I need to compare a ID-string datatype DT_14 from OLE DB Source to string DT_18 from Dim_salesperson. Then I would collect the ID's from Dim_salesperson into OLE DB Destination. Tried to convert DT_14 to DT_18 before Lookup. No, not working. Decimal[DT_Decimal] not working either...
I would be so grateful if someone could give an idea...
View 3 Replies
View Related
Jul 20, 2005
Hi,How do you convert DDL statements of SQL Server, which aregenerated by DTS into other database vendors' syntax (IBMDB2 or Oracle)?Any utility tool?Thank you,--jaques
View 2 Replies
View Related
Mar 18, 2008
how can i convert 061934 to Jun 01 1934?
thanks.
View 15 Replies
View Related
Mar 26, 2007
Hi all, i have an sdf file with me and i want to transfer the contents to an mdf file is there any way to do this with out the insert commands..can anyone throw light on this one?
View 4 Replies
View Related
Oct 24, 2007
Hi All.
I have MS sql server 2000 database back up. Its Extension is .bkp
I want to import this file in sql express. i want to use this in sql server 2005. how can i do this, please can you write me step.
Thanks.
Zahyea.
View 3 Replies
View Related
Nov 6, 2007
Hi,I keep getting the error:System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value '@qty' to data type int. When I initiate the insert and update.I tried adding a: Convert.ToInt32(TextBox1.Text), but it didn't work.. I also tried fiddling with the update code, but I think it is to do with the insert bool as the update works at the moment.. Could someone help?My code:private bool ExecuteUpdate(int quantity){ SqlConnection con = new SqlConnection();
con.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"; con.Open(); SqlCommand command = new SqlCommand(); command.Connection = con; TextBox TextBox1 = (TextBox)FormView1.FindControl("TextBox1"); Label labname = (Label)FormView1.FindControl("Label3"); Label labid = (Label)FormView1.FindControl("Label13"); command.CommandText = "UPDATE Items SET Quantityavailable = Quantityavailable - '@qty' WHERE productID=@productID"; command.Parameters.Add("@qty", TextBox1.Text); command.Parameters.Add("@productID", labid.Text); command.ExecuteNonQuery(); con.Close(); return true;} private bool ExecuteInsert(String quantity) { SqlConnection con = new SqlConnection();
con.ConnectionString = "Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True"; con.Open(); SqlCommand command = new SqlCommand(); command.Connection = con; TextBox TextBox1 = (TextBox)FormView1.FindControl("TextBox1"); Label labname = (Label)FormView1.FindControl("Label3"); Label labid = (Label)FormView1.FindControl("Label13");
command.CommandText = "INSERT INTO Transactions
(Usersname,Itemid,itemname,Date,Qty) VALUES
(@User,@productID,@Itemsname,@date,@qty)"; command.Parameters.Add("@User", System.Web.HttpContext.Current.User.Identity.Name); command.Parameters.Add("@Itemsname", labname.Text); command.Parameters.Add("@productID", labid.Text); command.Parameters.Add("@qty", Convert.ToInt32(TextBox1.Text)); command.Parameters.Add("@date", DateTime.Now.ToString()); command.ExecuteNonQuery(); con.Close(); return true; }protected void Button2_Click(object sender, EventArgs e){ TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox; ExecuteUpdate(Int32.Parse(TextBox1.Text) );}protected void Button2_Command(object sender, CommandEventArgs e) { if (e.CommandName == "Update") { TextBox TextBox1 = FormView1.FindControl("TextBox1") as TextBox; ExecuteInsert(TextBox1.Text); } } Thanks so much if someone can!Jon
View 3 Replies
View Related
Nov 7, 2007
Hi does anybody know how to programmatically convert an SQL Server table into a dbf or an excel spreadsheet? I'm using C#. Also, i need to put the new table into a different folder. Thanks.
View 3 Replies
View Related
Mar 17, 2008
Hello boyz and girlz,
Little question:
I want to write the current date and time into a database with following code:
Dim time As DateTime
time = DateTime.Now
connection.Open()
cmd.CommandText = "INSERT INTO tblOpmerkingen(Time )values('" + time + "')"
cmd.Connection = connection
But: My "time" is DD/MM/YYYY HH/mm/SS
and in my database time = MM/DD/YYYY HH/mm/SS
can somebody help me?
thanx
View 6 Replies
View Related
Aug 17, 2004
I am getting a "Syntax error converting the varchar value '10,90' to a column of data type int." error when I run the following procedure:
@myList varchar(200)
SELECT column1
FROM table1
WHERE table1.ID IN (@myList)
When @myList is a single value, I get no errors. However, when @myList is a comma separated list like in the message above, I error out. I am using SQL Server 2000.
How else can I build this list of IDs? Thank you in advance for your comments.
--Colonel
View 2 Replies
View Related
Jan 14, 2005
Hello,
I have a problem converting nvarchar into numeric into a stored procedure
I've tryed:
select @ispID=convert(numeric,SUBSTRING(@isprstr1, @j+1,@i-1))
and also
select @ispID=cast(SUBSTRING(@isprstr1, @j+1,@i-1) as numeric)
but I always get the message "Error converting data type nvarchar to numeric."
I've checked the Substring returns only digits
Can somebody help me please?
Thanks
View 1 Replies
View Related