Forum Replies Created

Viewing 15 posts - 2,866 through 2,880 (of 8,731 total)

  • RE: Simple SQL challenge - who can solve

    DuncEduardo (5/11/2016)


    Tally Table seemed unnecessarily complex - am sure there's something simpler

    Seriously? Do you understand what a tally table is? It's nothing more that a table (which could be a...

    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: Simple SQL challenge - who can solve

    DuncEduardo (5/11/2016)


    Hi,

    Simple little requirement.

    Need to display first date of each of the 12 months prior to current date, i.e. "Last Twelve Months" for reporting purposes.

    i.e. today is 10th May 2016...

    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: T-SQL Code works fine on SQL server 2008R2 and errors on SQL 2014

    Check this: https://connect.microsoft.com/SQLServer/feedback/details/737341/sql-server-2012-openrowset-on-msdb-dbo-sp-help-job-throws-error

    It includes a workaround posted in here: https://blogs.msdn.microsoft.com/sqlagent/2012/07/12/workaround-sql-server-2012-openrowset-on-sp_help_job-throws-the-metadata-could-not-be-determined/

    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?

    Lynn Pettis (5/10/2016)


    Eirikur Eiriksson (5/10/2016)


    Michael L John (5/10/2016)


    Lynn Pettis (5/10/2016)


    Red Letter Day! Silver Spoon posted a helpful response to a question. Of course, it could just be a...

    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: Update statement

    Use COALESCE()

    ...

    Set TestDate = COALESCE( @TestDate, @TestDate2, @TestDate3)

    ...

    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: Trigger on Table

    ettentrala (5/10/2016)


    Drew, thanks for responding.....I'm not sure I understand what you mean.

    Did you read the article that Drew referenced?

    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: Error converting data type nvarchar to numeric.

    Try this to get the rows causing errors.

    SELECT

    a.systemname AS HostName,

    left(a.deviceid,1) AS DriveName,

    a.drivesize,

    a.freespace

    FROM [dbo].[DriveStatus]...

    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: Today's Random Word!

    whereisSQL? (5/10/2016)


    Ed Wagner (5/10/2016)


    Manic Star (5/10/2016)


    crookj (5/10/2016)


    Ed Wagner (5/10/2016)


    djj (5/10/2016)


    whereisSQL? (5/10/2016)


    Ray K (5/10/2016)


    Ed Wagner (5/10/2016)


    crookj (5/10/2016)


    Grumpy DBA (5/10/2016)


    Ed Wagner (5/10/2016)


    Dog

    Dawg

    Deputy

    Sheriff

    I shot the...

    Confession

    True

    Lies

    Fibs

    Dibs

    Nibs (coffee)

    Cacao

    Chocolate

    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: Splitting 2 delimited string values into one table

    You could use the DelimitedSplit shared in this article: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    DECLARE @IDList NVARCHAR (1000) = '1|2|3|4|5'

    DECLARE @NameList NVARCHAR (1000) = 'AAA|BBB|CCC|DDD|EEE'

    DECLARE @Delimiter VARCHAR (1) = '|'

    DECLARE @Operation VARCHAR (10) = 'INSERT'...

    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: Error message - data type issue - turn query into view

    Try this:

    CREATE VIEW ViewName

    AS

    SELECT [student#]

    ,[class_position]

    ,case when [class_position] > 0 then CONVERT(int, [Class_Rank]) else CONVERT(int, [Class_Seq]) end as [List]

    FROM School

    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: Formating INT value to custom HH:MM:SS using expression for data labels

    wwwnlc111 (5/10/2016)


    It's only integer

    Is the data type an integer?

    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: help required with sql query

    Check the following article http://www.sqlservercentral.com/articles/T-SQL/63681/

    Also, remember that you have other aggregate functions like MAX and not only what it's used in the article.

    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 always round UP to next place value??

    Something shorter, not sure if that means better. 😀

    SELECT current_value=some_bigint,

    next_place_value=POWER(10,CAST(LOG10(some_bigint) AS INT)+1),

    next_place_value=POWER(10,LEN(some_bigint))

    FROM #bigints;

    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: what Workday number is today in the month today is may 9th but the workday number is 6

    You'll be missing any holidays. To prevent that, you'll need to create a calendar table or at least a holidays table.

    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: SQL Server Events Toronto

    There seems to be a SQL User Group in Toronto, but I'm not sure how active they are.

    http://toronto.sqlpass.org/

    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,866 through 2,880 (of 8,731 total)