Forum Replies Created

Viewing 15 posts - 16 through 30 (of 337 total)

  • RE: Processing strings.

    Why would you want to do string processing using TSQL ? Please see the attached image. I wrote this in C# in less than 20 minutes.It can be then easily...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Log Shipping 2005 to 2012

    Here is some interesting reply.See if it works for you.But I strongly believe read only across version is never supported.

    you can use standby if you have initialized the database I...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: By date

    Sorry did not realize that you had posted in 2008 section.Lead can be easily replaced with a left join.

    DECLARE @STARTDATE DATE='2005-07-01'

    DECLARE @DAYS INT=100

    DECLARE @INTERVAL INT=7;

    WITH cte

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: By date

    If you are still not aware how to use my earlier query here is the sample usage on AdventureWorks2012 DB that SUMS Totaldue for 100 days spilt into 7 day...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: By date

    This query will give you the start and end date over a 7 day interval for a period of 100 days depending upon the current date.

    ;WITH cte

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Emails alerts for a topic

    Thanks Phil and Steve for your replies.The solution worked for me.

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Policy evaluation Mode issue [sql 2008 R2]

    Looks like "Prevent" and "Log Only" are not supported for tables which is quite strange though it's supported for Stored Procedures and UDF's

    SELECT

    f.[name] [FacetName]

    ,ISNULL(p.d,'') [On change: prevent]

    ,ISNULL(l.d,'') [On change:...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Sql query to retrieve rows grouped by specific values in a column

    Sorry..There was a silly typo in the earlier query.

    SELECT *

    FROM (SELECT *,

    Row_number()

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Using Subqueries as Calculated Fields

    I probably think this query would perform better.

    SELECT cust_name,

    cust_state,

    (SELECT Count(*)

    FROM orders

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Tlog file full..No space to ru Backup log statement

    Quick fix would be take a Full backup,Put the database in single_user mode(some downtime would be needed),change recovery to SIMPLE,truncate the log,change recovery to FULL,put db in MULTI_USER,take a DIFF...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Sql query to retrieve rows grouped by specific values in a column

    Something like this...

    SELECT *

    FROM (SELECT *,

    Row_number()

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Regarding extra space being used by Index after re-indexing

    mithunbhora (3/29/2016)


    ... "Since we are defragmenting the same index, then why the extra space is being swallowed up by New index, although the previous one is being deleted automatically,...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: Sql query to retrieve rows grouped by specific values in a column

    tolusokan (3/29/2016)


    Hi,

    I have been battling with this query for a while now. I attached a snippet of the raw file (claim) and also a sample of the expected results....

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: SQL select statement

    Something like this

    SELECT *

    FROM (SELECT *,

    Row_number()

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

  • RE: logic help

    Or..

    SELECT T.prod_code,

    sc.ship_code

    FROM #shipping_codes sc

    LEFT JOIN #mastershipping ms

    ...

    --------------------------------------------------------------------------------------------------
    I am just an another naive wannabe DBA trying to learn SQL Server

Viewing 15 posts - 16 through 30 (of 337 total)