When I say garbage I mean something like the following...sub insert_the_string { my $old_file = shift; my $new_file = $old_file . "sql2"; my $line = ''; open(OLD, "< $old_file"); open(NEW, "> $new_file"); my $text .= concatenate_string_to_insert(); # documentation header $text .= "as\n"; my $as_RE = "AS"; # replace the first occurance of 'AS' after the + stored procedure definition select(NEW); # new default for print while (defined($line = <OLD>) ){ # chomp $line; if ($line =~ s/$as_RE/$text/) { chomp $line; $line .= <OLD>; redo unless eof(OLD); } print NEW $line; } close(OLD); close(NEW); rename($old_file, "$old_file.orig"); rename($new_file, $old_file); }
/****** Object: Stored Procedure dbo.a_sp_D_Add Script Date: 02/04 +/2002 17:00:18 ******/ ਍⼀⨀⨀⨀⨀⨀⨀  +ऀഀഀ Marina Motchkina ਍          + ऀ 㐀⼀ ㌀⼀  +;㈀ഀഀ ਍ऀ匀儀䰀 昀漀爀& +#8192;䐀砀砀砀 挀漀洀 +瀀漀渀攀渀琀猀ഀഀ +; ******/ ਍ഀഀ CREATE PROCEDURE a_sp_D_Add ਍ऀ䀀吀愀戀氀攀一 +愀洀攀 瘀愀爀挀੦ +4;愀爀⠀㌀ ⤀ഀഀ ਍ഀഀ as ਍ऀ搀攀挀氀愀爀攀 + 䀀猀琀爀匀儀䰀  +;瘀愀爀挀栀愀爀⠀
 +312;   ⤀ഀഀ select @strSQL='SELECT ' + @TableName+'.* '+ ' FROM ' + @TableName + +' WITH (NOLOCK) WHERE '+ @TableName+'.'+@TableName+'Counter =0' ਍ഀഀ ਍ഀഀ ਍ഀഀ GO ਍匀䔀吀 儀唀伀吀 +䔀䐀开䤀䐀䔀一吀º +88;䘀䤀䔀刀 伀䘀䘀 +192;ഀഀ GO ਍匀䔀吀 䄀一匀䤀 +开一唀䰀䰀匀 伀ߌ +8; ഀഀ GO ਍ഀഀ
In reply to Re: Problems with Unicode files generated with SQL Server
by Cuchulain
in thread Problems with Unicode files generated with SQL Server
by Cuchulain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |