Home All Groups Group Topic Archive Search About

Option to select utf-8 when scripting stored procedures

Author
19 Jun 2006 7:27 PM
Dan Shookowsky
I'm using SQL Server 2005 and using Subversion for source code control.  I
had been saving some stored procedures from the SQL Server management studio
and committing them to the repository with no issue.  I only noticed an issue
when I wanted to compare changes between my working copy and the Repository. 
Apparently SQL Server stores the files as UTF-16 which Subversion treats as
binary.  Is there any way to force SQL to script the stored procs as UTF-8?

Author
19 Jun 2006 10:05 PM
Erland Sommarskog
Dan Shookowsky (DanShookow***@discussions.microsoft.com) writes:
> I'm using SQL Server 2005 and using Subversion for source code control.
> I had been saving some stored procedures from the SQL Server management
> studio and committing them to the repository with no issue.  I only
> noticed an issue when I wanted to compare changes between my working
> copy and the Repository.  Apparently SQL Server stores the files as
> UTF-16 which Subversion treats as binary.  Is there any way to force SQL
> to script the stored procs as UTF-8?

Script to a query window. Then when save, there is an arrow on the
Save button where you can choose Save with Encoding. You can here select
UTF-8.

Personally, I think scripting to put thing under source control, is akin
to source control C code by disassembling the object files.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
20 Jun 2006 12:46 PM
Dan Shookowsky
I'd love to use the built-in version control in SQL 2005, but there's only a
plug-in for Visual Source Safe and I trust it about as far as I can
comfortably spit a rat.

Show quote
"Erland Sommarskog" wrote:

> Dan Shookowsky (DanShookow***@discussions.microsoft.com) writes:
> > I'm using SQL Server 2005 and using Subversion for source code control.
> > I had been saving some stored procedures from the SQL Server management
> > studio and committing them to the repository with no issue.  I only
> > noticed an issue when I wanted to compare changes between my working
> > copy and the Repository.  Apparently SQL Server stores the files as
> > UTF-16 which Subversion treats as binary.  Is there any way to force SQL
> > to script the stored procs as UTF-8?
>
> Script to a query window. Then when save, there is an arrow on the
> Save button where you can choose Save with Encoding. You can here select
> UTF-8.
>
> Personally, I think scripting to put thing under source control, is akin
> to source control C code by disassembling the object files.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>
Author
21 Jun 2006 10:04 PM
Erland Sommarskog
Dan Shookowsky (DanShookow***@discussions.microsoft.com) writes:
> I'd love to use the built-in version control in SQL 2005, but there's
> only a plug-in for Visual Source Safe and I trust it about as far as I
> can comfortably spit a rat.

Not sure what you mean with that comment. We have used source control
with SQL Server since 4.x, and all we use is Textpad + VSS Explorer.
(Yes, I admit that we use SourceSafe.)


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
28 Jun 2006 3:15 PM
Vern Rabe
Erland, do you know if there's a way to change the default?

Thanks
Vern Rabe

Show quote
"Erland Sommarskog" wrote:

> Dan Shookowsky (DanShookow***@discussions.microsoft.com) writes:
> > I'm using SQL Server 2005 and using Subversion for source code control.
> > I had been saving some stored procedures from the SQL Server management
> > studio and committing them to the repository with no issue.  I only
> > noticed an issue when I wanted to compare changes between my working
> > copy and the Repository.  Apparently SQL Server stores the files as
> > UTF-16 which Subversion treats as binary.  Is there any way to force SQL
> > to script the stored procs as UTF-8?
>
> Script to a query window. Then when save, there is an arrow on the
> Save button where you can choose Save with Encoding. You can here select
> UTF-8.
>
> Personally, I think scripting to put thing under source control, is akin
> to source control C code by disassembling the object files.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
>
Author
28 Jun 2006 10:18 PM
Erland Sommarskog
Vern Rabe (VernR***@discussions.microsoft.com) writes:
> Erland, do you know if there's a way to change the default?

There does not seem to be any setting fot this. But I would expect that
the encoding is retained for existing files.

--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button