Forum Replies Created

Viewing 15 posts - 361 through 375 (of 569 total)

  • RE: sqlcmd outputs too many deciaml places

    Kelvin Phayre (6/16/2009)

    Why is sqlcmd doing this?

    Hi,

    Post your statement and the table schema to better assistance in this issue

    ARUN SAS

  • RE: To write a query

    Hi,

    not clear in the table

    create #tableA

    (

    ID1 int,

    name1 varchar(10)

    )

    create #tableB

    (

    ID2 int,

    Address varchar(10)

    )

    then what is the relation of these two table?

    (it Should be some reletion like ID1 = ID2)

    to get

    id...

  • RE: CONVERT & CAST

    sqluser (6/12/2009)


    DECLARE @test-2 int

    SET @test-2 = 10.00000

    SELECT STR(@Test,5,2)

    Hi,

    test the date

    DECLARE @test-2 int

    SET @test-2 = 1000.00000

    SELECT STR(@Test,5,2)

    what happened?

    ARUN SAS

  • RE: Query help

    Hi,

    just try this,

    select Range,YearofValue,

    (case when Baseprice1 > 0 then '1'

    when Baseprice3 > 0 then '3'

    when Baseprice8 > 0 then '8'

    when Baseprice9 > 0 then '9' end )months

    from #temptable

    ARUN SAS

  • RE: Query help

    hi,

    try this

    A) find the MIN yearofValue by Range, and then the 1st baseprice that is > 0.

    select Range,min(yearofValue)

    from #temptable

    where Baseprice1 >0

    group by Range

    B) And then find the MAX yearofvalue...

  • RE: How to make two Tables in sync

    Hi,

    try this

    create table #temp1

    (

    name1 varchar(10)

    )

    create table #temp2

    (

    name1 varchar(10)

    )

    insert into #temp1

    select 'ABCD'

    union all

    select 'BCDA'

    insert into #temp2

    select 'CDAB'

    union all

    select 'DABC'

    insert into #temp1

    select name1 from (

    select name1 from #temp1

    union

    select...

  • RE: Separation

    Hi,

    try this

    /*

    create table #temp

    (

    Value varchar(10),

    ID1 int

    )

    insert into #temp

    select 'XXXX',1

    union all

    select 'YYYY',2

    union all

    select 'ZZZZ',3

    union all

    select 'AAAA',3

    select * from #temp

    */

    select id1,max(value) from #temp

    group by id1

    having count(*) = 1

    union all

    select id1,(max(Value)+','+min(Value))value from...

  • RE: UDF

    Nkagisang Bosaletse (6/10/2009)


    when I try to print the card for one trader it prints as many cards as the products that he's selling. What can I do, to make sure...

  • RE: query?

    Hi,

    Don't edit am working with the old statement,

    however try this

    -- create table #temp1

    -- (

    -- datetime1 datetime,

    -- View1 int

    -- )

    -- insert into #temp1

    -- select '2009-06-01 00:00:00.000 ',1

    -- union all

    -- select '2009-06-01...

  • RE: To find out how a table is updated

    weirdlNet (6/9/2009)


    So now I am trying to figure out how/where/who executed the

    store proc (I assume it is a system store proc :unsure:) Does anyone have idea how I can...

  • RE: Query:

    Hi,

    try this

    create table #ID

    (

    ID1 int,

    Name1 varchar(2)

    )

    insert into #ID

    select 1,'A'

    union

    select 2,'B'

    union

    select 3,'C'

    create table #EVENT

    (

    id int,

    Event_Id int,

    user1 varchar(2)

    )

    insert into #EVENT

    select 1,10,'X'

    union

    select 1,20,'Y'

    union

    select 1,30,'Z'

    union

    select 2,10,'M'

    union

    select 2,20,'N'

    union

    select 2,30,'O'

    union

    select 3,10,'P'

    union

    select 3,20,'Q'

    union

    select 3,30,'R'

    --select * from #id

    --select...

  • RE: How to run generated script in stored procedure

    rafejeyaraj (6/9/2009)


    Still in Same problem.

    Hi,

    Then undependably check this all create table statement works with out error

    Like

    CREATE TABLE [dbo].[tblOrder](

    [Order_ID] [int] NOT NULL,

    [Order_Date] [datetime] NULL,

    [Customer_SID] [int] NULL,

    CONSTRAINT [PK__tblOrder__09DE7BCC] PRIMARY KEY CLUSTERED...

  • RE: How to run generated script in stored procedure

    rafejeyaraj (6/9/2009)


    Msg 156, Level 15, State 1, Procedure spAuthentication80, Line 6

    Incorrect syntax near the keyword 'null'.

    Msg 170, Level 15, State 1, Procedure spAuthentication80, Line 10

    Line 10: Incorrect syntax near 'END'.

    Msg...

  • RE: How to run generated script in stored procedure

    Hi,

    Compile the attached sp, and then post the error.

    ARUN SAS

Viewing 15 posts - 361 through 375 (of 569 total)