Forum Replies Created

Viewing 15 posts - 286 through 300 (of 337 total)

  • RE: Averaging data streaks

    keymoo (11/22/2010)


    Thanks it doesn't give me the correct results for dates that are the same. Is there a tweak needed to do that?

    Please post some sample data and expected result...

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

  • RE: deleting huge records From Table

    Jeff Moden (11/22/2010)


    I agree. Just to be clear for folks that may think of doing it, don't ever shift from FULL recovery to SIMPLE recovery for the sake of...

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

  • RE: Averaging data streaks

    ;with cte

    as

    (

    select *,ROW_NUMBER()over(order by (select 1))-row_number()over(partition by winloss order by winloss)rid from

    (

    select

    tradeDateTime,[tradeId]

    , case when [profit] >=0 then 'W' else 'L' end as WinLoss

    ...

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

  • RE: Getting Weekdays date between a specified date range

    OR something like this

    declare @StartDate datetime = '2010-11-22'

    declare @EndDate datetime = '2010-12-22'

    ;with DateSequence

    as

    (

    select @StartDate Date

    union all

    select Date+1 from DateSequence where Date<@EndDate...

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

  • RE: SQL Book

    jagirdba (11/20/2010)


    Hi Folks,

    I am currently preparing for SQL DBA job interview. Can somebody please suggest a good book to study.

    I would really appreciate it.

    Thank you

    I am appearing for an interview...

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

  • RE: Table Normalization

    parivedamohan (11/20/2010)


    Hi All,

    I am new to the Database world.

    I would be very happy if any body Normalize the below table, which is in First Normal Form (1NF).

    Table:

    CREATE...

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

  • RE: Want to append two different text values with a result set!

    DON'T cross post.

    http://www.sqlservercentral.com/Forums/Topic1023904-391-1.aspx

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

  • RE: best course of action

    Does not make sense to me...

    Can't you just convert the data in uppercase in your application code or in reporting tool where you need to show it?

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

  • RE: How to repeat/or duplicate my results?

    Your Query

    GO 100 🙂

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

  • RE: sql server

    declare @val int

    declare @tblname1 as varchar(50)

    declare @tblname2 as varchar(50)

    set @tblname1='tbl_00001'

    set @tblname2='tblSt_00001'

    exec(';with cte1

    as

    (

    select line,Status_text,Zerox_ID from '+@tblname1+'

    except

    select line,Status_txt,Zerox_file_ID from '+@tblname2+'

    except

    select line,Status_txt,Zerox_file_ID from '+@tblname2+'

    except

    select line,Status_txt,Zerox_file_ID from '+@tblname2+'

    )

    select ' + @val...

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

  • RE: replace credit card numbers with *

    Something like this

    select stuff('5490 1234 5678 9128',1,12,'************')

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

  • RE: Date Time Convertion

    nageshp (11/17/2010)


    SELECT CONVERT(DATETIME,((SELECT CONVERT (VARCHAR,GETDATE(),101))+' ' +(SELECT SUBSTRING (CONVERT(VARCHAR,GETDATE(),109),14,27 ))))

    Output

    11/17/2010 2:01:51:833PM

    Still am not able to remove the milliseconds as it should be below.

    11/17/2010 2:01:51PM

    select CONVERT(varchar(20),GETDATE(),120)

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

  • RE: Need help in writing select query

    declare @Employeetable as table(ID int,Name varchar(20),

    Age int,Country varchar(20),

    Manager varchar(20),Status varchar(20));

    insert @Employeetable

    select 1,'Ravi',29,'IN','Anil','A'union

    select 2,'Balaji',30,'IN','Siju','A'union

    select 3,'Sanjeev',31,'IN','Venkat','A'

    select ID,Name,Age,Value from

    (

    select * from @Employeetable)u

    unpivot (Value for columns in (country,manager,status))v

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

  • RE: Question on Merging two cases

    So what should be the o/p when variable value is ALL?

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

  • RE: Date Time Convertion

    nageshp (11/17/2010)


    select Getdate() display the below format

    2010-11-17 12:59:04:584

    Need the Getdate() or any date in the below format

    11/17/2010 12:59:04 PM (mm/dd/yyyy time )

    Formatting part should always be done in...

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

Viewing 15 posts - 286 through 300 (of 337 total)