Forum Replies Created

Viewing 15 posts - 5,101 through 5,115 (of 7,597 total)

  • RE: Storing Values for Bitwise &

    Sean Lange (5/7/2015)


    nick.latocha (5/7/2015)


    This was my prototype:

    create table #items (itemID varchar(10), statusID int)

    create table #statuses (statusName varchar(50), statusID int)

    insert into #items values ('Item 1',1|2|8)

    insert into #items values ('Item 2',1|4)

    select *...

  • RE: Storing Values for Bitwise &

    You can use bigint, doubling the bits from an int ;-).

  • RE: check how many rows delete updated per day and store it in another table?

    SQL does sort of track modification counts (for indexes, not heaps), but the data is cumulative and does necessarily persist. Look at view:

    sys.dm_db_index_operational_stats

    However, while an index is...

  • RE: Table Without PK

    Don't get overly focused on having a primary key per se. Some tables require them, some don't. Data integrity is vital, but a primary key doesn't guarantee it...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    GG_BI_GG (5/8/2015)


    I get some error on the alias columns;

    OUTER APPLY (

    SELECT

    ...

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    The table design is probably less than ideal/perfect.

    However, the query can still be improved, hopefully dramatically. Keep in mind that I don't have sample data to test it ahead...

  • RE: Information_Schema.Routines

    ...

    and routine_name not like '%B_%')

  • RE: SQL query help

    TomThomson (5/4/2015)


    Sergiy (5/1/2015)


    TomThomson (5/1/2015)


    No Idiocracy, just people applying the KISS principle, I think.

    It only seems simple for someone who never had to deal with real calling systems.

    5 developers for almost...

  • RE: Transactional Replication & Deleting

    What is the total table size? If the whole table is 20M rows, you're probably better off breaking replication, doing the delete, and then taking a new snapshot to...

  • RE: Random blocking in one table

    I would think SQL would also need a schema stability lock on the table, to make sure the structure doesn't change while it is being read.

    If you use "SELECT ......

  • RE: Shrink System databases

    WhiteLotus (4/28/2015)


    Hi All,

    I have some questions :

    1.Is it OK to shrink Master, model ? the transaction log for those databases are full .

    2.Is it OK to set the Recovery...

  • RE: renaming logical file names

    You should have no problem changing the logical names, except maybe for some scripted restores that have a MOVE clause using the logical name.

  • RE: Query to find distinct multiple instances of a pattern in a string

    SELECT SUBSTRING(string, t.tally + 3, CHARINDEX('##]', string, t.tally + 3) - t.tally - 3)

    FROM ( --#MyTable

    SELECT CAST('William Shakespeare was an English [##poet##], [##playwright##], and [##actor##], widely...

  • RE: Creating Primary Key on temporary table question

    Lynn Pettis (4/30/2015)


    ScottPletcher (4/30/2015)


    ScottPletcher (4/30/2015)


    Don't name the constraint, as constraint names have to be unique.

    ALTER TABLE dbo.test

    ADD PRIMARY KEY CLUSTERED

    ( ReportRunTime, VisitID, SourceID, BaseID, OccurrenceSeqID, [DateTime], SeqID, QueryID, Response );

    The...

  • RE: Creating Primary Key on temporary table question

    ScottPletcher (4/30/2015)


    Don't name the constraint, as constraint names have to be unique.

    ALTER TABLE dbo.test

    ADD PRIMARY KEY CLUSTERED

    ( ReportRunTime, VisitID, SourceID, BaseID, OccurrenceSeqID, [DateTime], SeqID, QueryID, Response );

    The original version was...

Viewing 15 posts - 5,101 through 5,115 (of 7,597 total)