Viewing 15 posts - 16 through 30 (of 40 total)
You are trying to order the varchar column and not numeric though the value looks numeric.
Try
--Query 1
select
price
from table
order by CAST(price as numeric(10,4)) asc
--Query 2
select price from (
select CAST(price...
October 14, 2012 at 5:39 am
Hi,
Thanks for your reply. Pls see the ddl scripts and expected output below.
CREATE TABLE [State](StateID varchar(10), Name varchar(50),ProfileID int)
CREATE TABLE Region (RegionID varchar(10), Name varchar(50),Parent_RegionID varchar(10), StateID varchar(10), ProfileID int)
CREATE...
October 14, 2012 at 12:26 am
no. '1000' is precision 4. so you can have numeric(4,0). ie 4 decimal values in the left of decimal point and not numeric(1000,7)
Ref: http://msdn.microsoft.com/en-us/library/ms187746.aspx
You can understand what is...
October 13, 2012 at 12:39 pm
Hi,
In the expression [price * 1.1], SQL Server tries to implicit convert price into numeric(2,1) because 1.1 is type numeric(2,1) which has higher precedence than nvarchar. I think your...
October 13, 2012 at 12:01 pm
Hi,
I havn't tried this before using inner For Each loop but pls try using script component to assign the file collection paths for all excel files and sheets and use...
April 4, 2012 at 12:38 am
Thanks for posting this article. I am new to DW project and in learning stage. I think the series of this article takes me in the right path.
Please suggest...
April 7, 2011 at 6:52 am
Yes. I mean to say the same that we cannot achieve FOREIGN KEY relation just by creating nonunique clustered or nonunique nonclustered index.
And its TRUE even by creating unique...
April 6, 2011 at 3:17 am
Nice Question. I would like to add some more point. The primary requirement for foreign key constraint is uniquenes in the referenced table. This uniqueness is acheived by creating unique...
April 5, 2011 at 11:14 pm
Bradley,
You are right. The datatype is determined by the order of precedence as explained in http://msdn.microsoft.com/en-us/library/ms190309.aspx . Thanks for pointing out this and i apologize everyone for...
March 23, 2011 at 12:04 am
Excellent question and nice explanation..
Learned something new that Precision and Scale varies for the resulting value
based on (+, -, / , *, [UNION | EXCEPT | INTERSECT] , %...
March 22, 2011 at 8:05 am
Viewing 15 posts - 16 through 30 (of 40 total)