Forum Replies Created

Viewing 15 posts - 2,461 through 2,475 (of 8,731 total)

  • RE: Merge Statement using CTE

    fergfamster (7/21/2016)


    Thanks, I dont really want to post 15 files you guys need to review to get an answer. ill figure it out.

    15 files? Why? It's just DDL for tables...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Merge Statement using CTE

    Read this for better help: http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    Any suggestion at this point, would be a wild guess.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: SSMS REGISTERED SERVERS !!

    I guess you could generate a .regsrvr file. Here's an article on exporting it https://www.mssqltips.com/sqlservertip/2015/import-and-export-registered-sql-servers-to-other-machines/. If you write the code to generate the xml for all the servers, you could...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: date format YYYMMDD HH:MM:SS ssis expression

    komal145 (7/21/2016)


    if i remove the colons i get this format:

    2016721 102358 but requirment is to have hh:mm:ss

    A filename can't contain colons.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Comma separated

    You're right Sean, I missed the blank value part.

    I also prefer your solution as it should imply less work for the server.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: date format YYYMMDD HH:MM:SS ssis expression

    What if you remove the +":"?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Comma separated

    Insert the comma in the ISNULL function.

    SELECT DISTINCT STUFF(

    (SELECT (ISNULL(', ' + t2.Name,''))

    FROM #Temp t2

    where t1.ID = t2.ID -- t1.DeliverableITEP = t2.DeliverableITEP AND t1.GeoMarket = t2.GeoMarket AND t1.Segment = t2.Segment...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Set Date based on day of Month

    And yet another option:

    SELECT DATEADD(MM, DATEDIFF(MM, '19020401', GETDATE()), 0)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Set Date based on day of Month

    John Mitchell-245523 (7/21/2016)


    This will return 1st April from the year two years before the given date. If you need the date presented in a particular way, do that in...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Exclude zero till get first nonzero value.(use cte or select)

    Phil Parkin (7/21/2016)


    Anandkumar-SQL_Developer (7/21/2016)


    Actually This is an interview question.

    Really? Then unless your answer is along the lines of

    "This cannot be done, unless a column exists on which to order, because...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Y.B. (7/20/2016)


    I got a PM from an OP saying simply 'douche bag'. LOL

    Granted, I'm having a really bad day and could have responded better...on the other hand at least...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: online script full of odd quotation marks

    Indianrock (7/19/2016)


    Thanks Luis, that worked. I was doing replace all in Notepad++ but not getting the right combinations.

    Easy,

    Quotes(‘&’) should be replaced with single quotes (').

    Double quotes (”) should...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to search exact match case

    The best solution you can have is to normalize your data.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Current product being ran

    You should already know how to properly ask questions here.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to prevent a table from being truncated or dropped

    The foreign key should allow you to prevent truncates. To prevent dropping tables, you can use the a DDL trigger.

    CREATE TABLE TriggerTest( id int)

    GO

    CREATE TRIGGER T_Avoid_Drop_Table ON DATABASE

    FOR DROP_TABLE

    AS...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 2,461 through 2,475 (of 8,731 total)