Forum Replies Created

Viewing 14 posts - 91 through 104 (of 104 total)

  • RE: Need help in creating a back end support for a new project

    Table1

    create table usertbl

    (

    userid int identity(100,1) primary key,

    username varchar(50),

    parentid int foreign key references usertbl(userid),

    product varchar(50),

    pValue decimal(7,2)

    )

    Table2

    create table userscore

    (

    userid int foreign key references usertbl(userid),

    score int

    )

    CREATE TRIGGER updating on usertbl for insert

    as

    begin

    declare...

  • RE: format getdate() to produce "yyyymmddhhnnss"

    nabajyoti.b (12/23/2008)


    Thanks...

    well, i tried to find out all the styles

    by using below code:

    declare @style int

    set @style=1

    while @style <= 500

    begin

    print CONVERT(CHAR(100),GETDATE(),@style)

    set @style=@style + 1

    end

    however i did not get 20081223...

  • RE: Query to Calculate Cumulative Salary

    vbandlamudi (12/23/2008)


    Correct Answer

    Select id,name, sal, cumsal=

    (select sum(t1.sal)

    from employee_san t1

    where t1.id <= t.id)

    from employee_san t

    This works fine.

    But the salary is not ORDERed BY ASC

  • RE: Need help in creating a back end support for a new project

    Chirag (12/23/2008)


    Hi

    I feel you need only one User table. Columns - UserID,Name,ParentUserID.

    Whats the logic behind Right & Left. Wont knowing the parent of the user suffice?

    Ok I created the...

  • RE: Query to Calculate Cumulative Salary

    Jeff Moden (12/22/2008)


    This is what Vladan is talking about...

    --===== Move just the data we want to a place where we can work on it

    SELECT ISNULL(Sal,0) AS Sal,

    ...

  • RE: Query to Calculate Cumulative Salary

    Jeff Moden (12/22/2008)


    This is what Vladan is talking about...

    --===== Move just the data we want to a place where we can work on it

    SELECT ISNULL(Sal,0) AS Sal,

    ...

  • RE: Query to Calculate Cumulative Salary

    r.hensbergen (12/22/2008)


    Thanks for the input, though there were some flaws in it that made it a bit unclear what is desired exactly. Here I changed the input a bit, let...

  • RE: How to know "At what time the command is executed"

    Truncate is logged.

    Basically you need to find a 3rd party log reader like Lumigent's LogExplorer[/url]

    In reality you will probably need to restore the database to before the truncate...

  • RE: How to know "At what time the command is executed"

    Roy Ernest (12/9/2008)


    That is going to be tough. Truncate table does not make any entry in the Log file if I am not mistaken. Do you have traces running that...

  • RE: How to know "At what time the command is executed"

    Thanks jones,

    But

    I am not the member of sysadmin and I think there is no access for me to see all these things.

    As said in articel,

    "to check the default trace to...

  • RE: Things to be well aware to become a DBA

    Jerry Hung (12/4/2008)


    It's a never ending journey, but you being here curious on SSC is a good start!

    Keep working hard at it and enjoy it

    Thanks Jerry,

    I will try my best...NO...I...

  • RE: Things to be well aware to become a DBA

    Hi,

    Thanks for the reply.

    Yes it takes a lot of time to become a DBA.

    Let my day 1 start from today....

    and

    What is this PASS?

    Thanks

  • RE: Aggregate function SUM gives some junk value

    Also consider the values

    1234.56

    3456.67

    45.67

    78.34

    0

    0

    -1234.56

    -3456.67

    -45.67

    -78.34

    The SUM of above must be equal to zero.

    but at 1st execution it will show 0

    next execution it will show -2.71243434E-11

    next execution again -2.71243434E-11

    next execution 0

    like that.

    So...

  • RE: Aggregate function SUM gives some junk value

    Thanks Gila,

    Actually these types of result are affecting the production in one or other way.

    some batches will be having a query like

    WHERE col = '0'

    in...

Viewing 14 posts - 91 through 104 (of 104 total)