Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
SridharIf you are changing the column datatypes on a big table, make sure you have
enough space on the log drive, to allow the log to grow.
If you have any constraints (like defaults, indexes, primary and foreign
keys etc.) defined on the columns being altered, make cure you remove those
before the alter and readd them later.
if the tables are related using multiple foreign keys, then you'll have to
drop the constraints in the right order and readd them in the right order as
well.
Make sure you test your scripts in your test environment.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar|||Thanks..I have taken care of the dropping
constraints ,indexes and adding them in ordered way in my
script...i am worried about the log and data file size
growth...
>--Original Message--
>If you are changing the column datatypes on a big table,
make sure you have
>enough space on the log drive, to allow the log to grow.
>If you have any constraints (like defaults, indexes,
primary and foreign
>keys etc.) defined on the columns being altered, make
cure you remove those
>before the alter and readd them later.
>if the tables are related using multiple foreign keys,
then you'll have to
>drop the constraints in the right order and readd them in
the right order as
>well.
>Make sure you test your scripts in your test environment.
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
><anonymous@.discussions.microsoft.com> wrote in message
>news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
>Hi,
>I am in the process of converting all char and varchar
>colums to nchar /nvarchar ...I am done with all the
>scripts required for conversion..Can someone help me in
>precautions to be taken care while doing this upgrade
>like data file size , log file size etc......
>
>Sridhar
>
>.
>
Showing posts with label char. Show all posts
Showing posts with label char. Show all posts
Wednesday, March 28, 2012
precautions for conversion
Labels:
char,
conversion,
converting,
database,
microsoft,
mysql,
nchar,
nvarchar,
oracle,
precautions,
process,
required,
server,
sql,
thescripts,
varcharcolums
precautions for conversion
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar
If you are changing the column datatypes on a big table, make sure you have
enough space on the log drive, to allow the log to grow.
If you have any constraints (like defaults, indexes, primary and foreign
keys etc.) defined on the columns being altered, make cure you remove those
before the alter and readd them later.
if the tables are related using multiple foreign keys, then you'll have to
drop the constraints in the right order and readd them in the right order as
well.
Make sure you test your scripts in your test environment.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar
|||Thanks..I have taken care of the dropping
constraints ,indexes and adding them in ordered way in my
script...i am worried about the log and data file size
growth...
>--Original Message--
>If you are changing the column datatypes on a big table,
make sure you have
>enough space on the log drive, to allow the log to grow.
>If you have any constraints (like defaults, indexes,
primary and foreign
>keys etc.) defined on the columns being altered, make
cure you remove those
>before the alter and readd them later.
>if the tables are related using multiple foreign keys,
then you'll have to
>drop the constraints in the right order and readd them in
the right order as
>well.
>Make sure you test your scripts in your test environment.
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
><anonymous@.discussions.microsoft.com> wrote in message
>news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
>Hi,
>I am in the process of converting all char and varchar
>colums to nchar /nvarchar ...I am done with all the
>scripts required for conversion..Can someone help me in
>precautions to be taken care while doing this upgrade
>like data file size , log file size etc......
>
>Sridhar
>
>.
>
sql
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar
If you are changing the column datatypes on a big table, make sure you have
enough space on the log drive, to allow the log to grow.
If you have any constraints (like defaults, indexes, primary and foreign
keys etc.) defined on the columns being altered, make cure you remove those
before the alter and readd them later.
if the tables are related using multiple foreign keys, then you'll have to
drop the constraints in the right order and readd them in the right order as
well.
Make sure you test your scripts in your test environment.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar
|||Thanks..I have taken care of the dropping
constraints ,indexes and adding them in ordered way in my
script...i am worried about the log and data file size
growth...
>--Original Message--
>If you are changing the column datatypes on a big table,
make sure you have
>enough space on the log drive, to allow the log to grow.
>If you have any constraints (like defaults, indexes,
primary and foreign
>keys etc.) defined on the columns being altered, make
cure you remove those
>before the alter and readd them later.
>if the tables are related using multiple foreign keys,
then you'll have to
>drop the constraints in the right order and readd them in
the right order as
>well.
>Make sure you test your scripts in your test environment.
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
><anonymous@.discussions.microsoft.com> wrote in message
>news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
>Hi,
>I am in the process of converting all char and varchar
>colums to nchar /nvarchar ...I am done with all the
>scripts required for conversion..Can someone help me in
>precautions to be taken care while doing this upgrade
>like data file size , log file size etc......
>
>Sridhar
>
>.
>
sql
Labels:
char,
conversion,
converting,
database,
microsoft,
mysql,
nchar,
nvarchar,
oracle,
precautions,
process,
required,
server,
sql,
thescripts,
varcharcolums
precautions for conversion
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
SridharIf you are changing the column datatypes on a big table, make sure you have
enough space on the log drive, to allow the log to grow.
If you have any constraints (like defaults, indexes, primary and foreign
keys etc.) defined on the columns being altered, make cure you remove those
before the alter and readd them later.
if the tables are related using multiple foreign keys, then you'll have to
drop the constraints in the right order and readd them in the right order as
well.
Make sure you test your scripts in your test environment.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar|||Thanks..I have taken care of the dropping
constraints ,indexes and adding them in ordered way in my
script...i am worried about the log and data file size
growth...
>--Original Message--
>If you are changing the column datatypes on a big table,
make sure you have
>enough space on the log drive, to allow the log to grow.
>If you have any constraints (like defaults, indexes,
primary and foreign
>keys etc.) defined on the columns being altered, make
cure you remove those
>before the alter and readd them later.
>if the tables are related using multiple foreign keys,
then you'll have to
>drop the constraints in the right order and readd them in
the right order as
>well.
>Make sure you test your scripts in your test environment.
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
><anonymous@.discussions.microsoft.com> wrote in message
>news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
>Hi,
>I am in the process of converting all char and varchar
>colums to nchar /nvarchar ...I am done with all the
>scripts required for conversion..Can someone help me in
>precautions to be taken care while doing this upgrade
>like data file size , log file size etc......
>
>Sridhar
>
>.
>
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
SridharIf you are changing the column datatypes on a big table, make sure you have
enough space on the log drive, to allow the log to grow.
If you have any constraints (like defaults, indexes, primary and foreign
keys etc.) defined on the columns being altered, make cure you remove those
before the alter and readd them later.
if the tables are related using multiple foreign keys, then you'll have to
drop the constraints in the right order and readd them in the right order as
well.
Make sure you test your scripts in your test environment.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
Hi,
I am in the process of converting all char and varchar
colums to nchar /nvarchar ...I am done with all the
scripts required for conversion..Can someone help me in
precautions to be taken care while doing this upgrade
like data file size , log file size etc......
Sridhar|||Thanks..I have taken care of the dropping
constraints ,indexes and adding them in ordered way in my
script...i am worried about the log and data file size
growth...
>--Original Message--
>If you are changing the column datatypes on a big table,
make sure you have
>enough space on the log drive, to allow the log to grow.
>If you have any constraints (like defaults, indexes,
primary and foreign
>keys etc.) defined on the columns being altered, make
cure you remove those
>before the alter and readd them later.
>if the tables are related using multiple foreign keys,
then you'll have to
>drop the constraints in the right order and readd them in
the right order as
>well.
>Make sure you test your scripts in your test environment.
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
><anonymous@.discussions.microsoft.com> wrote in message
>news:dcf301c43bf0$dc370680$a401280a@.phx.gbl...
>Hi,
>I am in the process of converting all char and varchar
>colums to nchar /nvarchar ...I am done with all the
>scripts required for conversion..Can someone help me in
>precautions to be taken care while doing this upgrade
>like data file size , log file size etc......
>
>Sridhar
>
>.
>
Monday, March 12, 2012
Possibly incorrect query result
/* Test table */
create table test (c1 char(1), c2 varchar(1));
insert into test values ('','');
/* Query */
select
c1,
len(c1) len_c1,
c2,
len(c2) len_c2
from test
The result of the len(c1) expression is 0. I would expect the correct result to be 1, since "c1" is a fixed-length character string type and the values are right-padded with spaces to fit the defined length, in this case 1.
I'm using SQL Server 2005.
Regards,
Ole Willy Tuv
LEN
Returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.
Change LEN to DATALENGTH and run this
select
c1,
datalength(c1) len_c1,
c2,
datalength(c2) len_c2
from test
select datalength(' '),len(' ')
Denis the SQL Menace
http://sqlservercode.blogspot.com/
Subscribe to:
Posts (Atom)