Forum Replies Created

Viewing 15 posts - 3,136 through 3,150 (of 4,087 total)

  • RE: Dynamically Export to new Excel File - TSQL

    A brief overview.

    In SSIS, create an ADO recordset with the managers and then use a FOR EACH ADO enumerator container to produce the Excel file for each manager. The...

  • RE: Passing Parameter with a wildcard

    Jeff Moden (5/25/2012)


    drew.allen (5/14/2012)


    Sean Lange (5/11/2012)


    themangoagent (5/11/2012)


    Jeff Moden (5/10/2012)


    Didn't look to see if it was mentioned before but one sure fire way to increase the performance here would be to...

  • RE: Help with CASE please

    CELKO (5/23/2012)


    we do not use bit flags

    Until SQL supports a true Boolean data type, bit is the best alternative.

    * Why would I reserve 2 bytes for a...

  • RE: Generate Month end records bases on Start Date

    Jeff Moden (5/23/2012)

    The day that I want is really the end of the previous month which is always 1 day less the 1st of the month. So I just...

  • RE: Query Help - Grouping same domain in EmailId

    Consider adding a computed column to your CustomerMaster table to produce the domain name. If you can't update the structure, then you can use a CROSS APPLY to make...

  • RE: Unnecesary subquery and top?

    CELKO (5/22/2012)


    Rows are not records. Again, this is COBOL and not SQL. Time for a total re-write .. sorry.

    Wikipedia disagrees with you

    Row (database)


    In the context of a relational database, a...

  • RE: Table query

    Consider using a reporting tool, such as SSRS, to write your reports. Otherwise the crosstab/pivot already recommended is your best approach.

    Drew

  • RE: SET or SELECT to assign a default value to a nullable variable

    Brandie Tarvin (5/17/2012)


    drew.allen (5/17/2012)


    I prefer this to prevent NULL values.

    DECLARE @L_ZERO INT = 0

    SELECT @L_ZERO = IdMyTable FROM MyTable WHERE ColumnRef = 1000

    Drew

    Drew, how does that prevent NULL from overriding...

  • RE: SET or SELECT to assign a default value to a nullable variable

    Nakul Vachhrajani (5/17/2012)


    How's this?

    DECLARE @L_ZERO INT

    SELECT @L_ZERO = ISNULL(IdMyTable,0) FROM MyTable WHERE ColumnRef = 1000

    SELECT @L_ZERO

    This doesn't produce the same results as the original queries. Specifically, when there is...

  • RE: SET or SELECT to assign a default value to a nullable variable

    I prefer this to prevent NULL values.

    DECLARE @L_ZERO INT = 0

    SELECT @L_ZERO = IdMyTable FROM MyTable WHERE ColumnRef = 1000

    Drew

  • RE: Could not be bound...

    You have a couple of options depending on what you want. As Lynn is trying to point out you have an implicit CROSS JOIN, so you can make it...

  • RE: Could not be bound...

    The problem is here:

    from GLDEFRLS

    INNER JOIN accropts AC

    ON AC.AccAccrOption = EM.EacAccrOption

    INNER JOIN empaccr...

  • RE: Week of the month

    anthony.green (5/17/2012)


    This should do the trick, also dont forget the power of Google or your favourite search engine

    set datefirst 1

    DECLARE @dt DATETIME, @WeekOfMonth TINYINT

    SET @dt = '2007-07-08'

    SET @WeekOfMonth = DATEDIFF(week,...

  • RE: Organically cancel a resultset from proc if rowcount is zero?

    Sean Lange (5/16/2012)


    It was a 2 minute brief example of using exists to demonstrate the task at hand. I certainly was not expecting a code review. 😀

    Your points are all...

  • RE: Select Filter

    Mark-101232 (5/16/2012)


    Use LIKE

    SELECT ..

    FROM mytable

    WHERE PartNumber LIKE '[0-9][0-9][0-9][0-9][A-Za-z][0-9][0-9]'

    If your collation is case-insensitive (default ), you don't need to specify both A-Z and a-z.

    Drew

Viewing 15 posts - 3,136 through 3,150 (of 4,087 total)