I had an earlier problem updating a field in a sql table witha decimal which was sorted. I am now having the problem again.
In the SQL table my field is type numeric and scale 2
In my asp.net code I have stepped through the running code and the value is 77.50
However when the sp updates the table it is stored as 78.
Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?
I am working with a legacy SQL server database from SQL Server 2000. I noticed that in some places that they use decimal data types, that I would normally think they should be using integer data types. Why is this does anyone know?
Example: AutomobileTypeId (PK, decimal(10,0), not null)
I am creating a table on SQL Server. One of the columns in this new table contains whole integer as wells as decimal values (i.e. 4500 0.9876). I currently have this column defined as Decimal(12,4). This adds 4 digits after the decimal point to the whole integers. Is there a data type that will have the decimal point only for decimal values and no decimal point for the whole integers?
I would like to cast (convert) data type decimal(24,4) to decimal(21,4). I could not do this using standard casting function CAST(@variable as decimal(21,4)) or CONVERT(decimal(21,4),@variable) because of the following error: "Arithmetic overflow error converting numeric to data type numeric." Is that because of possible loss of the value?
I wanted to convert a dataset from vb.net (2.0) to an .XLS file, by MS Jet. My national standard is using decimal commas, not decimal points for numbers signing the beginning of decimal places. But the MS Jet Engine uses decimal point,in default. Therefore, in the Excel file only string formatted cells can welcome this data, not number formatted. How can I solve or get around this problem? (with jet if it possible) iviczl
I'd like to convert a Decimal value into a string so that the entireoriginal value and length remains intact but there is no decimal point.For example, the decimal value 6.250 is selected as 06250.Can this be done?
I am designing some reports for a German branch of my company and need to replace decimal point with a comma and the thousand comma seperator with a decimal point.
e.g. ‚¬1,500,123.00 to ‚¬1.500.123,00
Is there a property that I can change in the report designer to allow this to happen or is this something I need to convert in a Stored Proc.
I am having a file in which amount fields are given in a Packed Decimal format. Can anyone suggest me how I can read this data element from the file and convert it into SQL decimal datatype.
File is a fixed length. All the amount fields are given in Packed Decimal Format and rest of the fields are given in text format. How can i identify and convert only those packed decimals using SQL/.Net.
Example : a row in a file that has some packed decimals 158203508540188236252EUR20BZK0030 Ĺ“& 20060715 0001010100010101
Anybody noticed that SQL Server rounds up if the value is half waybetween two rounded values, but C#'s Decimal.Round(Decimal,Int32)rounds to nearest even number?[color=blue]>From MSDN: "When d is exactly halfway between two rounded values, the[/color]result is the rounded value that has an even digit in the far rightdecimal position. For example, when rounded to two decimals, the value2.345 becomes 2.34 and the value 2.355 becomes 2.36. This process isknown as rounding toward even, or rounding to nearest."I perform the same calculation sometimes on the web server in C# andsometimes at the database in T-SQL, but want to get the same resultfrom both calculations. Could anybody offer any strategies for dealingwith this?Thanks ~ Matt
I need to store a user ID of whoever made the last change to a record in a table. I have added a field with a default set to 'suser_sid()'.
Is it wise to store SID's in a database table if you are using NT authentication? My concerns are that if the user is deleted by the NT system administrator then I lose data integrety also if the database is backed up and restored onto a different machine with different users it won't work at all.
Hi, can someone help me with this problem. I have recently downloaded VWD and have been playing around with it a bit. I was windering how do I add an image file to a SQL database. I have used SQL in the past but I have never store an image in it. I can add text data and so forth, but I need some pointers into adding images to the sql database. I want to be able to store the images and then retrieve them to a GridView. I have the images in an image folder within the website, but I do not know how to input the reference or link to the images in an sql table. A quick example, say I have a table called Images, with the following info:imgID (int)imgDesc (varchar(max)imgFile (img)imgTitle (varchar(20)) To input this in sql I would write Insert Into Images (imgDesc,imgFile,imgTitle) Values ("Large fishy", "", "The Big Fish") what would I need to put for imgFile? I would really appreciate if someone can point me in the right direction.
Hi all! I am back with a new problem. I am designing a database in which the booking is on an hourly basis instead of daily basis. So I want my colums in a table to be like this: ================================ID(PK)Date(In this table I want date only)TimeSlot(in this table I want time only)CourtNo(facility which is to be booked)Booking ID(FK to booking table)================================
The thing is that SQL server donot have a date only format. I am totally stuck on this one, please help! The database which I created will be ideal if I can just store the date! Regards, Taimoor
Hi All,Does anybody know how i can store a paragraph with spaces, newline, empty lines in a sql server 2005 database table? What data type should i declare the table entry to take? I will also like to retrieve the data with what ever i would have stored it with.
My forms are taking user input, then HtmlEncoding them prior to being stored in the SQL DB. For some reason, SQL is storing quotes as � and it is causing the HTML when decoded in the page to not be rendered properly.
Has anyone come across this issue before?
For example (without encoding for readability):
SQL should store the parsed string as: <a href="someurl" class="main">
but for some reason it's being stored as: <a href=�someurl� class=�main�>.
Does anyone have thoughts or know of resources that explain the pro's and con's of storing images in a database versus keeping the image in the file system and just storing the path to the image in the database?
Hello All! Can some one give SQL Statement on storing images from disk to the database columns. Once I store the image how do I test it out that the image is stored correctly? For example this is what I did I have a table called table1., field called name
insert into table1(name) values(C:123.bmp)
Is the above statement correct? will it store the file or not?
if it does store them then how do I view them?
Can some one please help me... Thanks in advance for your help Venkat
best way to store questionnaire data in a database.Since different questionnairs have different questions and formats i.e dropdown, radio, checkboxes etc building such a database model becomes highly complex.
I've read that if data schema is complex and higly variable it may be better to use an xml document and store that in a databse. However I dont quite understand how you store xml to a database. Do you simply store the entire structure in something like a nvarchar column or is there some other way to store xml to a database.
If you store the entire structure to the databse then how do you query the content to generate reports.
I use SQL 2K with an Access 2000 project as front end. I have four date fields in a table. The first one should contain a date (eg 20th of February), the second one a starting hour (eg 8:00h), the third one the finishing hour (eg 10:00h) and the fourth should calculate the difference between the second and third column. So I created four datetime fields. Storing a date in the first column is no problem, but storing only hours doesn't seem to do what I want. When I enter 8:00 from within the Access, it is stored 1/1/1900 8:00 in SQL Server. How can I make sure that the hours are saved with the date of the second column, so either as 8:00 without further information or as eg 20-2-2004 8:00?
I'm having a DB designed for me, and I'm inspecting it and wondering what in general is the better way to do this.
We have a product, which we are counting "product views". The DB designer has created columns called "view_today" and "views_alltime".
I specified I wanted a normalized database, I'm thinking this is technically not normalized ? Am I correct ?
Wouldn't it be better to have a query that counted the views off the logging table ? I can't see any advantage to doing it the way its been designed except to save time.