Forum Replies Created

Viewing 15 posts - 331 through 345 (of 761 total)

  • RE: Help please for total Newbie to MS SQL re: Transform

    You can use a Dynamic Pivot as follows:

    --Creating Tables

    Create Table Ex

    (IDint,

    rbNumber int,

    rbTypevarchar(20),

    rbBookdatevarchar(20),

    rbBookTypeChar(1),

    rbBookRef varchar(20) )

    --Inserting Sample Data

    Insert Into Ex

    Select 403,7,'Standard Double','02 June 2012','B','447361938'

    Union ALL

    Select 402,7,'Standard Double','01...

    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: Sum two tables

    You can do it like this:

    Select a.year, a.week, SUM(a.total_savings) From

    (Select * From Ex

    union

    Select * From Ex1) As a

    Group By a.year, a.week

    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: Need help on Pivot

    Here are a few versions of doing it:

    --Creating Table

    Create Table Ex

    (cusid int,

    name varchar(3),

    email varchar(20) )

    --Inserting Sample Data

    Insert Into Ex

    Select 111,'abc','abc@xyz.com'

    union ALL

    Select 222,'aaa','aaa@xyz.com'

    union ALL

    Select 222,'aaa','aaa1@xyz.com'

    union ALL

    Select 222,'aaa','aaa2@xyz.com'

    union ALL

    Select 222,'aaa','aaa3@xyz.com'

    union...

    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 the data into two different tables from one table

    KpSQL123 (6/6/2012)


    It is one time requirement

    In that case you can use any of the ways.

    If you use TSQL, you would have to make sure to do it at some time...

    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: Eliminating Duplicate Rows

    Sorry, I fail to understand the logic used for your output. Why isn't "TRU-90-JK" in the output? And why do you have so many rows for "YTH-12-MU"?

    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: Eliminating Duplicate Rows

    Are you using MSSQLServer??.....Doesn't look like it to me

    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: Help please for total Newbie to MS SQL re: Transform

    Sorry, one of us is missing out on something. What is the problem???....How do you want your resultset to look like?

    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: SQL Database Synchronization Help

    If the Database at the Primary Server gets updated every 2 seconds and you want the Db at the Secondary Server also to get updated the may be you should...

    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: Data should be merged according to same criteria in the column

    I have Office2003. It says File Format Not Recognized when I try to open your attachment.

    I'll make this as simple as I can.

    You are looking at some tables and some...

    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 the data into two different tables from one table

    KpSQL123 (6/5/2012)


    Thanks for your reply...If i have lakhs of records how can i load

    Is it a one time Requirement or a Regular thing??....If it is a one time requirement then...

    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: creating pivot tbl

    rVadim (6/5/2012)


    I still haven't understood what you are trying to say. Can you come up with a better explanation of what you want to do?

    (S)he probably runs your entire code...

    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: Data should be merged according to same criteria in the column

    ankita.vinculum (6/5/2012)


    I have tried to open ur link from google chrome as well as ie explorer but getting same issue on both - "Webpage cannot be display".

    I checked it agaiun...

    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 the data into two different tables from one table

    Like This:

    --Creating Tables

    Create table Ex

    (empno int,

    empname varchar(30),

    empsalint,

    Rownum int )

    Create table Ex2

    (empno int,

    empname varchar(30),

    empsalint,

    RowNum int )

    Create table Ex3

    (empno int Identity(300,1), --Create...

    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: Eliminating Duplicate Rows

    Well, I can't see from here what data you have in your tables to know what your query is doing.

    For me to give an opinion there needs to be sample...

    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: Data should be merged according to same criteria in the column

    ankita.vinculum (6/5/2012)


    Hi,

    Thanks for ur rep.

    Is this ur link - "How to post data/code on a forum to get the best help" - Jeff Moden

    I had tried to open this...

    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 - 331 through 345 (of 761 total)