Forum Replies Created

Viewing 15 posts - 9,361 through 9,375 (of 26,490 total)

  • RE: "Dynamic" view question

    Mindy Hreczuck (9/24/2012)


    Well I'll try to explain better...

    One solution would be to create a UDF instead of a view and pass in a user guid into that UDF which queries...

  • RE: T-SQL query help

    Yep, just this easy:

    IF object_id('TempDB..#tTemp1') IS NOT NULL

    DROP TABLE #tTemp1

    CREATE TABLE #tTemp1(ID int, Name varchar(20))

    INSERT INTO #tTemp1(ID, Name)

    SELECT 1, 'NewYork'

    UNION

    SELECT 2, 'Virginia'

    UNION

    SELECT 3, 'London'

    UNION

    SELECT 4, 'Sydney'

    UNION

    SELECT 5, 'Dubai'

    SELECT ID,...

  • RE: how to write insert query for this two table with only one parameter?

    Personally, I'd like to know what you have done so far, but here is a solution anyway. I know you have been give some of the code used already,...

  • RE: Consolidating records - TSQL problem

    Abu Dina (9/25/2012)


    Luis Cazares (9/25/2012)


    I know it could be a bad solution, and maybe you had tought about it.

    But since the rCTE is not scaling well (and it sure won't)...

  • RE: Consolidating records - TSQL problem

    Here is my code, reformatted the way I like to it.

    with rCTE as (

    select

    t1.retained,

    t1.dropped,

    t1.retained as TopLevel

    from

    ...

  • RE: Consolidating records - TSQL problem

    Lynn Pettis (9/25/2012)


    Abu Dina (9/25/2012)


    Lynne's solution works if we assume that the retained ID is always the maximum.

    But tthe solution doesn't work with the following record set:

    drop table dbo.testing

    create...

  • RE: Consolidating records - TSQL problem

    Abu Dina (9/25/2012)


    Lynne's solution works if we assume that the retained ID is always the maximum.

    But tthe solution doesn't work with the following record set:

    drop table dbo.testing

    create table dbo.testing...

  • RE: sum every two number combination

    Luis Cazares (9/24/2012)


    I don't have anything to test with, but I believe this could be better.

    However, the problem is that it's still using a cartesian product to obtain the result.

    SELECT...

  • RE: sum every two number combination

    Can TotalDue every be less than 0?

  • RE: Move DB from 2008R2 Enterprise to 2008 Standard

    mcopa (9/24/2012)


    Can I use the Copy Database wizard?

    Probably. I have had issues using it myself, so I tend to script the database then use SSIS to transfer data.

  • RE: Move DB from 2008R2 Enterprise to 2008 Standard

    If you are going from 2008 R2 to 2008, you won't be able to use the backup/restore. You will need to script your database on SQL Server 2008 R2,...

  • RE: BCP Error On New Server

    YSLGuru (9/24/2012)


    Lynn Pettis (9/20/2012)


    YSLGuru (9/20/2012)


    Lynn Pettis (9/19/2012)


    Bump. Have you tried my latest change? You know, not including the [ ] around the server name and instance name with...

  • RE: Error message: "The multi-part identifier could not be bound."

    Try this:

    Update cd

    set coreprocesstoken18 = udb.coreprocesstoken18

    FROM ContractData AS cd

    INNER JOIN

    (select accountnumber, sourcesystem, effectivedate, siccode, coreprocesstoken18

    from RR_GMC.RCA.dbo.UDBSourceData

    where sourcesystem = 'CAN'

    and effectivedate = '6/30/2012') as udb ON udb.accountnumber = cd.accountnumber

  • RE: Error message: "The multi-part identifier could not be bound."

    Sean Lange (9/24/2012)


    SQL_beginner1 (9/24/2012)


    Is this a view or a table?

    RR_GMC.RCA.dbo.UDBSourceData

    Lynn, it's a table.

    Both the source and the destination tables have the same columns, and I need to update the column...

  • RE: Consolidating records - TSQL problem

    Phil Parkin (9/24/2012)


    Lynn Pettis (9/24/2012)


    I came up this:

    --snip

    Interesting image that conjures up. I didn't take in the rest of your post. :w00t:

    Not feeling well today? 😉

Viewing 15 posts - 9,361 through 9,375 (of 26,490 total)