Forum Replies Created

Viewing 15 posts - 196 through 210 (of 422 total)

  • RE: How do I convert string date values from mmddyy to mm/dd/yyyy?

    Sean Lange (4/2/2013)


    The biggest take away from this is that you should ALWAYS use the datetime datatype for datetime values. Using a varchar for dates just doesn't make sense. You...

  • RE: Identify node and tag in XML data using T-sql

    As you inferred, I needed to use dynamic SQL to get the results you want. From your example I wasn't able to get the XML nodes and your tables to...

  • RE: Parse CC in String

    i'm afraid this task isn't as easy as it may sound. The difficulty comes from the complexity of credit card number formulation. Now let's assume we just want to find...

  • RE: SQL Query Problem: How to aggregate discount percentages?

    Here's another solution. Entirely set based and no rounding approximations. Returns the current, previous, and cumulative discount for each row in the source table.

    IF OBJECT_ID('tempdb..#TestData') IS NOT NULL

    DROP TABLE #TestData

    ;WITH...

  • RE: Validate a date held in a text field.

    Here's two procedures I use for very thorough data validation. These procedures are much more reliable than ISDATE because ISDATE may return different results when converting from a string depending...

  • RE: Only allow users to see their own records

    This sounds like something better handled at the application level. An application like DotNetNuke (which is free BTW) is well-developed for securely handling individual or group roles. Then if any...

  • RE: Column encryption and decription........

    Sen1 (3/26/2013)


    Hello experts,

    I need to encrypt 4 col. in sql server 2008 and decrypt again. Do I have to do one column at a time or all together, if somebody...

  • RE: T-SQL

    I haven't tested any of these options for performance. On a small data set all of them will probably perform OK. But if you are going to use this in...

  • RE: Best Approach to Archieve DB

    Jeff Moden (3/24/2013)


    Steven Willis (3/24/2013)


    I'm in the middle of an archiving project right now. The customer has a single database instance on a shared server with a major host and...

  • RE: Best Approach to Archieve DB

    I'm in the middle of an archiving project right now. The customer has a single database instance on a shared server with a major host and isn't running enterprise edition...

  • RE: Identify node and tag in XML data using T-sql

    Try this procedure. You may have to make some modifications to fit your XML structure. And what you do with the output is up to you.

    CREATE PROCEDURE dbo.ParseXML

    ...

  • RE: Identify node and tag in XML data using T-sql

    DECLARE

    @strXML NVARCHAR(4000)

    ,@XML XML

    IF OBJECT_ID('tempdb..#Sub') IS NOT NULL

    DROP TABLE #Sub

    IF OBJECT_ID('tempdb..#Contact') IS NOT NULL

    DROP TABLE #Contact

    CREATE TABLE #Sub (

    ...

  • RE: How to Get The Most Filled Records from Similar Records

    Mickey...that sure beats my solution by a mile. I don't know why I didn't split the data into columns right from the beginning instead of trying to parse the strings...

  • RE: Save SP to table

    Does this return anything?

    IF OBJECT_ID ( N'msdb.dbo.dbm_monitor_data', N'U' ) IS NULL

    SELECT 'No data'

    ELSE

    SELECT * FROM msdb.dbo.dbm_monitor_data

    or this?

    SELECT

    ...

  • RE: How to Get The Most Filled Records from Similar Records

    [EDIT: Mickey's solution in a post below is MUCH better. Even though this solution "worked," it's admittedly convoluted. Mickey's method also avoids use of a cursor which is almost always...

Viewing 15 posts - 196 through 210 (of 422 total)