All Questions
Tagged with numeric sql-server
69 questions
0
votes
0
answers
15
views
Why does this new column infection_rate all show 0s? [duplicate]
Just as the title says. If I had to guess, I would think maybe it's because the values are too small and they're getting rounded off to 0? But then that wouldn't make sense because with the values ...
-1
votes
2
answers
135
views
confuse SQL Server datatype decimal over 15 digit after comma
I have table with structure as follow :
Table1 (
id int NULL,
description varchar(50) null,
rate decimal(18,15) NULL
)
and when I test insert data into the table problem value like this :
...
1
vote
1
answer
70
views
SQL: How to resolve varchar numeric conversion using OUTER APPLY and SELECT TOP (1)?
I have a base table with invoices for different stock codes, the important fields are:
StockCode
InvoiceDate
AAA
2022-01-01
AAA
2022-05-01
BBB
2022-02-01
BBB
2022-11-01
I am trying to work back to the ...
0
votes
2
answers
818
views
SQL Server : generate random numeric string 27 characters long
I need to insert random data in my database for testing, and would need to generate a numeric string (can start with 0) 27 characters long.
I've been looking into NEWID() but it contains also letters, ...
-1
votes
1
answer
783
views
SQL query is returning null values after join where there should be numeric values
I am inserting some data from an existing table into a new table. There is a specific column called DescNitro which is either returned as 0 or Null in the new table. I've checked specific cases and ...
0
votes
2
answers
155
views
Varchar type to numeric. Convert Years to months in SQL (SSMS)
I am trying to convert both of the columns TOJ and TAR to a numeric number without MOS and YRS characters.
For example, 18 YRS 0 MOS needs to be (18 * 12 + 0 = 216 months).
Table name is ld2.
TOJ
TAR
...
0
votes
2
answers
515
views
SQL Server Management Studio error converting a string that does not exist
I have a table with a varchar column that has any kind of values. I wanted to filter only numeric values and than compare them with other Numbers. But I always get:
Error converting varchar value &...
0
votes
0
answers
8k
views
ODBC Driver 17 for SQL Server]Numeric value out of range on Windows
I am using pyodbc to push the data from a csv file into my database. the csv file has the following structure ( showing only 2 rows)
df
vendor FGW prn part stp ...
0
votes
1
answer
224
views
0.3 is converted to 0.300000011920929 in SQL Server when adding from .NET Entity Framework [duplicate]
I have a table in SQL Server that has a column with datatype float. I wrote a stored procedure for inserting the record and it also accepts the parameter as float.
However Entity Framework generated ...
1
vote
2
answers
444
views
SQL / Celonis - where field only contains just numeric, remove anything else
In a field I want to keep those where it is only a number between 100000 and 999999
This field has a mixture of numeric, alphanumeric, alphabet characters.
This function will keep if there is a number ...
0
votes
0
answers
34
views
SQL:Atithmeic overflow error, casting and try casting not solving the problem
I am currently working on a solution to update a variable in large quantity. However I am running into a problem. I am getting the follow error while executing my query:
Arithmetic overflow error ...
0
votes
1
answer
146
views
Microsoft SQL Server : numeric constants precision
I'm puzzled by the lack of precision in this result:
select convert(numeric(11, 10), 1 / 3.0)
0.3333330000
Why only six decimal places when I asked for ten? Here I wrote 3.0 instead of 3 to force ...
0
votes
3
answers
4k
views
Error converting data type nvarchar to real
I need to subtract two nvarchar values and store the result in another column. I understand that first I need to convert nvarchar to numeric values, but I always get this error
Error converting data ...
0
votes
0
answers
56
views
TSQL converting varchar to int - numeric say 1 and I get a point '.' at the end of the varchar?
I am facing a problem with the convertion of a varchar in a numeric value.
I have following SQL Code
DECLARE @Test varchar --f.e. '12345'
DECLARE @TestNum int
.......
IF ISNUMERIC(@Test)=1 then
...
0
votes
3
answers
3k
views
SQL how to sort text with numbers alphabetically, then numerically
I have a table that has alphanumeric values. I'd like to order them alphabetically then numerically. I'm editing the question for more help... I only need the numbers at the end of the string to be ...