Forum Replies Created

Viewing 15 posts - 2,926 through 2,940 (of 4,085 total)

  • RE: Interesting Way to Parse Comma Separated Values

    Since you're on SQL 2012, you should convert your ntext columns to nvarchar(max) columns, which you can sort on.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: String to Date without time-Sql server 2012

    Dates do not have formats. Strings that represent dates have formats, but dates themselves do not have formats.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Interesting Way to Parse Comma Separated Values

    I'm not sure whether the parameters are displayed in the proc definition order or the call order. If it's the proc definition order, then you do not need to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Retrieving Null Values

    Luis Cazares (9/10/2015)


    Your query will only return rows where the region starts by null, which is different from a NULL value.

    To compare NULL values, you need to use IS NULL...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: 'Where' conditions

    There is an option that I haven't seen anyone else suggest. It does depend on you being able to specify an order such that the row to exclude always...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Merging two tables using effectivestart and effectiveend date fields

    First, it looks like you are using closed ranges for you datetime data since the effective end date is usually one second less than the next effective start date. ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Help with NOT EXISTS logic

    Eirikur Eiriksson (9/10/2015)


    Quick suggestion (you are almost there)

    😎

    IF NOT EXISTS (

    SELECT SP.Name, SPM.permission_name from sys.server_principals SP

    INNER JOIN sys.server_permissions SPM ON SP.principal_id = SPM.grantee_principal_id

    WHERE

    (SP.name = 'SomeRole' AND SPM.permission_name = 'VIEW ANY...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: can @@rowcount be overwritten?

    sp_executesql allows for an OUTPUT parameter. You can see an example at sp_executesql (Transact-SQL)

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to improve this query

    spaghettidba (9/4/2015)


    Good to hear!

    Please note that my form of the query and J Livingston's are the same: the default for the ORDER BY clause in OVER is ROWS BETWEEN UNBOUNDED...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: hi, i'm a noob on sql 2008 could anyone suggest me on how to do it

    If you're really on SQL 2008, then a SQL 2014 specific forum is probably not the best place for you to get answers. There is a forum specifically for...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Covering date error

    Try running the following code:

    SELECT LTRIM(SUBSTRING (Col1, 1, 20)) AS 'DateTimeStamp',

    LTRIM(SUBSTRING(Col1, 71, 6)) AS 'LSN',

    LTRIM(SUBSTRING (Col1, 21, 18)) AS 'FileSize',

    LTRIM(SUBSTRING (Col1, 40, 1000)) AS 'FileName1'

    FROM #OriginalFileList

    WHERE TRY_PARSE(LTRIM(SUBSTRING (Col1, 1,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Delete statement taking too much time..?

    Part of the problem is that your query is needlessly complex. You reference CVS_Details three times and Transmittal_Planning_MarkNo twice and some of these are redundant. To understand this,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Internal Sports League

    You're probably going to need to use Dynamic Crosstabs[/url], unless each division has exactly the same player names. You'll probably also want to read Cross Tabs and Pivots--Part 1[/url].

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Get list of all the tables used in multiple SQL scripts

    ScottPletcher (8/29/2015)


    Create a new, work db. Create 275 procs from the existing code. Hopefully that's as as adding "CREATE PROCEDURE proc_NNN AS " to the beginning of the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Get list of all the tables used in multiple SQL scripts

    I actually prefer using sys.dm_sql_referencing_entities. I found that I was getting false positives using the LIKE operator, because people had commented out sections of code, so the table name...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,926 through 2,940 (of 4,085 total)