Forum Replies Created

Viewing 15 posts - 4,291 through 4,305 (of 8,731 total)

  • RE: Creating Snippets

    I've seen that Prompt handles snippets in a wonderful way. I know that templates have been available for a long time, but I'm not sure if you could create custom...

  • RE: Pivot Table Help Needed

    tnpich (9/2/2015)


    The one posted by you back in 2007. I wasn't paying attention to the dates when I was looking at this.

    My SQL skills are not much past the...

  • RE: What Kind of DBA Are You?

    Sean Lange (9/2/2015)


    BrainDonor (9/1/2015)


    What's the difference between 'None of the above' and 'Other'?

    Also curious what is the difference between "Development" and "Development DBA".

    I understand it as coder and debugger. 😀

    Well,...

  • RE: Row into Multiple Column

    Yet another option 😀

    SELECT LEFT( Filename, Start.Bytes - 1) AS theFilename,

    SUBSTRING(Filename, Start.Bytes + 7, Start.Records - Start.Bytes - 7) AS Bytes,

    ...

  • RE: Save query results directly using variables and date/time

    Here's an example on how to do it dynamic. It's not that complicated and it could become a stored procedure on itself.

    DECLARE @LastName nvarchar(100) = 'Tamburello',

    @FirstName...

  • RE: Save query results directly using variables and date/time

    You can do it with the bcp utility by using xp_cmdshell or SSIS or Powershell.

  • RE: Get blank ('') in datediff function

    Even with large tables, NOLOCK hints aren't the best option. I'd suggest you to read more about this hint and understand how this is a poor idea.

    Back to the original...

  • RE: Get blank ('') in datediff function

    A CASE statement can only return one data type. If possible, it will implicitly convert the values following the data type precedence rules. In this case, the empty string is...

  • RE: Need some help with compliancy calculation

    Vladan (9/1/2015)


    Solution of Luis seems to me to be the best of the 3 variants. My code has rounding problem (returns 55.55 instead of 55.56), which I overlooked before and...

  • RE: Need some help with compliancy calculation

    denis.gendera (9/1/2015)


    All, thx for the quick solution one thing I forgot to mention how would I also include the column that shows the # machines this patchgroup got deployed?

    pgroup ...

  • RE: Need some help with compliancy calculation

    A bit simpler:

    SELECT

    t5.pgroup,

    CONVERT(NUMERIC(5,2),SUM(CASE WHEN t6.state = 'INSTALLED' THEN 100. END) / COUNT(*)) AS INSTALLED,

    CONVERT(NUMERIC(5,2),SUM(CASE WHEN t6.state =...

  • RE: Date format not converting to dd/mm/yy

    Another option is to change only the dateformat, or the condition (which can be painful to get it completely right).

    SET dateformat dmy;

    CREATE TABLE #TestDates(

    UserField1 char(8));

    INSERT INTO...

  • RE: Today's Random Word!

    whereisSQL? (8/31/2015)


    djj (8/31/2015)


    Ed Wagner (8/28/2015)


    whereisSQL? (8/28/2015)


    Luis Cazares (8/28/2015)


    Ed Wagner (8/28/2015)


    DonlSimpson (8/28/2015)


    SQLRNNR (8/28/2015)


    'tater salad

    Ron White

    White Potatoes

    black beans

    Burrito

    Steak

    Cow

    Milk

    Chocolate

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (8/31/2015)


    I am planning to upgrade at least one of my machines. Haven't decided if it'll be the 8.1 or 7. But I'm waiting to hear feed back from...

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

    This can help you, but it could give you false positives. I'm using sys.sql_modules, but you can use your table.

    SELECT *

    FROM sys.tables t

    WHERE EXISTS( SELECT * FROM sys.sql_modules m WHERE...

Viewing 15 posts - 4,291 through 4,305 (of 8,731 total)