Forum Replies Created

Viewing 15 posts - 376 through 390 (of 761 total)

  • RE: Need help on transposing rows into columns

    This might help:

    --Creating Table

    CREATE TABLE Ex

    (

    [Task] [varchar](10) NULL,

    [WeekStart] [date] NULL,

    [PercentageProductivity] [int] NULL)

    --Inserting Sample Data

    Insert Into Ex

    Select 'Task1', '2012/05/19', 40

    Union ALL

    Select 'Task1', '2012/05/26', 100

    Union ALL

    Select 'Task2', '2012/05/26', 30

    Union ALL

    Select 'Task2', '2012/06/02',...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Multiply two columns in SQL nd store

    You can use a CTE to update your table as follows:

    --Creating Table

    Create Table Ex1

    (idint,

    product int,

    price int,

    qty int,

    total int)

    --Inserting Sample Data

    Insert Into Ex1(id, product, price, qty)...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: from query results I need to group distinct data that has records in common.

    This might help:

    --Creating Table

    Create Table Ex1

    (Col1 int,

    Col2 char(1) )

    --Inserting Sample Data

    Insert Into Ex1

    Select 1, 'a'

    Union ALL

    Select 2, 'a'

    Union ALL

    Select 1, 'b'

    Union ALL

    Select 3, 'c'

    Union ALL

    Select 1, 'd'

    Union ALL

    Select 2,...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: insert values in table

    riya_dave (5/29/2012)


    thanks everyone

    You're welcome 🙂

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Conditional Aggregation

    sridhar_kola (5/29/2012)


    I think you have not understood the requirement. Your CTE will give the difference between previous and current time. But the requirement is to get the time difference from...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Conditional Aggregation

    sridhar_kola (5/29/2012)


    Lets say I have a table as

    MIDTime (Hh:Mm)

    M110:22

    M112:15

    M113:22

    M116:00

    M117:50

    I need to aggregate the counts for MID(M1) based on the condition "to aggregate values that are beyond 2 hrs window"

    So...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: In Memory Database

    You can't specifically create an in memory table in SQL Server.

    Why??

    Because, SQL Server uses an advanced caching mechanism that ensures that frequently accessed data will normally remain in the data...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Use a second table to make selections from another table

    Yes, on a larger set of data your method works better.

    I had checked the stats on the same data set that the OP supplied....on that set the stats for both...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Use a second table to make selections from another table

    You can also do it using simple sub queries:

    --Creating Tables

    Create Table Table1

    (ID int,

    SYMBOL varchar(10),

    DATE Date, PRICE Float,

    VOLUME int )

    Create Table Table2

    (ID int,

    SYMBOL varchar(10),

    COMPANY varchar(50),

    ...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Nested & Correlated Queries

    Stewart "Arturius" Campbell (5/28/2012)


    Try using a LEFT JOIN instead

    +1 Stewart.

    LEFT JOIN would do it.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: How can i know which columns are ununsed in my table?

    Please explain about what "columns" you have in mind, and who is "using" them.

    Are you suggesting that some dynamic procedure is executing and you want to know which columns it...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: insert values in table

    This will work:

    --Creating table

    Create Table Ex

    (ac varchar(30) )

    --Insert Query For Your Requirement

    Insert Into Ex Values('Account''s Value')

    --Checking the Inserted Value

    Select * From Ex

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Replacement for Cursors

    I tried executing the following example from your link:

    CREATE TABLE #temp (DB sysname, [Schema] sysname, Routine sysname);

    INSERT INTO #temp

    EXECUTE OVER_SET '

    SELECT ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME

    ...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: Replacement for Cursors

    RBarryYoung (5/26/2012)


    vinu512 (5/4/2012)


    I give up...I've banged my head on this for really long....I have come to the conclusion that a loop cannot be avoided in this scenario.

    However un-SetBased( 😛 )...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • RE: A cursor with the name 'CursorName' already exists.

    Is the Cursor being Deallocated after it has been used in the Trigger??

    EDIT: Sorry didn't read the original post.

    But, on second thought I would still ask the above question.

    You just...

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

Viewing 15 posts - 376 through 390 (of 761 total)