Showing posts with label posting. Show all posts
Showing posts with label posting. Show all posts

Sunday, March 25, 2012

Change Drive Letter

With reference to my previous posting, it seems that there
may be some misunderstanding.
We have installed a SQL Server 2000 database on the J
drive. However, we would like to rename the J drive to E
drive (Asked by the Network Administrator).
We would like to know is it necessary for us to do
anything for the change of drive letter ? Is it necessary
for us to detach and attach the database when he changes
the drive name? OR Just change the file location of the
database from J to E in EM?
Thanks
Renaming drive letters is really ugly. If you just rename the drive
letter then SQL Server probably wont even start because it will be
looking for the master database primary data file on the wrong drive
letter (which will no longer exist). This can be changed in the
registry but there are a myriad of other problems you will encounter.
It may be best just to detach all you user DBs, uninstall SQL Server,
rename the drive letters, reinstall SQL Server and reattach your user
DBs again (now located on the renamed drive letter). If you'd already
done a fair bit of server config you may want to backup your master,
model & msdb (and potentially distribution DB if configured as a
distributor participating in SQL replication) databases before
uninstalling SQL Server and then restore them after reinstalling.
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Jason wrote:

>With reference to my previous posting, it seems that there
>may be some misunderstanding.
>We have installed a SQL Server 2000 database on the J
>drive. However, we would like to rename the J drive to E
>drive (Asked by the Network Administrator).
>We would like to know is it necessary for us to do
>anything for the change of drive letter ? Is it necessary
>for us to detach and attach the database when he changes
>the drive name? OR Just change the file location of the
>database from J to E in EM?
>Thanks
>
>
|||Actually, this is not as dramati as Mike depicted, but backing up before
doing anything else is always a good idea. Check this article for details:
http://www.support.microsoft.com/kb/224071/EN-US/
"Mike Hodgson" wrote:

> Renaming drive letters is really ugly. If you just rename the drive
> letter then SQL Server probably wont even start because it will be
> looking for the master database primary data file on the wrong drive
> letter (which will no longer exist). This can be changed in the
> registry but there are a myriad of other problems you will encounter.
> It may be best just to detach all you user DBs, uninstall SQL Server,
> rename the drive letters, reinstall SQL Server and reattach your user
> DBs again (now located on the renamed drive letter). If you'd already
> done a fair bit of server config you may want to backup your master,
> model & msdb (and potentially distribution DB if configured as a
> distributor participating in SQL replication) databases before
> uninstalling SQL Server and then restore them after reinstalling.
> --
> *mike hodgson* |/ database administrator/ | mallesons stephen jaques
> *T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
> *E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
>
> Jason wrote:
>
|||That KB article is assuming the binaries directory is not moving too. I
may have misread/misunderstood the OP. I was basing the
uninstall/reinstall suggestion on the presumption that the whole SQL
installation was on the disk to be renamed (binaries, data files, log
files, tempdb, the works). I agree that if the binaries are staying
where they are (eg. on C:\Program Files\...) the you can move DBs
without the need to uninstall/reinstall and if the system DBs (master,
msdb & model) don't need to move then the process is virtually painless
with a simple detach/attach process.
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
rdjabarov wrote:
[vbcol=seagreen]
>Actually, this is not as dramati as Mike depicted, but backing up before
>doing anything else is always a good idea. Check this article for details:
>http://www.support.microsoft.com/kb/224071/EN-US/
>"Mike Hodgson" wrote:
>

Change Drive Letter

With reference to my previous posting, it seems that there
may be some misunderstanding.
We have installed a SQL Server 2000 database on the J
drive. However, we would like to rename the J drive to E
drive (Asked by the Network Administrator).
We would like to know is it necessary for us to do
anything for the change of drive letter ? Is it necessary
for us to detach and attach the database when he changes
the drive name? OR Just change the file location of the
database from J to E in EM?
ThanksThis is a multi-part message in MIME format.
--070500050405010801060608
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Renaming drive letters is really ugly. If you just rename the drive
letter then SQL Server probably wont even start because it will be
looking for the master database primary data file on the wrong drive
letter (which will no longer exist). This can be changed in the
registry but there are a myriad of other problems you will encounter.
It may be best just to detach all you user DBs, uninstall SQL Server,
rename the drive letters, reinstall SQL Server and reattach your user
DBs again (now located on the renamed drive letter). If you'd already
done a fair bit of server config you may want to backup your master,
model & msdb (and potentially distribution DB if configured as a
distributor participating in SQL replication) databases before
uninstalling SQL Server and then restore them after reinstalling.
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Jason wrote:
>With reference to my previous posting, it seems that there
>may be some misunderstanding.
>We have installed a SQL Server 2000 database on the J
>drive. However, we would like to rename the J drive to E
>drive (Asked by the Network Administrator).
>We would like to know is it necessary for us to do
>anything for the change of drive letter ? Is it necessary
>for us to detach and attach the database when he changes
>the drive name? OR Just change the file location of the
>database from J to E in EM?
>Thanks
>
>
--070500050405010801060608
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Renaming drive letters is really ugly. If you just rename the
drive letter then SQL Server probably wont even start because it will
be looking for the master database primary data file on the wrong drive
letter (which will no longer exist). This can be changed in the
registry but there are a myriad of other problems you will encounter.<br>
<br>
It may be best just to detach all you user DBs, uninstall SQL Server,
rename the drive letters, reinstall SQL Server and reattach your user
DBs again (now located on the renamed drive letter). If you'd already
done a fair bit of server config you may want to backup your master,
model & msdb (and potentially distribution DB if configured as a
distributor participating in SQL replication) databases before
uninstalling SQL Server and then restore them after reinstalling.</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
Jason wrote:
<blockquote cite="mid142001c5708a$b5113a10$a401280a@.phx.gbl" type="cite">
<pre wrap="">With reference to my previous posting, it seems that there
may be some misunderstanding.
We have installed a SQL Server 2000 database on the J
drive. However, we would like to rename the J drive to E
drive (Asked by the Network Administrator).
We would like to know is it necessary for us to do
anything for the change of drive letter ? Is it necessary
for us to detach and attach the database when he changes
the drive name? OR Just change the file location of the
database from J to E in EM?
Thanks
</pre>
</blockquote>
</body>
</html>
--070500050405010801060608--|||Actually, this is not as dramati as Mike depicted, but backing up before
doing anything else is always a good idea. Check this article for details:
http://www.support.microsoft.com/kb/224071/EN-US/
"Mike Hodgson" wrote:
> Renaming drive letters is really ugly. If you just rename the drive
> letter then SQL Server probably wont even start because it will be
> looking for the master database primary data file on the wrong drive
> letter (which will no longer exist). This can be changed in the
> registry but there are a myriad of other problems you will encounter.
> It may be best just to detach all you user DBs, uninstall SQL Server,
> rename the drive letters, reinstall SQL Server and reattach your user
> DBs again (now located on the renamed drive letter). If you'd already
> done a fair bit of server config you may want to backup your master,
> model & msdb (and potentially distribution DB if configured as a
> distributor participating in SQL replication) databases before
> uninstalling SQL Server and then restore them after reinstalling.
> --
> *mike hodgson* |/ database administrator/ | mallesons stephen jaques
> *T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
> *E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
>
> Jason wrote:
> >With reference to my previous posting, it seems that there
> >may be some misunderstanding.
> >
> >We have installed a SQL Server 2000 database on the J
> >drive. However, we would like to rename the J drive to E
> >drive (Asked by the Network Administrator).
> >
> >We would like to know is it necessary for us to do
> >anything for the change of drive letter ? Is it necessary
> >for us to detach and attach the database when he changes
> >the drive name? OR Just change the file location of the
> >database from J to E in EM?
> >
> >Thanks
> >
> >
> >
> >
>|||This is a multi-part message in MIME format.
--070302090901030006050107
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
That KB article is assuming the binaries directory is not moving too. I
may have misread/misunderstood the OP. I was basing the
uninstall/reinstall suggestion on the presumption that the whole SQL
installation was on the disk to be renamed (binaries, data files, log
files, tempdb, the works). I agree that if the binaries are staying
where they are (eg. on C:\Program Files\...) the you can move DBs
without the need to uninstall/reinstall and if the system DBs (master,
msdb & model) don't need to move then the process is virtually painless
with a simple detach/attach process.
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
rdjabarov wrote:
>Actually, this is not as dramati as Mike depicted, but backing up before
>doing anything else is always a good idea. Check this article for details:
>http://www.support.microsoft.com/kb/224071/EN-US/
>"Mike Hodgson" wrote:
>
>>Renaming drive letters is really ugly. If you just rename the drive
>>letter then SQL Server probably wont even start because it will be
>>looking for the master database primary data file on the wrong drive
>>letter (which will no longer exist). This can be changed in the
>>registry but there are a myriad of other problems you will encounter.
>>It may be best just to detach all you user DBs, uninstall SQL Server,
>>rename the drive letters, reinstall SQL Server and reattach your user
>>DBs again (now located on the renamed drive letter). If you'd already
>>done a fair bit of server config you may want to backup your master,
>>model & msdb (and potentially distribution DB if configured as a
>>distributor participating in SQL replication) databases before
>>uninstalling SQL Server and then restore them after reinstalling.
>>--
>>*mike hodgson* |/ database administrator/ | mallesons stephen jaques
>>*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
>>*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
>>
>>Jason wrote:
>>
>>With reference to my previous posting, it seems that there
>>may be some misunderstanding.
>>We have installed a SQL Server 2000 database on the J
>>drive. However, we would like to rename the J drive to E
>>drive (Asked by the Network Administrator).
>>We would like to know is it necessary for us to do
>>anything for the change of drive letter ? Is it necessary
>>for us to detach and attach the database when he changes
>>the drive name? OR Just change the file location of the
>>database from J to E in EM?
>>Thanks
>>
>>
>>
--070302090901030006050107
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>That KB article is assuming the binaries directory is not moving
too. I may have misread/misunderstood the OP. I was basing the
uninstall/reinstall suggestion on the presumption that the whole SQL
installation was on the disk to be renamed (binaries, data files, log
files, tempdb, the works). I agree that if the binaries are staying
where they are (eg. on C:\Program Files\...) the you can move DBs
without the need to uninstall/reinstall and if the system DBs (master,
msdb & model) don't need to move then the process is virtually
painless with a simple detach/attach process.</tt><br>
<div class="moz-signature">
<title></title>
<meta http-equiv="Content-Type" content="text/html; ">
<p><span lang="en-au"><font face="Tahoma" size="2">--<br>
</font> </span><b><span lang="en-au"><font face="Tahoma" size="2">mike
hodgson</font></span></b><span lang="en-au"> <font face="Tahoma"
size="2">|</font><i><font face="Tahoma"> </font><font face="Tahoma"
size="2"> database administrator</font></i><font face="Tahoma" size="2">
| mallesons</font><font face="Tahoma"> </font><font face="Tahoma"
size="2">stephen</font><font face="Tahoma"> </font><font face="Tahoma"
size="2"> jaques</font><font face="Tahoma"><br>
</font><b><font face="Tahoma" size="2">T</font></b><font face="Tahoma"
size="2"> +61 (2) 9296 3668 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2"> F</font></b><font face="Tahoma" size="2"> +61
(2) 9296 3885 |</font><b><font face="Tahoma"> </font><font
face="Tahoma" size="2">M</font></b><font face="Tahoma" size="2"> +61
(408) 675 907</font><br>
<b><font face="Tahoma" size="2">E</font></b><font face="Tahoma" size="2">
<a href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">
mailto:mike.hodgson@.mallesons.nospam.com</a> |</font><b><font
face="Tahoma"> </font><font face="Tahoma" size="2">W</font></b><font
face="Tahoma" size="2"> <a href="http://links.10026.com/?link=/">http://www.mallesons.com">
http://www.mallesons.com</a></font></span> </p>
</div>
<br>
<br>
rdjabarov wrote:
<blockquote cite="mid575074A1-CCF2-4720-B520-06EBD8D11D34@.microsoft.com"
type="cite">
<pre wrap="">Actually, this is not as dramati as Mike depicted, but backing up before
doing anything else is always a good idea. Check this article for details:
<a class="moz-txt-link-freetext" href="http://links.10026.com/?link=http://www.support.microsoft.com/kb/224071/EN-US/</a>">http://www.support.microsoft.com/kb/224071/EN-US/">http://www.support.microsoft.com/kb/224071/EN-US/</a>
"Mike Hodgson" wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Renaming drive letters is really ugly. If you just rename the drive
letter then SQL Server probably wont even start because it will be
looking for the master database primary data file on the wrong drive
letter (which will no longer exist). This can be changed in the
registry but there are a myriad of other problems you will encounter.
It may be best just to detach all you user DBs, uninstall SQL Server,
rename the drive letters, reinstall SQL Server and reattach your user
DBs again (now located on the renamed drive letter). If you'd already
done a fair bit of server config you may want to backup your master,
model & msdb (and potentially distribution DB if configured as a
distributor participating in SQL replication) databases before
uninstalling SQL Server and then restore them after reinstalling.
--
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* <a class="moz-txt-link-freetext" href="http://links.10026.com/?link=mailto:mike.hodgson@.mallesons.nospam.com">mailto:mike.hodgson@.mallesons.nospam.com</a> |* W* <a class="moz-txt-link-freetext" href="http://links.10026.com/?link=http://www.mallesons.com</a>">http://www.mallesons.com">http://www.mallesons.com</a>
Jason wrote:
</pre>
<blockquote type="cite">
<pre wrap="">With reference to my previous posting, it seems that there
may be some misunderstanding.
We have installed a SQL Server 2000 database on the J
drive. However, we would like to rename the J drive to E
drive (Asked by the Network Administrator).
We would like to know is it necessary for us to do
anything for the change of drive letter ? Is it necessary
for us to detach and attach the database when he changes
the drive name? OR Just change the file location of the
database from J to E in EM?
Thanks
</pre>
</blockquote>
</blockquote>
</blockquote>
</body>
</html>
--070302090901030006050107--

Change Drive Letter

With reference to my previous posting, it seems that there
may be some misunderstanding.
We have installed a SQL Server 2000 database on the J
drive. However, we would like to rename the J drive to E
drive (Asked by the Network Administrator).
We would like to know is it necessary for us to do
anything for the change of drive letter ? Is it necessary
for us to detach and attach the database when he changes
the drive name? OR Just change the file location of the
database from J to E in EM?
ThanksRenaming drive letters is really ugly. If you just rename the drive
letter then SQL Server probably wont even start because it will be
looking for the master database primary data file on the wrong drive
letter (which will no longer exist). This can be changed in the
registry but there are a myriad of other problems you will encounter.
It may be best just to detach all you user DBs, uninstall SQL Server,
rename the drive letters, reinstall SQL Server and reattach your user
DBs again (now located on the renamed drive letter). If you'd already
done a fair bit of server config you may want to backup your master,
model & msdb (and potentially distribution DB if configured as a
distributor participating in SQL replication) databases before
uninstalling SQL Server and then restore them after reinstalling.
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
Jason wrote:

>With reference to my previous posting, it seems that there
>may be some misunderstanding.
>We have installed a SQL Server 2000 database on the J
>drive. However, we would like to rename the J drive to E
>drive (Asked by the Network Administrator).
>We would like to know is it necessary for us to do
>anything for the change of drive letter ? Is it necessary
>for us to detach and attach the database when he changes
>the drive name? OR Just change the file location of the
>database from J to E in EM?
>Thanks
>
>|||Actually, this is not as dramati as Mike depicted, but backing up before
doing anything else is always a good idea. Check this article for details:
http://www.support.microsoft.com/kb/224071/EN-US/
"Mike Hodgson" wrote:

> Renaming drive letters is really ugly. If you just rename the drive
> letter then SQL Server probably wont even start because it will be
> looking for the master database primary data file on the wrong drive
> letter (which will no longer exist). This can be changed in the
> registry but there are a myriad of other problems you will encounter.
> It may be best just to detach all you user DBs, uninstall SQL Server,
> rename the drive letters, reinstall SQL Server and reattach your user
> DBs again (now located on the renamed drive letter). If you'd already
> done a fair bit of server config you may want to backup your master,
> model & msdb (and potentially distribution DB if configured as a
> distributor participating in SQL replication) databases before
> uninstalling SQL Server and then restore them after reinstalling.
> --
> *mike hodgson* |/ database administrator/ | mallesons stephen jaques
> *T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
> *E* mailto:mike.hodgson@.mallesons.nospam.com |* W* [url]http://www.mallesons.com[/url
]
>
> Jason wrote:
>
>|||That KB article is assuming the binaries directory is not moving too. I
may have misread/misunderstood the OP. I was basing the
uninstall/reinstall suggestion on the presumption that the whole SQL
installation was on the disk to be renamed (binaries, data files, log
files, tempdb, the works). I agree that if the binaries are staying
where they are (eg. on C:\Program Files\...) the you can move DBs
without the need to uninstall/reinstall and if the system DBs (master,
msdb & model) don't need to move then the process is virtually painless
with a simple detach/attach process.
*mike hodgson* |/ database administrator/ | mallesons stephen jaques
*T* +61 (2) 9296 3668 |* F* +61 (2) 9296 3885 |* M* +61 (408) 675 907
*E* mailto:mike.hodgson@.mallesons.nospam.com |* W* http://www.mallesons.com
rdjabarov wrote:
[vbcol=seagreen]
>Actually, this is not as dramati as Mike depicted, but backing up before
>doing anything else is always a good idea. Check this article for details:
>http://www.support.microsoft.com/kb/224071/EN-US/
>"Mike Hodgson" wrote:
>
>

Monday, March 19, 2012

Change Data Type

Hi,
I am not sure if I am posting to the correct group, but I am wondering if
there are any dangers in changing datatypes on a column.
More specifically, I want to change some varchars to nvarchars and texts to
ntexts. I already have the script written for the columns I need to change.
I have seen no issues in doing this on my test database, but I was wondering
if there are any inherent dangers in doing this.
Are there any articles that can be helpful for this subject?
Thank you,
Paul
Paul,
The issues with varchar and nvarchar are fairly straight-forward, however
ALTER TABLE cannot change texts and ntexts. I understand that you must drop
any indexes on a varchar that you are changing to nvarchar before doing the
alter. One of the other main restrictions is that the data must all fit
into the new target. The BOL explains most of this in the ALTER TABLE
topic.
You might also find the following article from SQL Server magazine helpful.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnsqlmag04/html/InsideALTERTABLE.asp
Russell Fields
"Paul" <paul@.gotheta.com> wrote in message
news:uJjE5d6MEHA.1340@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I am not sure if I am posting to the correct group, but I am wondering if
> there are any dangers in changing datatypes on a column.
> More specifically, I want to change some varchars to nvarchars and texts
to
> ntexts. I already have the script written for the columns I need to
change.
> I have seen no issues in doing this on my test database, but I was
wondering
> if there are any inherent dangers in doing this.
> Are there any articles that can be helpful for this subject?
> Thank you,
> Paul
>
|||With the varchar to nvarchar make sure you're aware of the storage requirements. If you have long string lengths you need to remember that nvarchar will double your storage:
e.g.
DECLARE @.string VARCHAR(10)
SELECT@.String = 'Hello'
SELECTDATALENGTH(@.String)
SELECTDATALENGTH(CAST(@.String AS NVARCHAR(10)))
Regards
Julie
http://www.sqlporn.co.uk :o)

Change Data Type

Hi,
I am not sure if I am posting to the correct group, but I am wondering if
there are any dangers in changing datatypes on a column.
More specifically, I want to change some varchars to nvarchars and texts to
ntexts. I already have the script written for the columns I need to change.
I have seen no issues in doing this on my test database, but I was wondering
if there are any inherent dangers in doing this.
Are there any articles that can be helpful for this subject?
Thank you,
PaulPaul,
The issues with varchar and nvarchar are fairly straight-forward, however
ALTER TABLE cannot change texts and ntexts. I understand that you must drop
any indexes on a varchar that you are changing to nvarchar before doing the
alter. One of the other main restrictions is that the data must all fit
into the new target. The BOL explains most of this in the ALTER TABLE
topic.
You might also find the following article from SQL Server magazine helpful.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnsqlmag04/html/InsideALTERTABLE.asp
Russell Fields
"Paul" <paul@.gotheta.com> wrote in message
news:uJjE5d6MEHA.1340@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I am not sure if I am posting to the correct group, but I am wondering if
> there are any dangers in changing datatypes on a column.
> More specifically, I want to change some varchars to nvarchars and texts
to
> ntexts. I already have the script written for the columns I need to
change.
> I have seen no issues in doing this on my test database, but I was
wondering
> if there are any inherent dangers in doing this.
> Are there any articles that can be helpful for this subject?
> Thank you,
> Paul
>|||With the varchar to nvarchar make sure you're aware of the storage requirements. If you have long string lengths you need to remember that nvarchar will double your storage
e.g
DECLARE @.string VARCHAR(10
SELECT @.String = 'Hello
SELECT DATALENGTH(@.String
SELECT DATALENGTH(CAST(@.String AS NVARCHAR(10))
Regard
Juli
http://www.sqlporn.co.uk :o)

Change Data Type

Hi,
I am not sure if I am posting to the correct group, but I am wondering if
there are any dangers in changing datatypes on a column.
More specifically, I want to change some varchars to nvarchars and texts to
ntexts. I already have the script written for the columns I need to change.
I have seen no issues in doing this on my test database, but I was wondering
if there are any inherent dangers in doing this.
Are there any articles that can be helpful for this subject?
Thank you,
PaulPaul,
The issues with varchar and nvarchar are fairly straight-forward, however
ALTER TABLE cannot change texts and ntexts. I understand that you must drop
any indexes on a varchar that you are changing to nvarchar before doing the
alter. One of the other main restrictions is that the data must all fit
into the new target. The BOL explains most of this in the ALTER TABLE
topic.
You might also find the following article from SQL Server magazine helpful.
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnsqlmag04/html/InsideALTERTABLE.asp
Russell Fields
"Paul" <paul@.gotheta.com> wrote in message
news:uJjE5d6MEHA.1340@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I am not sure if I am posting to the correct group, but I am wondering if
> there are any dangers in changing datatypes on a column.
> More specifically, I want to change some varchars to nvarchars and texts
to
> ntexts. I already have the script written for the columns I need to
change.
> I have seen no issues in doing this on my test database, but I was
wondering
> if there are any inherent dangers in doing this.
> Are there any articles that can be helpful for this subject?
> Thank you,
> Paul
>|||With the varchar to nvarchar make sure you're aware of the storage requireme
nts. If you have long string lengths you need to remember that nvarchar will
double your storage:
e.g.
DECLARE @.string VARCHAR(10)
SELECT @.String = 'Hello'
SELECT DATALENGTH(@.String)
SELECT DATALENGTH(CAST(@.String AS NVARCHAR(10)))
Regards
Julie
http://www.sqlporn.co.uk :o)