Forum Replies Created

Viewing 15 posts - 5,116 through 5,130 (of 7,613 total)

  • RE: Storing Values for Bitwise &

    Yikes, how many possible "status"es are there??

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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 *...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Storing Values for Bitwise &

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

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: DISTICT STATEMENT GET MY QEURY SLOW.

    GG_BI_GG (5/8/2015)


    I get some error on the alias columns;

    OUTER APPLY (

    SELECT

    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Information_Schema.Routines

    ...

    and routine_name not like '%B_%')

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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 ......

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • 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...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 5,116 through 5,130 (of 7,613 total)