Forum Replies Created

Viewing 15 posts - 91 through 105 (of 422 total)

  • RE: get the minimum value

    For versions SQL2008 or greater you can also do this:

    ;WITH cteSampleData1 (matchpattern,country,rate)

    AS

    (

    SELECT 9526,'USA',0.80 UNION ALL

    ...

  • RE: How to maintain an incrementing row id

    Here's something I came up with. Not sure it's bullet-proof, but maybe it will give you

    some ideas. Sorry that it's a bit of a kludge and not very elegant......

  • RE: XML Formatting Using SQL

    OK, found another example.

    SET NOCOUNT ON

    DECLARE

    @strSQL NVARCHAR(MAX)

    SET @strSQL = '' -- required or the concatenation will return null

    ;WITH cteStore (SalesPersonID,TerritoryID) -- create some sample data

    ...

  • RE: XML Formatting Using SQL

    It's a lot of work so I can't do it for you, but here's some basic examples:

    [Repost from: http://www.sqlservercentral.com/Forums/FindPost1375776.aspx]

    DECLARE

    @x XML

    ,@s...

  • RE: Splitting a Full Name

    brickpack (7/11/2013)


    I'm trying to split a full name column up into First / Middle / Last....but some of the names are like "Joe B. W. LastName" or "Jenny MiddleName MaidenName...

  • RE: How to Post Performance Problems

    Thanks Gail. I'll add my kudos too. One addition that would be very helpful would be examples for presenting executable sample data. Not only does that help the helpers, but...

  • RE: Deleted items still appears in output

    Try simplifying the query for testing just to see what you have in the Projects table without all of the other INNER JOINS. (I agree with Sean that the other...

  • RE: Help on Date Time Validation

    ShuaibV (7/10/2013)


    Thank you Steven. This will be really helpful for me, i want to convert this to SQL FUNCTION and there is restriction we cant SET DATEFORMAT in the...

  • RE: Dynamic WHERE statement if stored procedure parameter is null

    I use this syntax in my where clauses rather than case statements:

    WHERE

    ((@StartDate IS NOT NULL AND StartDate >= @StartDate)

    OR

    (@StartDate IS NULL))

    AND ((@EndDate...

  • RE: Help on Date Time Validation

    ShuaibV (7/10/2013)


    Hello

    Can someone please share if there are any functions or code to validate the Date in different format settings?

    Ex:

    ----

    If I enter the value "9999", the function should validate against...

  • RE: Variable as a location

    Here's a snippet of code that I think does what you want. You can define the schema variables using the SYSNAME datatype, but you will still have to use dynamic...

  • RE: Parsing the XML

    See if this will help you. This reply was just posted yesterday so I'll just give the link:

    Parse XML to table.

     

  • RE: Search Columns in all Databases

    This link might be useful:

    sql-server-integrity-check

  • RE: Max of 2 dates

    Test results:

    IDTitleMaxDateDuration

    1Michael's Solution2013-07-071890

    2Alan's Solution2013-07-072447

    3Dwain's Solution2013-07-071280

    4Steven's Solution12013-07-072154

    5Steven's Solution22013-07-07710

    6Steven's Solution32013-07-07473

    7Steven's Solution42013-07-07490

    DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    SQL Server Execution Times:

    CPU time = 0...

  • RE: Max of 2 dates

    More fun with stats, with timed durations thrown in...and 4 alternate solutions. All four of the new ones are a few milliseconds faster but the results vary from run to...

Viewing 15 posts - 91 through 105 (of 422 total)