Forum Replies Created

Viewing 15 posts - 4,771 through 4,785 (of 7,619 total)

  • RE: Time posted does not indicate time zone

    You're right. I hadn't search thru the Profile settings before, but time zone was in there, and was somehow wrong for my location.

    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: Convert Cursor to a Recursive CTE or a normal Query

    NOT EXISTS might also be an option here.

    I don't see anything in the original code that indicates that Blocked or Doc Type must match in the CR Log, but naturally...

    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: Pagination in T-SQL to be done on 50000 records . Display 20 rows at single time

    Unfortunately I can't get the files from my web link at work due to internal issues (seemingly neverending!).

    Rather than actual partitioning, try clustering the table on CustomerID, start date and...

    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: cluster node licensing

    Not if: (1) you have software assurance on the active node and (2) it is truly passive.

    From MS's licensing docs [emphasis added by me]:

    "

    Beginning with SQL Server 2014, each active...

    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: ForeignKey points to not the most appropriate index of the referenced table

    SQL's priority is to use the index with fewer pages, because of less I/O which equal less overhead. Thus, to link FKs to the clustered index, you need 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: TRY CATCH and ROLLBACK question...

    You would need an explicit transaction. In fact, the ROLLBACK itself will give you an error unless a transaction is active, so even with an explicit trans, you need...

    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: Find characters before and after _

    SELECT LEFT(column_name, CHARINDEX('_', column_name + '_') - 1) AS before_underscore,

    SUBSTRING(column_name, CHARINDEX('_', column_name + '_') + 1, 2000) AS after_underscore

    FROM table_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: Dynamic SQL Question

    Luis Cazares (9/21/2015)


    WayneS (9/21/2015)


    Kristen-173977 (9/20/2015)


    GilaMonster (9/19/2015)


    protecting against SQL Injection is done, in most cases, by ensuring that it is parameterised, except for the rare scenario where the user input...

    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: Error while rebuild indexes

    This really looks like a trigger. Check for db-level (DDL) triggers. If not, check for server-based triggers (that seems unlikely in this case, though). For example:

    SELECT t.*

    FROM...

    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: What type of Index would be suitable

    SQL provides some help here.

    You can use missing index views

    sys.dm_db_missing_index*

    and the index stats view:

    sys.dm_db_index_usage_stats

    to help determine what indexes to create.

    First and absolutely foremost, you need to determine and implement 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".

  • RE: Best way to handle like% on column too large for an index

    If you don't require an nvarchar search, you can use varchar and get 900 chars to search.

    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: Best way to handle like% on column too large for an index

    Since you're always searching at the start of the string, you could add a persisted computed column of ~900 bytes and search on that:

    ALTER TABLE ourtable

    ADD bigcolumn_search AS CAST(LEFT(bigcolumn, 450)...

    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: How to Exclude based on Condition?

    Here's another method to try, just in case:

    SELECT

    ta.last_name,

    ta.first_name,

    tb.ID

    FROM

    TableA ta

    INNER...

    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: get week numbers from dates, saturday being start of the week,

    That code is dependent on the DATEFIRST setting, and I don't believe it's accurate anyway. Maybe this?:

    --additional dates for testing/verification

    INSERT INTO #weekdays (datevalue, numericvalue) VALUES

    ('20150101', 1000),

    ('20150102', 1001),

    ('20150103', 1001),

    ('20150104', 1001),

    ('20150105',...

    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: Re-design messaging table SQL Server 2008

    The design is basic, but it seems workable for very straightforward messaging.

    Just some possibilities, not necessarily better than what you have:

    1) I agree with an identity column on the Message...

    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 - 4,771 through 4,785 (of 7,619 total)