Hey, I was just kidding. I know these things happen :) All designs are
interested in consulting services. All other replies will be ignored :)
"John Rugo" <jjrugo@patmedia.net> wrote in message
news:ujY%23fXUrDHA.2012@TK2MSFTNGP12.phx.gbl...
> Yes I know. I had build this with international support in mind; but that
> has changed, and I wanted to optimize as much a spossible.
>
> Thanks
>
> "Louis Davidson" <dr_dontspamme_sql@hotmail.com> wrote in message
> news:eysfXuLrDHA.392@TK2MSFTNGP11.phx.gbl...
> > Well, technically the preferred method is to get the datatype right the
> > first time :)
> >
> > This code may help. Here is a sample table:
> >
> > drop table testTheory
> > go
> > create table testTheory
> > (
> > id int,
> > value nvarchar(10) not null,
> > value2 nvarchar(100) null,
> > )
> > go
> >
> > --this will build a script to find nvarchar columns and change them to
> > varchar ones.
> > select 'alter table [' + table_name + '] alter column [' + column_name +
> ']
> > varchar('+ cast(character_maximum_length as varchar(10)) + ')' +
> > case when is_nullable = 'Yes' then ' NULL ' else ' NOT NULL ' end
> > from information_schema.columns
> > where data_type = 'nvarchar'
> > go
> >
> > --this was the output
> > alter table [testTheory] alter column [value] varchar(10) NOT NULL
> > alter table [testTheory] alter column [value2] varchar(100) NULL
> >
> > --
>
> --------------------------------------------------------------------------
> --
> > -----------
> > Louis Davidson (drsql@hotmail.com)
> > Compass Technology Management
> >
> > Pro SQL Server 2000 Database Design
> >
http://www.apress.com/book/bookDisplay.html?bID=266 > >
> > Note: Please reply to the newsgroups only unless you are
> > interested in consulting services. All other replies will be ignored :)
> >
> > "John Rugo" <jjrugo@patmedia.net> wrote in message
> > news:OJyJbaErDHA.2692@TK2MSFTNGP09.phx.gbl...
> > > yes. Somthing to seak out every table and row definition and
> > automatically
> > > change the data type from NVarChar to VarChar.
> > >
> > > "Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
> > > news:epJCKT$qDHA.2312@TK2MSFTNGP12.phx.gbl...
> > > > Do you mean aside from the ALTER TABLE statement?
> > > >
> > > >
> > > >
> > > > > Hi All,
> > > > > Is there a prefered method of changing a bunch of fields from
> NVarChar
> > > to
> > > > > VarChar?
> > > >
> > > >
> > >
> > >
> >
> >
>
>