Forum Replies Created

Viewing 15 posts - 76 through 90 (of 219 total)

  • RE: Transactions

    Toreador (11/24/2010)


    I got it wrong, as the last time I tried any DDL within a transaction was 15 years ago in my Oracle days, when such changes could not be...

  • RE: Transactions

    Nice question.

    CREATE PROC [dbo].[QOD_TransTable]

    What is the purpose of this procedure? 🙂

    Insert into dbo.Items(ItemId,Item,column_b)

    SELECT 1,'first','New'

    GO;

    This part stumped me for a while. 🙂 Due to previous questions, I know that a GO...

  • RE: T-SQL GO statement

    Kenneth Wymore (11/23/2010)


    How often are global temp tables actually used? I recall reading about them when I started using SQL Server but I can't remember ever seeing one used in...

  • RE: temp table in sysobjects

    Carlo Romagnano (11/22/2010)


    Any user can view sysobjects in tempdb:

    Open session ONE:

    create table #a(i int)

    select name,id from tempdb.dbo.sysobjects where name like '#a%'

    Open session TWO with same or another user:

    create table #a(i...

  • RE: temp table in sysobjects

    Carlo Romagnano (11/22/2010)


    Also this is wrong:

    If you used a query like this, you would see your table:

    You will see ALL tables that begins with '#testvm', also, tables belonging to...

  • RE: temp table in sysobjects

    select * from sysobjects where name = '#testvm%'

    This query doesn't work and should be replaced with the following:

    select * from tempdb.dbo.sysobjects where name like '#testvm%'

  • RE: SELECT INTO with a Temp Table

    Iulian -207023 (11/18/2010)


    Do you have at hand some best practices for using DML statements? I am thinking on something like:

    ...

    SET @strQueryDML = 'SELECT ID INTO #tmpID2 FROM tbl1'

    ...

    EXECUTE (@strQueryDML)

    ...

    SELECT ID...

  • RE: COALESCE Vs ISNULL

    I found it interesting that the expression "ISNULL(NULL, NULL)" is of type INT.

    SELECT ISNULL(NULL, NULL) AS A

    INTO QOTD_TABLE;

    EXEC sp_help 'QOTD_TABLE';

    -- Column_name Type

    -- ------------- ------

    --...

  • RE: To switch or not to switch

    "Partitions can be on any column" – this was way too ambiguous... I thought this option was about the column with the same name in both tables (because of the...

  • RE: COLLATION

    Conversion to CHAR is wrong, because in this case we get a collation name which is truncated to 30 symbols: Chinese_Hong_Kong_Stroke_90_CS instead of Chinese_Hong_Kong_Stroke_90_CS_AS_KS_WS, SQL_Latin1_General_CP1250_CI_A insted of SQL_Latin1_General_CP1250_CI_AS etc.

    The type...

  • RE: Incremental additions

    If the author wanted to trick us with the C-like pre-increment operator, this script would be more funny: 🙂

    ...

    select @a = ++@b

    select @a A

    ...

  • RE: Output of Query

    Hugo Kornelis (10/28/2010)


    If you use SET ANSI_NULLS OFF, there is no need to rewrite anyway. The ANSI_NULLS affects all comparisons with NULL, not only those in a [NOT] IN expression.

    Setting...

  • RE: What's the best way to count?

    mtillman-921105 (10/19/2010)


    Oracle's even harder to use.

    Hmm... Are you saying this as a developer or as a DBA?

  • RE: What's the best way to count?

    Hugo Kornelis (10/19/2010)


    The query in window #2 will now finish and show an incorrect result: 4. When the SELECT COUNT query started, there were 3 committed and 2 uncommitted rows;...

  • RE: What's the best way to count?

    Hugo Kornelis (10/19/2010)


    With this additional information, I'd argue that options 2 and 4 are both correct.

    And what do you think about counting uncommitted records, is it such a reliable thing?...

Viewing 15 posts - 76 through 90 (of 219 total)