Forum Replies Created

Viewing 15 posts - 3,316 through 3,330 (of 4,085 total)

  • RE: Using BULK INSERT with a non delimited flat file

    I don't see any way to easily distinguish between the end of a field and the end of a record using this file format. That's going to cause problems...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Column Alias name dynamically

    WHY? How are you planning on using these aliases? Any queries written using these aliases would be virtually impossible to read. You're better off using aliases that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding a Week number in a query.

    bitbucket-25253 (2/17/2012)


    Looking for something like this:

    DECLARE @HireDate DATETIME

    DECLARE @CurrentDate DATETIME

    SET @HireDate = '01-06-2012'

    SET @CurrentDate = GETDATE()

    SELECT DATEPART(wk, @CurrentDate) - DATEPART(wk,@HireDate) AS 'Weeks Worked'

    --Result:

    Weeks Worked

    6

    This only works if the hire...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Execution

    A more useful statistic for comparing two queries is the number of reads. If you SET STATISTICS IO, TIME ON and then run both queries, you will be able...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Date Format

    GuruGPrasad (2/17/2012)


    Hi kshitiz,

    But we have converted the date to format 103 then why its not formatted.

    And also when using getdate() its formatting but when we give the date its...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are table hints a sub-type of query hints?

    SQL Kiwi (2/16/2012)


    Rowles (2/14/2012)


    A table hint would be used in a T-SQL query. So table hints would then be a sub-type of query hint, right?

    I'm not sure I would...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: access to footer total in pivot

    T-SQL is not a reporting tool, yet you are trying to use it like one. What you are trying to do would be relatively easy in a reporting tool,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Label Partitioning Data based on matching attributes

    R.P.Rozema (2/15/2012)


    Combine the both solutions. Take Paul's DENSE_RANK() to generate a unique name per 'group' and add another column, using my ROW_NUMBER() suggestion to give each individual member of the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: 2 date queries and binding togthter to one

    I agree with Sean that you'll probably want to use a calendar table.

    There are also problems with your posted code. You're trying to convert a date to nvarchar—which is...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to convert XML to a datatable in sql server

    There are essentially two different options: XQuery and OPENXML. There are plenty of examples in BOL and online. If you need help with a specific problem, you'll need...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to correct the below join query to get correct results

    There's not much we can do without sample data and expected results. Check out the following link: Forum Etiquette: How to post data/code on a forum to get...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how to correct the below join query to get correct results

    asita (2/13/2012)


    select chl.GuaranteeCode GuaranteeCode , bal.GuaranteeCode as BalanceSheetGuaranteeCode

    from dbo.Guarantees chl

    left join dbo.Guarantees par on par.HyperionEntityId = chl.ParentHyperionEntityId

    left join dbo.Guarantees gpar on gpar.HyperionEntityId = par.ParentHyperionEntityId

    left join dbo.Guarantees ggpar on ggpar.HyperionEntityId...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: propblem in installing VS 2010

    This forum is for programming in T-SQL using the XML datatype. It is not for troubleshooting installs of third party products.

    Try this link http://lmgtfy.com/?q=error+25541+office+2010

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Add Date Specific MSRP to Orders Table

    I find that row number works better when you have a single table that you are trying to pull the most recent record from. When you have multiple tables,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Advice on BINARY_CHECKSUM or Alternatives

    SQL Kiwi (2/8/2012)


    drew.allen (2/8/2012)


    Peter Brinkhaus (2/7/2012)


    As an alternative, you could use NOT EXISTS (SELECT [@Stag].* INTERSECT SELECT [@Prod].*) to compare rows.

    Using EXCEPT should give you the same results, is probably...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,316 through 3,330 (of 4,085 total)