Forum Replies Created

Viewing 15 posts - 1,321 through 1,335 (of 1,472 total)

  • RE: Need help on performance and integrity

    My apologies for all the semi correct attempts, had I taken the time to read all the posts I glossed over from a couple days ago, I'd have seen most...

  • RE: Need help on performance and integrity

    Ok, I just discovered something interesting. The reason it wasn't working before is because the @LastDupe variable inside that CASE statement does not get properly evaluated for the subselect....

  • RE: Need help on performance and integrity

    The A's only is a very easy fix. The second part should have been handled by the variable check, but it's not reacting the way I thought it would....

  • RE: Need help on performance and integrity

    Ok, so a slight change in logic. How about this one?

    [font="Courier New"]

    ------ Declare Variables ----------------------------------

    DECLARE @GroupID    INT,

    @PrevCode          CHAR(5),

    @RowID             INT,

    @LastDupe          INT,

    @Dupe              TinyInt

    SET @PrevCode = (SELECT Code FROM #TempTable WHERE RowID = 1)

    SET @GroupID =...

  • RE: Nested Select?

    Is this the whole query? If not, please post the rest. At the time of your original question, you didn't specify it was going to be a subquery....

  • RE: Query worked for 3 months, now it does not

    Select EmpCode

    FROM tblEmployees

    WHERE EmpCode NOT IN (select EmpCode from tblEmpCodes where cancelled is NOT NULL) (none)

    That one there takes subgroup out of the equation.

    As Barry said, it means...

  • RE: Query worked for 3 months, now it does not

    Not really enough information for us to go on at this point.

    What rowcounts do these statements return on the database you get nothing from?

    SELECT FirstName,LastName,EmpEmail,EmpCode

    FROM tblEmployees

    SELECT FirstName,LastName,EmpEmail,EmpCode

    FROM tblEmployees

    WHERE Subgroup =...

  • RE: Script dependent upon SQL version

    Makes perfect sense, I just thought about it like that. Thanks much for both explanations, that'll close a whole lot of holes on our new website build.

  • RE: Script dependent upon SQL version

    K, so we were basically saying the same thing, I misunderstood as it seemed like your post was in response to mine. The code posted was purely for explanation's...

  • RE: Help Needed with TSQL

    You aren't taking into account the original requirement that actual months only be used if the Month value exists in his second table. While we all agree it's a...

  • RE: Help Needed with TSQL

    I figured as much, which is why I didn't post it with the earlier solution, but then I realized that the next person that reads this thread might have the...

  • RE: Script dependent upon SQL version

    In ASP for example, you can do:

    sql="SELECT * FROM TABLE WHERE Field ='" & MyVariable & "'"

    rs.open sql conn2

    Instead of

    sql ="Exec dbo.MySP @Variable =" & MyVariable

    rs.open sql conn2

    So she...

  • RE: Script dependent upon SQL version

    Is it bad practice to hard code the SQL into the front end in cases such as these? I wouldn't do it, but I know a lot of people...

  • RE: Script dependent upon SQL version

    SELECT @@VERSION will return the current version of the SQL server it is run against.

    That along with an IF by your VB app should cover it. Note...

  • RE: Help Needed with TSQL

    Agreed, and the Month name being entered into an alternate table to signify that real data should be used adds another unnecessary step. Add your projected data to the...

Viewing 15 posts - 1,321 through 1,335 (of 1,472 total)