Hello,
In SQL 2008 I am moving some data from one field to another. My source column is varchar(20) and my destination column is varchar(6).
Before copying the data I wanted to find any instances where the data is longer than 6 characters by running:
I had about 300 rows show up where mycolumn is empty. I included len(mycolumn) into my select statement and found that all of these entries are 15 characters long.
I want to convert these to NULL values and have tried:
But they each return 0 results. I have also tried copying the results from the grid results in query analyzer, but no luck.
Is there a way I can find out what is actually in this field so I can run updates against it? Also to find other possible instances in the table.
Thanks!
In SQL 2008 I am moving some data from one field to another. My source column is varchar(20) and my destination column is varchar(6).
Before copying the data I wanted to find any instances where the data is longer than 6 characters by running:
Code:
select * from Mytable1
where len(mycolumn) > 6
I had about 300 rows show up where mycolumn is empty. I included len(mycolumn) into my select statement and found that all of these entries are 15 characters long.
I want to convert these to NULL values and have tried:
Code:
update MyTable1
set mycolumn = NULL
where mycolumn = ''
update MyTable1
set mycolumn = NULL
where mycolumn = ' '
--15 spaces
But they each return 0 results. I have also tried copying the results from the grid results in query analyzer, but no luck.
Is there a way I can find out what is actually in this field so I can run updates against it? Also to find other possible instances in the table.
Thanks!