Forum Replies Created

Viewing 15 posts - 1,066 through 1,080 (of 1,169 total)

  • RE: T-SQL Syntax

    Carlo Romagnano (8/17/2012)


    Maybe, you miss the UPDATE clause:

    declare @mykey int

    update top 1 mytable set

    @mykey = mykey

    where status = 0

    print @mykey

    Hi, this is covered in the question itself: ...says "without using...

  • RE: Querying Data From One Table Against Another Table For All Results

    Hi,

    You must miss something simple. I don't know your exact code, however put attention on data types in tables of both databases.

    select col1,col2,...,colN

    from db1.shcema1.table1 tb1

    join db2.schema2.table2 tb2 on convert(nvarchar(100),...

  • RE: Do indexes help tables with large number of columns but small number of records?

    guerillaunit (8/13/2012)


    I am under the assumption that indexes help you find particular records based on hashing on a combination of 1 or more columns. If this is the case, then...

  • RE: Calculating average for 3 consecutive years

    WannaBee (8/12/2012)


    Hi,

    I have this data:

    12/30/2012 0:00Carfordfocus0

    12/30/2011 0:00Carfordfocus11

    12/30/2010 0:00Carfordfocus7

    12/30/2009 0:00Carfordfocus15

    12/30/2008 0:00Carfordfocus6

    12/29/2012 0:00Carfordfocus12

    12/29/2011 0:00Carfordfocus44

    12/29/2010 0:00Carfordfocus21

    12/29/2009 0:00Carfordfocus6

    12/29/2008 0:00Carfordfocus3

    12/30/2012 0:00CarAudiTT8

    12/30/2011 0:00CarAudiTT9

    12/30/2010 0:00CarAudiTT11

    12/30/2009 0:00CarAudiTT24

    12/30/2008 0:00CarAudiTT7

    I need to calculate the average of 3 consecutive years for...

  • RE: Purging old records in SQL table

    Hi,

    Try this code may help you

    ALTER TABLE table_name NOCHECK CONSTRAINT ALL

    ALTER TABLE table_name DISABLE TRIGGER ALL

    make your delete

    ALTER TABLE table_name CHECK CONSTRAINT ALL

    ALTER TABLE table_name ENABLE TRIGGER ALL

    Regards

    IgorMi

  • RE: temp tables work oddly

    SQLKnowItAll (7/30/2012)


    What do you mean by "it does not work?" You mean it never completes? I assume you have a create table statement for your temporary table or a...

  • RE: temp tables work oddly

    Sachin Nandanwar (7/29/2012)


    Does this work ?

    ....FROM #ddb_temp_DDB tdb

    where not exists (select 1 from deposits_daily_balance ddb_t

    where ddb_t.num_cue_s =tdb.num_cue_s and ddb_t.val_date_d = @t_date_d and ddb_t.reg_date_d =...

  • RE: temp tables work oddly

    Despite your claim and based on the fact that you have no triggers (and I'm assuming no Indexed Views), the only thing that will give you a PK violation is...

  • RE: Insert FK conflict

    Dear All,

    I finally manged to overpass the problem. I replaced the join with not exists ().

    Anyway, I was making various selects in order to find any duplicate records, or any...

  • RE: Insert FK conflict

    Kingston Dhasian (7/27/2012)


    Do you have any trigger on the table "deposits_daily_balance"?

    No triggers, no any other constraints

    Regards

    IgorMi

  • RE: Insert FK conflict

    Gazareth (7/27/2012)


    Hi,

    What's the definition of the foreign key "CwFKaccounts2deposits_daily_balance"?

    Thanks

    ALTER TABLE [dbo].[deposits_daily_balance] WITH NOCHECK ADD CONSTRAINT [CwFKaccounts2deposits_daily_balance] FOREIGN KEY([num_cue_s])

    REFERENCES [dbo].[accounts] ([num_cue_s])

    GO

    ALTER TABLE [dbo].[deposits_daily_balance] CHECK CONSTRAINT [CwFKaccounts2deposits_daily_balance]

    GO

  • RE: Introduction to Indexes: Part 3 – The nonclustered index

    GilaMonster (7/20/2012)


    Don't do that. Waste of time. It is highly, exceedingly unlikely that it's faster to create all the indexes then run the query then drop the indexes than to...

  • RE: Introduction to Indexes: Part 3 – The nonclustered index

    GilaMonster (7/20/2012)


    I don't understand what you're asking.

    My question is the following:

    there is an existing table with lets say 5 indexes(1 clustered + 4 nonclustered).

    The Estimated Execution Plan of SSMS, for...

  • RE: Introduction to Indexes: Part 3 – The nonclustered index

    Hi Gail

    I want to thank you for your effort on indexes.

    I'll use this opportunity to ask a question.

    Example: There is a Table with one clustered index and some non-clustered. It...

  • RE: Snapshots

    Luis Cazares (7/19/2012)


    Why is everyone so upset about the answer? It's clear that the question is if you can restore the database without deleting the other snapshots. Otherwise you wouldn't...

Viewing 15 posts - 1,066 through 1,080 (of 1,169 total)