Forum Replies Created

Viewing 15 posts - 1,096 through 1,110 (of 1,169 total)

  • RE: how can we get the logs of database

    Hi,

    1. select * from fn_dblog(null,null) can be of use for you

    2. Running SQL Server Profiler can also be of use

    3. Windows logs which you can filter for SQL server

    Regards

    IgorMi

  • RE: ALTER INDEX ..... SORT_IN_TEMPDB

    OLDCHAPPY (6/18/2012)


    if you rebuild an index using the SORT_IN_TEMPDB option, do you need tempdb size of at least the size of largest table being build?

    for example, we have a...

  • RE: Transactions 4

    Nils Gustav Stråbø (6/8/2012)


    Your second example creates and index on qotd4, not qotd5.

    Oh!, Thanks

    Yes, you're right definitively.

    Thank you again

    IgorMi

  • RE: Transactions 4

    Nils Gustav Stråbø (6/8/2012)


    IgorMi (6/8/2012)Hi

    I missed it intentionally. I just tried with IGNORE_DUP_KEY=OFF and the result is same.

    IgorMi

    Let's end the discussion once and for all 🙂

    The original question with ignore_dup_key=on:

    create...

  • RE: Transactions 4

    John Mitchell-245523 (6/8/2012)


    IgorMi (6/8/2012)


    Try with XACT_ABORT = OFF and you'll see the same results as it is ON. In this case XACT_ABORT does not have impact of the inserted rows....

  • RE: Transactions 4

    John Mitchell-245523 (6/8/2012)


    IgorMi (6/8/2012)


    Try with XACT_ABORT = OFF and you'll see the same results as it is ON. In this case XACT_ABORT does not have impact of the inserted rows....

  • RE: Transactions 4

    John Mitchell-245523 (6/8/2012)


    IgorMi (6/8/2012)


    I don't agree with you.

    Ensured with a direct try.

    You can execute the following code and ensure yourself that the IGNORE_DUP_KEY = ON has done its effect.

    create...

  • RE: Transactions 4

    Nils Gustav Stråbø (6/8/2012)


    Thanks for the question.

    The result of the final SELECT statement would have been the same even if you had dropped the IGNORE_DUP_KEY=ON. The only difference is that...

  • RE: Transactions 4

    paul.knibbs (6/8/2012)


    Looking at the answers, I guess a lot of people think IGNORE_DUP_KEY means it'll allow duplicates to be inserted--which, to be fair, actually makes sense from a strict English...

  • RE: Rows Value Into Column

    Gianluca Sartori (6/7/2012)


    IgorMi (6/7/2012)


    Hi

    This code also returns the result you want:

    This sure does the trick, but please take into account that avoiding cursors is considered a best practice.

    Generally speaking, cursors...

  • RE: Rows Value Into Column

    Hi

    This code also returns the result you want:

    create table SampleTable(

    id int,

    [name] varchar(20),

    [Value] varchar(20),

    parentId int

    )

    insert into SampleTable(id,name,Value,parentId)

    values

    (100,'Define','KIA',2),

    (200,'Measure','Tollgate',2),

    (300,'Control','Workshield',2),

    (400,'Analyse','fileFolder',2),

    (500,'Imporve','Gate',2)

    go

    declare @id int

    declare @name varchar(20)

    declare @value varchar(20)

    declare @parentId int

    declare @msg varchar(1000)

    declare Kursor Cursor for

    with...

  • RE: Insert XML into SQL Table

    GSquared (6/5/2012)


    I think this will get you started:

    DECLARE @XML XML = '<?xml version="1.0" encoding="UTF-8"?>

    <sessions accountId=''48152'' startDate=''2012-05-27'' startTime=''00:00:00'' endDate=''2012-05-28'' endTime=''00:00:00''>

    <session applicationId=''357627'' applicationName=''app1'' startTime=''00:48:54'' startDate=''2012-05-27'' type=''abc'' direction=''outbound'' durationMinutes=''0.43'' token=''113ddd5999257543963a760789fc12344f27cb0bcc519f0ce6d3a907fccb0d56361c4e3151c3780c35c752cb'' bridged=''false'' callerId=''1234567890'' sessionId=''86c368af24d7eab2a84ec6660704f3d4''...

  • RE: Insert XML into SQL Table

    Sean Lange (6/5/2012)


    IgorMi (6/5/2012)


    Hi,

    It is like the other inserts.

    Example

    The table:

    CREATE TABLE [dbo].[UrlSet](

    [Tip] [smallint] NOT NULL,

    [xml] NULL

    )

    The insert:

    Insert Into UrlSet(Tip,url)

    Values (1,'<Urls NavigationGroup="1">

    <Item ItemUrl="~/About.aspx" />

    </Urls>')

    I don't know what your...

  • RE: Insert XML into SQL Table

    Hi,

    It is like the other inserts.

    Example

    The table:

    CREATE TABLE [dbo].[UrlSet](

    [Tip] [smallint] NOT NULL,

    [xml] NULL

    )

    The insert:

    Insert Into UrlSet(Tip,url)

    Values (1,'<Urls NavigationGroup="1">

    <Item ItemUrl="~/About.aspx" />

    </Urls>')

Viewing 15 posts - 1,096 through 1,110 (of 1,169 total)