Viewing 15 posts - 841 through 855 (of 13,445 total)
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...
August 8, 2016 at 8:34 pm
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 <>...
August 8, 2016 at 9:04 am
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';
August 8, 2016 at 8:47 am
TheSQLGuru (8/7/2016)
August 7, 2016 at 2:15 pm
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...
August 7, 2016 at 1:28 pm
wow Line 74851
thats a huge proc to debug.
at that size, it must be doing a zillion things, that's rough.
July 30, 2016 at 6:37 am
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...
July 29, 2016 at 1:26 pm
homebrew01 (7/29/2016)
The query runs on Server_A, via Linked Server to Server_B, where both tables reside.
If I...
July 29, 2016 at 12:49 pm
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...
July 29, 2016 at 12:39 pm
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...
July 29, 2016 at 10:43 am
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...
July 29, 2016 at 8:35 am
Alan.B (7/28/2016)
July 28, 2016 at 8:16 pm
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...
July 27, 2016 at 9:59 am
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...
July 25, 2016 at 12:46 pm
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...
July 25, 2016 at 9:30 am
Viewing 15 posts - 841 through 855 (of 13,445 total)