Forum Replies Created

Viewing 15 posts - 226 through 240 (of 348 total)

  • RE: TSQL help

    Ye s we will need to consider location,Site and Code while eliminatong

    I want to eliminate PrevTrans 1,2,9 because for the same site,location and code because PrevTrans 2 and 9 comes...

  • RE: Performance tuning

    CREATE TABLE dbo.FACTTAble

    (

    ID INT IDENTITY(1,1) PRIMARY KEY,

    Bol# INT,

    CustNum INT,

    PostedDate DATE,

    ocr VARCHAR(1),

    IsUsedforFact BIT

    )

    INSERT INTO dbo.FACTTAble (Bol#,CustNum,PostedDate,ocr,IsUsedforFact)

    SELECT 213,1111,'10/1/2012','r',0

    UNION

    SELECT 213,1111,'10/16/2012','c',0

    UNION

    SELECT...

  • RE: Avoid using cursors

    Updated 2nd case data

    IF we have same relNum,DDate and differnt MAXBOLTIME

    Insert into FACT

    SELECT 4,400,7999,2012-1-27,1234,1111,3333,489

    UNION

    SELECT 5,500,7999,2012-1-27,2000,2222,1111,499

    UNION

    SELECT 6,600,7999, 2012-1-27,1,2,3,466

    we need the row with maxbol (499) and delete the two e.g

    we...

  • RE: Avoid using cursors

    FACT TAble

    ( ID int identity(1,1),

    OrderID INT,

    relNum int,

    DDATe DATE,

    BGallons numeric (14,3),

    GGallons numeric (14,3),

    NGallons numeric (14,3),

    MAXBolTime INT

    )

    First case

    IF we have same relNum,DDate and same MAXBOLTIME

    Insert into FACT

    SELECT 1,100,1111,2012-2-27,1234,1111,3333,444

    UNION

    SELECT 2,200,1111,2012-2-27,2000,2222,1111,444

    UNION

    SELECT 3,300,1111,2012-2-27,1,2,3,444

    If RelNum...

  • RE: Find second occurence of a word

    I tried to use

    Declare @test-2 varchar(100)

    select @test-2 = 'ABCDEFG (9105) CDD ABCDEFG (1690) ENGINEERING'

    select LEFT(@test,patindex('%ABCDEFG%',substring(@test,patindex('%ABCDEFG%',@test)+1,LEN(@test))))

    If I have only the

    'ABCDEFG (9105) CDD' then it returns blank .

    'ABCDEFG (9105) CDD...

  • RE: DElete Duplicates

    Thanks a lot. That solved my problem .

  • RE: DBCC SHOWCONTIG

    Thanks!

  • RE: DBCC SHOWCONTIG

    Fill-factor used was 0 . Talked with the dba. He said they are in the process of using the most appropriate one soon . But now due to space...

  • RE: Stored proc with Database name and servername as parameters

    My server name is like for example ServerName\ABCD . So if I donot use the square bracket it will fail.

    I have these Variables set up in SSIS .(ServerName and DatabaseName)...

  • RE: Precedence Constarint

    Got this working . Thanks

  • RE: Precedence Constarint

    Using the query below

    IF ( SELECT count(f.name) AS VerifyCompanyExists FROM fleets f

    WHERE f.name NOT IN ( SELECT DISTINCT C.CompanyName

    FROM Company C

    LEFT JOIN Accounts A...

  • RE: Precedence Constarint

    I am using an SSIS variable to get the results from the IF statement

    But I get the following error :

    [Execute SQL Task] Error: Executing the query "IF ( SELECT count(f.name)...

  • RE: Precedence Constarint

    Yes it is used in execute sql task . Not getting what I wanted.

  • RE: Precedence Constarint

    ok. Then should I use @CheckQuery > "0" or @CheckQuery > "AddCompany",

  • RE: Inconsistent datatypes of excel source files

    I get the error below :

    TITLE: Expression Builder

    ------------------------------

    Expression cannot be evaluated.

    Attempt to parse the expression "REVERSE(SUBSTRING(REVERSE( @[User::FileName]),1, FINDSTRING("\", REVERSE(@[User::FileName]), 1)))

    " failed. The token """ at line number "1", character...

Viewing 15 posts - 226 through 240 (of 348 total)