Forum Replies Created

Viewing 15 posts - 301 through 315 (of 337 total)

  • RE: two insert statments takes long time to process

    dlam 18073 (11/16/2010)


    I dont get it. clientNumber in tblClientList is primary key.

    can you tell me abit more in detail. thx!!

    Then why are you checking whether the clientNumber exists?If there is...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: two insert statments takes long time to process

    Seems you have overcomplicated things here.You are inserting into tblClientList after selecting from tblOrder and then checking in tblClientList whether it exists or not.

    Wont just having an unique key on...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: BOM Summation

    This has to be one of the most dreadful query I have ever designed.The query assumes that Itemcode for treetype="I"

    are not same.

    DECLARE @t TABLE(

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: BOM Summation

    Just ignore my previous post 🙂

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: BOM Summation

    martin.edward (11/16/2010)


    Great Question Sachin,

    When you have multiple instances of 'S' this is what the data should look like

    itemcode qty treetype linenum

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: BOM Summation

    martin.edward (11/10/2010)


    Dear Experts,

    I have quite a problem here :-

    I am trying to add up data that sits on tables as some kind of hierarchy. The data is...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: top without using TOP

    Learner1 (11/15/2010)


    Hi,

    Can I get the 10th highest salary without using TOP or RowNumber() over partition?

    Since you specifically mentioned not to use RowNumber() over partition I am getting the result...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: is there any way to send the variable to DROP TABLE statement

    I wonder is it sensible to use dynamic SQL for deleting a table considering the dangers of SQL Injection.

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Index Fragmenaton linked wth Table

    For a start have a look at the below query

    select o.name TableName,i.name IndexName

    from sys.sysobjects o inner join sys.sysindexes i

    on i.id=o.id where o.xtype='U' and i.FirstIAM is not null

    and i.name is not...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Query of rg1

    I dont think anyone is going to dig into your query and try understanding what you are trying to acheive.

    You need to post some sample data and expected o/p.

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Pivot Query Question

    joshtheflame (11/14/2010)


    Sachin great work 🙂 just need four things and it will be perfect cause i am trying to change but it has error...not good with sql though.

    1. I've lost...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Pivot Query Question

    It will work assuming the query will be executed against just one month .

    create table #tbl (Task_id int,Task_Date datetime,Task_count int)

    insert into #tbl

    select 1,'2010-10-01 00:00:00', 10 union

    select 1,'2010-10-02 00:00:00', 20 union

    select...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Pivot Query Question

    What about multiple months?How will o/p appear for October and November together in the sample data I have used?

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Pivot Query Question

    create table #tbl (Task_id int,Task_Date datetime,Task_count int)

    insert into #tbl

    select 1,'2010-10-01 00:00:00', 10 union

    select 1,'2010-10-02 00:00:00', 20 union

    select 2,'2010-10-01 00:00:00', 1 union

    select 1,'2010-11-01 00:00:00', 50 union

    select 1,'2010-11-02...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Pivot Query Question

    joshtheflame (11/14/2010)


    do one thing plz...I have the following data in TASK_DETAIL...IN TASK_MASTER..u can create just two records with the following n test..results are strange..

    task_id.......task_name

    -----------------------

    1 ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

Viewing 15 posts - 301 through 315 (of 337 total)