Forum Replies Created

Viewing 15 posts - 1,486 through 1,500 (of 3,011 total)

  • RE: how to replace uncounted multiple commas into one comma

    Nested REPLACE works just fine:

    print 'Load Test data with all strings of Commas from 1 to 8000'

    select

    NUMBER,

    Commas = convert(varchar(8000),replicate(',',NUMBER))

    into

    #t

    from

    -- Number Table Function available here:

    -- http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47685

    F_TABLE_NUMBER_RANGE(1,8000)

    order by

    NUMBER

    go

    print 'Test Replaces'

    select

    *

    from

    (

    select

    NUMBER,

    Commas =

    replace(replace(replace(replace(replace(replace(replace(Commas

    ,',,,,,,,,,,',',')

    ,',,,,,,,,,,',',')

    ,',,,,,,,,,,',',')

    ,',,',',')

    ,',,',',')

    ,',,',',')

    ,',,',',')

    from

    #t

    )...

  • RE: Dude, Your Fly is Open

    In a public forum like SSC, I think it is more important to correct errors in the thread directly than to worry about someone’s feelings. The damage that can...

  • RE: Does Relationships help improving query performance?

    Noman Tariq (2/15/2010)


    So, If i say it like that, we dont need to add FKs if we have no problem with data integrity because our application flow will handle this....

  • RE: Date constraints

    Jeffrey Williams-493691 (2/11/2010)


    Michael Valentine Jones (2/11/2010)[h]I was aware of that potential problem, and that is why I used the REPLACE to remove the - characters from the date to change...

  • RE: Date constraints

    Jeffrey Williams-493691 (2/11/2010)


    Michael Valentine Jones (2/11/2010)


    As other people have suggested, you would be better off using a datetime column.

    This will verify the correct format and ensure that it is a...

  • RE: Date constraints

    As other people have suggested, you would be better off using a datetime column.

    This will verify the correct format and ensure that it is a valid date.

    ALTER TABLE dbo.MyTable

    CONSTRAINT CHK_MyTable__MyDateCol

    CHECK

    (

    case

    when...

  • RE: How do you decide which databases belong on which servers?

    An additional thing I always look at is maintenance windows.

    If you need down time to install OS patches, run diagnostics, etc., you don't want a mix of applcations on a...

  • RE: SQL Server on a virtual server

    We have about 50 SQL Servers on VMs, mostly production, but some are development. We do not generally put highly loaded servers on VMs, but they are great for...

  • RE: backup job error

    You should check to make sure the location you are backing up to has space available.

  • RE: Is sort order important in index?

    I think you are ignoring the cost of what happens when you insert the data.

    I think it would cause intense fragmentation of the index if you inserted a sequentially increasing...

  • RE: Can someone give me the syntax for calculating time?

    I'm not sure you clearly explained your requirements.

    Do you want to push to next Monday at 9:00 am always, or only when it is Saturday or Sunday?

    The code...

  • RE: how to take the backup of the datbase excluding some tables.

    You should be aware that you cannot use a file or filegroup backup to recover a table to a different point in time than the rest of the database.

  • RE: DBCC Timewarp

    Has anyone figured out the parameter sequence to restore a database that doesn’t exist from an alternate timeline where it would have existed if the development project hadn’t failed?

  • RE: Best code for generating sequence numbers

    If you really need to do something like this, you don't need to worry about transactions if you use the OUTPUT clause of the UPDATE statement to return the new...

  • RE: Interesting deadlock with no fix

    Prakash Heda (2/3/2010)


    Michael Valentine Jones (2/2/2010)


    Since the deadlock victim is the select, there is a good chance that setting the database to READ_COMMITTED_SNAPSHOT will prevent the deadlocks and it will...

Viewing 15 posts - 1,486 through 1,500 (of 3,011 total)