Forum Replies Created

Viewing 15 posts - 8,866 through 8,880 (of 10,144 total)

  • RE: Strange Error !!!!!!!!!

    You have a statement in there for printing the SQL string

    print @lstr

    Have a look at the statement it generates. You will see that there are quotes missing.

  • RE: Strange Error !!!!!!!!!

    When you EXEC @lstr, it's executing in a different scope and the variables created in the body of the batch are not available to that scope.

    Consider using sp_executesql, which supports...

  • RE: Help with combining 2 queries

    It looks simple enough to get away with this, but check your performance:

    INSERT INTO TableA

    (ColA1,

    ColA2,

    ColA3)

    SELECT ColB1,

    SUM(ColB2) AS ColB2,

    SUM(CASE WHEN ColB4 BETWEEN 0 AND 10 THEN ColB3 ELSE 0...

  • RE: SP failed due to "ResultSet"

    You would benefit from adopting table aliases. Really.

    Before

    INSERT INTO

    dbo.tblClients(Client_Short_Name,Client_Long_Name,CountryCode,ClientID)

    SELECT LEFT

    (dbo.vwImportAllNewClientIDs.Client, 30),

    dbo.vwImportAllNewClientIDs.Client,

    dbo.vwImportAllNewClientIDs.CountryCode,

    dbo.vwImportAllNewClientIDs.

    ClientID

    FROM dbo.vwImportAllNewClientIDs

    After

    INSERT INTO dbo.tblClients (Client_Short_Name, Client_Long_Name, CountryCode, ClientID)

    SELECT LEFT(c.Client, 30), c.Client, c.CountryCode,...

  • RE: SP failed due to "ResultSet"

    A Little Help Please (1/28/2009)


    Could this be the problem?

    It is a problem, which of course you can deal with because you've now read about the LEFT function in BOL.

    So...

  • RE: SP failed due to "ResultSet"

    A Little Help Please (1/28/2009)


    When I run you select statment I just get one row returned.

    I think I found the issue, can you tell me how i would truncate the...

  • RE: SP failed due to "ResultSet"

    A Little Help Please (1/28/2009)


    Thanks again for your time!

    CheckDate imports only one row one column

    27/01/09

    Any more suggestions?

    Yes - run this:SELECT convert(char(8),date) FROM DealbookV2.dbo.CheckDate

    What happens when you run the stored...

  • RE: SP failed due to "ResultSet"

    Nobody has replied to this because it was difficult to read through all of the code. I've spent a few moments reformatting it, in particular putting in table aliases, and...

  • RE: SP failed due to "ResultSet"

    It's a problem with a subquery in the stored procedure dbo.procImportAllFiles.

    Best post the sproc.

  • RE: Delete query help

    David Fullerton (1/27/2009)


    This works Thanks Cris

    Thanks for the feedback David.

  • RE: Are the posted questions getting worse?

    Grant Fritchey (1/27/2009)


    As to writing coherently, I have a tendency to be thinking more about what I want to say rather than precisely how to say it. I've gone back...

  • RE: Are the posted questions getting worse?

    GilaMonster (1/27/2009)


    Bob Hovious (1/27/2009)


    One more post towards 1000.... and close to the original topic here. How many people get annoyed by people who cut and paste data rather...

  • RE: Are the posted questions getting worse?

    Bob Hovious (1/27/2009)


    One more post towards 1000.... and close to the original topic here. How many people get annoyed by people who cut and paste data rather than...

  • RE: Reducing common data into fewer rows.

    ssetzer (1/27/2009)


    Thank you both for your assistance. It appears that Mark's solution works well (and better than the loop solution I had attempted). Chris - your solution worked...

  • RE: Delete query help

    Use the WHERE clause instead?

    DELETE b

    FROM dbo.ADIM_ASSOCIATE_CONTRACTOR_RawImport b

    INNER JOIN dbo.ADIM_ASSOCIATE_CONTRACTOR a

    ON a.[EMPLOYEE_NUMBER] = b.[EMPLOYEE_NUMBER]

    AND a.[ASSOCIATE_CONTRACTOR_FLAG] = b.[ASSOCIATE_CONTRACTOR_FLAG]

    AND a.[DOM_INTL_IN] = b.[DOM_INTL_IN]

    AND a.[CFC_NETWORK_ID] = b.[CFC_NETWORK_ID]

    AND a.[NAME_PREFIX] = b.[NAME_PREFIX]

    AND...

Viewing 15 posts - 8,866 through 8,880 (of 10,144 total)