Forum Replies Created

Viewing 15 posts - 7,591 through 7,605 (of 8,416 total)

  • RE: Performance comparison of using WHILE and CURSOR

    (Before we go on to set-based, let's tidy the RBAR a bit)

    SET NOCOUNT ON

    DECLARE @MyData TABLE(pk INT IDENTITY(1,1) PRIMARY KEY, id INT)

    DECLARE @index INT

    DECLARE @MyID INT

    DECLARE @startTime DATETIME

    DECLARE @endTime DATETIME

    ...

  • RE: SET NOCOUNT ON - Does it need to be set again in nested sprocs?

    It stays in effect in nested procedures, as a simple test shows.

  • RE: How to change a number field into a text?

    hi_abhay78 (6/25/2009)


    select cast(@num as char)

    Heh. Well unless you specifically need that integer as a fixed-length char(30)...

    CONVERT(varchar(11), @num)

    Paul

  • RE: Bulk insert with unique sequence number

    With your clarified description, the IDENTITY column would be closest in behaviour to an Oracle sequence.

    ROW_NUMBER is great for individual set operations, but the next value in the row number...

  • RE: importing muti-value field into sql server 2005

    Until a 'D3' expert comes along, my only suggestion would be to export the data from the source to a delimited file and bulk load that into SQL Server. ...

  • RE: printing 1 to 100 in SQL Server as a batch....

    Peso (6/26/2009)


    According to OP, he wants the numbers PRINTED, because they then are stored in the log file.

    create database [04C87CAC-9AA8-4465-AC6E-921060A604FF];

    go

    alter database [04C87CAC-9AA8-4465-AC6E-921060A604FF] set recovery simple;

    go

    use [04C87CAC-9AA8-4465-AC6E-921060A604FF];

    go

    checkpoint

    select * from fn_dblog(null, null)

    print...

  • RE: Are the posted questions getting worse?

    RBarryYoung (6/25/2009)


    Alvin Ramard (6/25/2009)


    Grant Fritchey (6/25/2009)


    Hey, 2540F82F-05B8-4B01-A237-7A2A634E7D34. I was just talking about you with 0798AE98-F43B-4069-BE9F-5FFB9945D670. Good old 2540F82F, if you don't mind me being personal.

    Are you sure you weren't talking...

  • RE: Problem with trigger

    Carl Federl (6/25/2009)


    Agree that the SQL for an after trigger appears simplier but try with a schema change and the after trigger.

    Bizarre. So if we change the question the...

  • RE: Slow running view

    DCPeterson (6/25/2009)


    A clustered index is ALWAYS unique.

    Was this reply prompted by my post?

    If so, I think you might have missed what I was driving at 🙂

    If you get a minute,...

  • RE: WHY CHECK CONSTRINT IS NOT WORKING

    saidwarak01 (6/25/2009)


    My simple advise to moderators is any kind of post whether it is simple or tuff. It should be properly handled by giving some solution. This forum...

  • RE: printing 1 to 100 in SQL Server as a batch....

    jdurandt (6/25/2009)


    Here is one that uses a cartesian product:

    I love this one! Would use UNION ALL instead of UNION, but still...:-)

  • RE: Backing up info of sys.certificates, sys.symmetric_keys

    Yeah I know what you mean - went through something similar with PCI-DSS (or whatever it was called).

    Heh. You could always upgrade to 2008 Enterprise and use Transparent Database...

  • RE: How to transpose from Row to Columns with out using Pivot

    Cool stuff Chris. Of course it leaves me wondered about the hash aggregate versus stream aggregate thing but hey.

    So PIVOT can be slightly more efficient - if you can...

  • RE: Sub-Query or Left-Outer Join (Performance Wise)

    Grant Fritchey (6/25/2009)


    While I'm in agreement with the general statements of the post, I've got a pick a nit with this part. The algebrizer creates the parse tree, the first...

  • RE: Problem with trigger

    ...the AFTER trigger version of my code is simpler as expected:

    ALTER TRIGGER trg_cnsmr_accnt_ai

    ON dbo.cnsmr_accnt

    AFTER INSERT

    AS

    BEGIN

    IF@@ROWCOUNT = 0 RETURN;

    SET NOCOUNT ON;

    SET ROWCOUNT 0;

    ;WITHOrdered AS

    (

    SELECTcnsmr_id,

    cnsmr_id + '-' + CONVERT(VARCHAR(10), 100 + ROW_NUMBER()...

Viewing 15 posts - 7,591 through 7,605 (of 8,416 total)