Forum Replies Created

Viewing 15 posts - 1,261 through 1,275 (of 1,346 total)

  • RE: Please Help ---User defined functions (using a dynamic table name)

    Except that the function can't see the @Table since it's only in scope of the caller.

    And you can't pass a Table type as a parameter into a function.

  • RE: Query question - compare 2 columns

    See BOL on CASE .. WHEN

    select upr.LASTNAME+upr.FRSTNAME as EmployeeName

      epay.EmployID,

      epay.Socscnum,

      epay.Funding_Ind as Status,

      Case

        When epay.EmployID = epay.Socscnum Then 'N'

        Else 'Y'

      End As Diff

    from Epay_Fund_Transaction_Table...

  • RE: Inconsistent behavior of Store Proc

    Regarding this code:

    >>EXEC master.dbo.xp_cmdshell 'dtsrun /S myServer /N myPackage /E '

    Have you tested this in isolation ? Can xp_cmdshell actually find dtsrun.exe ?

    There is another method to execute DTS packages...

  • RE: Self join query

    If you provide table DDL and design constraints up front, you can avoid forum participants wasting theirs and your time coming up with solutions based on incorrect/missing details.

    Your initial post...

  • RE: Automatic column table tracking

    Can't put triggers on system tables, so you'll need to maintain snapshot tables, and run queries against the snapshot to determine what changed in a given time period.

    As for descrition,...

  • RE: Returning row number of result set next to each item in result set

    In Sql Server 2005, you'll be able to use the ROW_NUMBER() / OVER function to generate this.

    In prior versions, I don't know any other way than to pre-select into a...

  • RE: Lets Clarify Operator Precedence!

    Simplifying both your WHERE clauses:

    WHERE end_date (Some Boolean expression)

    AND end_date (Some Boolean expression)

    AND cabs (Some Boolean expression)

    AND cat_code (Some Boolean expression)

    and:

    WHERE cat_code (Some Boolean expression)

    AND end_date (Some Boolean expression)

    AND cabs...

  • RE: T-SQL to Text File How to?

    Scheduled DTS package would work for this.

    You'd need 2 connection objects (SqlServer and Text File) and a single transform data task. The Transform Data Task lets you enter a SQL...

  • RE: Lets Clarify Operator Precedence!

    Not exactly. You asked a question about operator precedence, then proceeded to give 2 examples where precedence is irrelevant.

    Consider the following:

    Declare @EvalResult int

    Set @EvalResult = 1 + 7 * 9...

  • RE: stored procedure: is an update record the same as an insert record?

    For your UNIQUE_ID, read the BOL on defining a column as IDENTITY.

    If you Select the UNIQUE_ID to the fonr end as part of the dataset, then it is a simple...

  • RE: Re arranging table for reporting

    You have 2 pivots to perform. To translate Column names into data values, you can use a UNION query. This converts the In1, In2 and In3 column into values within...

  • RE: stored procedure: is an update record the same as an insert record?

    You don't use a VALUES list with an Update, and instead use SET to set the column list:

    UPDATE TABLE

    SET

      PRIORITY = @Priority,

      EDITSISSUES = @EditsIssues,

      DATE_SIGNED = @Date_Signed,

      FINAL =...

  • RE: Inconsistent behavior of Store Proc

    Does the DTS package produce a log file, if so does it indicate any errors ?

    Does the DTS packahe have full explicit path names to the files, or is it...

  • RE: Conditional insert Trigger

    Find the "bad" records:

    Select *

    From TableA

    Where PK In (

      Select PK

      From TableA

      Group by PK

      Having Count(*) > 1

    )

    Write 'Safe" Insert that will not error due to dupes:

    Insert...

  • RE: Just a basic SQL question, Finding Dups for a part of a field...

    SELECT ID_NUM, YR_CDE, TRM_CDE, CRS_CDE, TRANSACTION_STS, REPEAT_FLAG, GRADE_CDE,

       LEFT(CRS_CDE, 8) AS ADV, COUNT(*) As NumberOfTimesTaken

    FROM STUDENT_CRS_HIST

    WHERE (ID_NUM = 126366)

    AND   (NOT (REPEAT_FLAG IN ('*', 'R')))

    AND   (TRANSACTION_STS = 'H')...

Viewing 15 posts - 1,261 through 1,275 (of 1,346 total)