Forum Replies Created

Viewing 15 posts - 6,481 through 6,495 (of 7,597 total)

  • RE: String Manipulation

    Technically it should be:

    LEFT(myString, CHARINDEX(' ', myString + ' ') - 1)

    unless you want a trailing space in the result :-).

    Adding the "+ ' '" will cause the code to...

  • RE: Find the last 6 Tuesdays or Wed or Whatever day.

    You can use the general calc shown below to get the nearest day of any day:

    SELECT

    date,

    DATEADD(DAY, DATEDIFF(DAY, '19000101', date) / 7 *...

  • RE: Index Fill Factor

    FILLFACTOR can have a major impact on performance, depending on the table and the data usage patterns.

    However, a FILLFACTOR of "80" is not necessarily good or bad in and of...

  • RE: Audit log for INSTEAD OF DELETE trigger

    webrunner (7/25/2013)


    Thanks, Scott,

    By "prevents the actual statement from running" do you mean the original DELETE statement? And then any code in the trigger after the ROLLBACK does get run? That...

  • RE: Audit log for INSTEAD OF DELETE trigger

    Eugene Elutin (7/25/2013)


    webrunner (7/25/2013)


    Thanks, Eugene, I see. I had commented out the ROLLBACK for my INSTEAD OF trigger so didn't understand the behavior you just posted with the test code....

  • RE: Audit log for INSTEAD OF DELETE trigger

    Easy enough to demonstrate that:

    USE tempdb --you can use a "real" db if you prefer

    GO

    IF EXISTS(SELECT 1 FROM sys.tables WHERE name = 'table1' AND schema_id = 1)

    ...

  • RE: Audit log for INSTEAD OF DELETE trigger

    Eugene Elutin (7/25/2013)


    Alexander Suprun (7/24/2013)


    Eugene Elutin (7/24/2013)


    RAISERROR cause transaction to rollback, so your log insert is rollbacked as well as delete...

    It's so untrue...

    RAISERROR has nothing to do with the transaction.

    It's...

  • RE: Audit log for INSTEAD OF DELETE trigger

    webrunner (7/24/2013)


    Alexander Suprun (7/24/2013)


    Remove ROLLBACK from the trigger and lower severity of RAISERROR to 10, in this case SSMS won't show any errors, rows will disappear from the UI (but...

  • RE: do I need to use case explicily

    You don't need to explicitly cast it in this case, because integer has a higher precedence than varchar, so SQL will implicitly force the varchar to integer.

    You should check the...

  • RE: Table partition sql 2008 partion key include on cluster index

    From a performance standpoint, a single table can work just as well as partitioning in many cases as long as you have the correct clustered index. But if you've...

  • RE: Looping through table

    This is why cursors exist. Just use a cursor, unless you have an extraordinarily high volume of emails to send.

    CREATE TABLE [dbo].[TestData](

    [text] NULL, --??...

  • RE: Table partition sql 2008 partion key include on cluster index

    You'll get better performance from clustering on the date -- as the only or first key column -- if date/date range is specified in the queries.

    I believe a...

  • RE: search values in a temp table with like operator

    You don't need a CTE. In this case, it would just add complexity for no real reason that I can see :-).

  • RE: search values in a temp table with like operator

    Sean Lange (7/22/2013)


    Sue-651097 (7/22/2013)


    But this doesn't solve the problem with the like operator as I cannot implement the wildcard %, or?

    Yes you can still do a wildcard search.

    inner join #search...

  • RE: Date Validations?

    Michael Valentine Jones (7/22/2013)The CASE expression will verify that the data string is in YYYY-MM-DD format, and is a valid date. It will return a 1 if the date...

Viewing 15 posts - 6,481 through 6,495 (of 7,597 total)