Forum Replies Created

Viewing 15 posts - 841 through 855 (of 13,445 total)

  • RE: Replace commas from all columns in a Table (Just one table)

    the data is the data. don't modify the data, modify the query that is exporting to csv.

    if you use SSIS, you can modify it to export everything with double...

  • RE: Rename Column with comma

    i think you want something like this:

    SELECT

    'exec sp_rename ''' + QUOTENAME(Table_Name) + '.' + QUOTENAME(REPLACE(COLUMN_NAME,'''','''''')) +

    ''', ''' + QUOTENAME(LOWER(REPLACE(COLUMN_NAME,'''',''''''))) + ''', ' + '''COLUMN'';'

    FROM

    Information_Schema.[COLUMNS]

    WHERE COLUMN_NAME <>...

  • RE: Rename Column with comma

    any object name with a single quote in it needs to be escaped in a command:

    exec sp_rename '[table_name].[Rec''d 2007]', '[rec''d 2007]', 'COLUMN';

  • RE: t-sql 2012 use a trigger

    TheSQLGuru (8/7/2016)


    If you do this with a trigger, you MUST make it asynchronous!! I would either put the necessary information into a simple queue-style table or use SQL Server Service...

  • RE: t-sql 2012 use a trigger

    Does the existence of duplicates actually break anything, or is it just a cleanup task because the .net application doesn't check for duplicates before adding the data? the urgency is...

  • RE: ISNULL function does not allow concatenating CHAR's in SQL 2008R2 or earlier

    wow Line 74851

    thats a huge proc to debug.

    at that size, it must be doing a zillion things, that's rough.

  • RE: Linked Server Update "Hung"

    i think it would be like this, right?

    DECLARE @TermToTweak VARCHAR(30) = 'lowell@fake.com'

    DECLARE @cmd VARCHAR(MAX) = 'EXECUTE AT(LinkedServer,''update P

    set P.Email1 = ''' + @TermToTweak + '''

    from MyDatabase.dbo.Profiles P

    JOIN MyDatabase.dbo.Complaints C on...

  • RE: Linked Server Update "Hung"

    homebrew01 (7/29/2016)


    I am doing a pretty simple update of Table_A, based on a join to Table_B

    The query runs on Server_A, via Linked Server to Server_B, where both tables reside.

    If I...

  • RE: Update all fields in a record except incoming NULL values?

    probably with a CASE statement;

    something like this in your proc(assuming parameters are available for all four fields you mentione:

    update Table1

    SET Field1 = CASE WHEN @Field1 IS NULL THEN Field1...

  • RE: Migration to Azure - FillFactor needs to be removed on 200+ indexes

    i use this to script out indexes,

    I just tested it an Azure, no problems, of course.

    i've excluded fillfactor in it, you could tweak the statement generation to whatever you...

  • RE: Get DDL for any SQL 2005 table

    thanks for the code review,m.martinelli! you've pointed out items taht made some vast improvements!

    i incorporated all your ideas, but in my own coding style;

    i had not tested against the newer...

  • RE: Get DDL for any SQL 2005 table

    Alan.B (7/28/2016)


    I just ran across this Lowell, it was exactly what I was looking for and has saved me a lot of time (it's 8:50PM in Chicago and I'm still...

  • RE: Can we log all database user (session) specific data into table?

    i use a variant of this to find procedures that take longer than 15 seconds, tune them one by one, and then lower my threshold until it's a diminishing return...

  • RE: Just a query tool

    Linqpad[/url] is a good alternative; it supports a object explorer type of panel, and multiple tabs with syntax highlighting like SSMS does.

    it's also "portable", meaning you don't have to...

  • RE: dynamically build an extractor for extended events xml

    thanks for the info guys, i'm diging through the details now.

    I've got a solid handle on what i was after now, a fresh set of eyes got me started.

    I'll post...

Viewing 15 posts - 841 through 855 (of 13,445 total)