Forum Replies Created

Viewing 15 posts - 16 through 30 (of 40 total)

  • RE: Arithmetic overflow error converting nvarchar to data type numeric.

    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...

  • RE: How to select the inherited values in hierarchical data structure is efficient way

    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...

  • RE: Arithmetic overflow error converting nvarchar to data type numeric.

    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...

  • RE: Arithmetic overflow error converting nvarchar to data type numeric.

    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...

  • RE: Enumerator cannot enumerate multiple Excel files/worksheets

    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...

  • RE: Data Warehouse Development: Version 0

    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...

  • RE: Foreign Keys

    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...

  • RE: Foreign Keys

    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...

  • RE: T-SQL

    As mentioned earlier, after executing the above code,

    Go to

    DataBases -> SystemDataBases -> tempdb -> TestTable -> Columns .

    You can see that column C1 is created with type...

  • RE: T-SQL

    I am sorry i couldn't get your question. Can you pls explain you question in detail.

    Thanks

  • RE: T-SQL

    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...

  • RE: Scaled-down SQL

    Excellent question and nice explanation..

    Learned something new that Precision and Scale varies for the resulting value

    based on (+, -, / , *, [UNION | EXCEPT | INTERSECT] , %...

  • RE: T-SQL

    Hi Sutha,

    Still you have same issue in SQL Server 2005 using old method.

    Try this and compare the results.

    select * into #D1 from (

    select '1' as c1,'A' as c2

    union

    select '','B'

    ) T

    select...

  • RE: T-SQL

    Hi pksutha,

    Let me explain little more..

    insert into #test values ('1','A'), ('','B')

    is not same as below.

    insert into #test values('1','A')

    insert into #test values ('','B')

    The former insert statement in introduced in 2008 and...

  • RE: T-SQL

    The question is " What is the output of the select statement from the below code

    executed in sql server 10.0.1600 and with default settings " and not in SQL...

Viewing 15 posts - 16 through 30 (of 40 total)