Forum Replies Created

Viewing 15 posts - 151 through 165 (of 515 total)

  • RE: Computed column

    Good question. Thanks 🙂

  • RE: Script object into a text file

    yes VARCHAR(MAX) is not allowed, but you can use VARCHAR(8000).

    Try executing the code below:

    declare @STR varchar(8000)

    select @STR = 'create table #test

    (ind int primary key not...

  • RE: What Gives Better Performance?

    Just as a thumb rule (that I follow), use CHAR only when you are sure of the character length. For example - SSN number is always of fixed length. For...

  • RE: Data compression

    bitbucket-25253 (1/29/2013)


    Nice question on basics ....

    +1

    Also, as pointed out by Hugo yesterday, the link is also correct - latest version of BOL 🙂

  • RE: Dev and Live SSIS connections

    In order to change connections dynamically, you need to program them using script task in SSIS.

  • RE: Sql Query for removing duplicate rows in SQL server 2008

    anthony.green (1/29/2013)


    That was my original way of doing it, but then had a mental block of linking the CTE to the table.

    This sometimes happens to me as well 🙂

  • RE: Update All columns in table

    Using merge (as pointed out by demonfox) you can easily user INSERTED.* and DELETED.* (as mentionded by Dwain) after MERGE in order to capture, columns and values which are being...

  • RE: Sql Query for removing duplicate rows in SQL server 2008

    As rightly pointed about Anthony, this is bit tricky as there is no identifier on the rows. Here is another way of deleting duplicate records using CTE:

    WITH DelDup

    ...

  • RE: BIT Primary Key

    Easy question for the day!

    I agree with the explanation by "demonfox", here is the BOL link for BIT datatype:

    http://msdn.microsoft.com/en-us/library/ms177603.aspx

    It clearly says "any non-zero value will be converted to 1". I...

  • RE: Inputs Required!!

    sainatth.wagh (1/28/2013)


    Thanks people, with the similar piece of code it has solved my probelm....:-):-):-)

    Wonderful! Glad to know that.

    All glories to Jason as well for optimizing my code 🙂

  • RE: Inputs Required!!

    Jason-299789 (1/28/2013)


    No problem, let me know how it turns out.

    Cool! This works well. Here is the modified (few compilation issues rectified) and tested version.

    ;WITH Cte_Src AS (

    SELECT

    Db_name(database_id) databasename

    ,Max(x.Last_Date) Last_Access_time

    ,Getdate() curr_time

    FROM

    sys.dm_db_index_usage_stats

    CROSS...

  • RE: Inputs Required!!

    Hey Jason, thanks for your valuable inputs. I shall have these incorporated and tested soon.

    Thanks 🙂

  • RE: Inputs Required!!

    OP here is how I have set-up custom auditing on the Server. The script given here will create an Audit Table and try to record DB access information. I use...

  • RE: Inputs Required!!

    demonfox (1/28/2013)


    :hehe: yes , it is ..

    when I hear the word audit , I think of security 😛

    and with CDC , Change data Capture , I think of it as...

  • RE: Inputs Required!!

    demonfox (1/27/2013)


    CDC is more like versioning than audit ; what does it mean by audit trail on daioy transactions ?

    does it more related to logging of transaction by a login...

Viewing 15 posts - 151 through 165 (of 515 total)