Forum Replies Created

Viewing 15 posts - 2,371 through 2,385 (of 5,504 total)

  • RE: Help needed with code

    pwalter83,

    please stop reposting the same stuff over and over again.

    You've been asked multiple times to post some additional information and you've been pointed at a link multiple times that will...

  • RE: count no of months n days

    Here's a rather complicated example:

    DECLARE

    @startdate DATETIME,

    @days INT,

    @enddate DATETIME,

    @startyear SMALLINT,

    @startmonth TINYINT,

    @startday TINYINT,

    @endyear SMALLINT,

    @endmonth TINYINT,

    @endday TINYINT

    SELECT @days=149, @startdate='20100825'

    SELECT @enddate=DATEADD(dd,@days,@startdate)

    SELECT

    @startyear =YEAR(@startdate),

    @startmonth =MONTH(@startdate),

    @startday =DAY(@startdate),

    @endyear =YEAR(@enddate),

    @endmonth =MONTH(@enddate),

    @endday =DAY(@enddate)

    SELECT

    @startdate,

    @enddate,

    CASE

    WHEN @startyear <> @endyear...

  • RE: count no of months n days

    What logic do you want to apply to define a month?

    Would it be based on the number of full month between the two dates or based on a fixed number...

  • RE: Sql query Output in XML format

    Please post table def and (fake) sample data matching your expected result as described in the first link in my signature.

    Some of us (including me) would like to test our...

  • RE: Help needed with code

    It seems like there are three options to consider: a lookup table, a (more or less) simple string concatenation or a combination of both.

    If you write T-SQL code you should...

  • RE: if else error

    Mistake #1: you're obviously using Oracle 😀

    #2: assuming some logic implemented into the SQL systax Oracle is using, I'd get rid of all of the semicolons, since a semicolon should...

  • RE: Howto: Produce 1 XML dataset from several queries

    Unfortunately, we don't have any table def or sample data to play with.

    But based on the identical structure within each rec node I'd recommend to use a UNION statement to...

  • RE: Searching a Stored Procedure definition (probable parse)

    Since you already have the objects used in a sproc you could query sys.sql_modules with PATINDEX() in a recursive CTE to find ho often it's referenced.

    I honestly doubt you'll be...

  • RE: Searching a Stored Procedure definition (probable parse)

    Instead of parsing the sproc, wouldn't one of the following object dependency functions be more efficient (introduced in SS2K8)?

    sys.dm_sql_referenced_entities

    sys.dm_sql_referencing_entities

    sys.sql_expression_dependencies

  • RE: Are the posted questions getting worse?

    Gianluca Sartori (12/17/2010)


    Paul White NZ (12/17/2010)


    Gianluca Sartori (12/17/2010)


    Has anyone tried SQLComplete intellisense[/url]? I'm trying it and it doesn't look bad at all. Since I work on 2005 servers it comes...

  • RE: Top N for each group in a counted series

    If you could provide a ready to use result set based on the query you have below, I think we can design the table on our side so you don't...

  • RE: datepart week - 53 and 54 weeks?

    The reason is simple (more or less):

    A new week will start on Sunday as per the standard setting of SQL Server (U.S. English).

    Jan 1st 2028 is a Saturday. Jan 2nd...

  • RE: Are the posted questions getting worse?

    Luke L (12/17/2010)


    Jack Corbett (12/17/2010)


    I've used VirtualPC, but its lack of 64 bit guest support is annoying. I know several others who use VritualBox and if I had a...

  • RE: Get Monthly total in sp

    Please read the first article in my signature on how to ask a question in this forum.

    It'll show you how to post table def and sample data in a ready...

  • RE: Can cursor avoided here?

    Why do you transfer all the data across the network twice? Just to set @inputcount = @@ROWCOUNT? It would be much more efficient to use a count(*) from OPENQUERY() to...

Viewing 15 posts - 2,371 through 2,385 (of 5,504 total)