varchar

Is it possible to globally configure all char/varchar/text columns in a mysql database to use utf8?

I have a database that I had imported and accidentally created some tables as using latin1 by default. I've altered the tables and the database, but the columns are still latin1. I don't really have any reason to use latin1, so is there any way to just change all columns to use utf8? This is a development database, so it doesn't neces...

Convert varchar colum to smalldatetime

I have a table with 800+ records. In this table I have a column named 'Data' of varchar (10) datatype which contains dates in 'dd.MM.yyyy' format.I want to convert it to smalldatetime. I've tried converting it using Enterprise Management Studio Express, but I receive this error: 'The conversion of char data type to smalldatetime data t...

SQL Server 2005 Index rebuild when increasing the size of a varchar field

I have a 12 varchar(50) fields in a table of about 90 million rows that I need to increase to varchar(100) in length. Each of these fields has an index (with only the one field as a member). If I increase the length of the varchar fields, will the indexes either need to be rebuilt (or would be rebuilt automatically), or would the stati...

Is there a legitimate reason for using so many varchar fields? (MS SQL DB)

I'm working on data migration from an old IBM Universe-based system to a new enterprise-level data-information management system, and learning about database design in the process. I took a look at the back-end database structure of the new system (it's a MS SQL DB, with about 100 tables), and find some things pretty odd. But I don't k...

How can I make SQL Server return FALSE for comparing varchars with and without trailing spaces?

If I deliberately store trailing spaces in a VARCHAR column, how can I force SQL Server to see the data as mismatch? SELECT 'foo' WHERE 'bar' = 'bar ' I have tried: SELECT 'foo' WHERE LEN('bar') = LEN('bar ') One method I've seen floated is to append a specific character to the end of every string then strip it back out for m...

Conversion failed when converting the varchar value to int

I'm getting an error with what should be a simple query to insert data. I've done searching, but for the life of me, I cant figure out whats happening. Here's my SQL: IF OBJECT_ID('settings') IS NOT NULL DROP TABLE [settings] CREATE TABLE [settings] ( [id] [bigint] IDENTITY(1,1) NOT NULL PRIMARY KEY, [tenant_id] [bigint] NOT ...

SQL Server 2000 varchar(8000) truncate to 256?!!

Hi All, I have SQL Server 2000 and I have a stored procedure that has @output as varchar(8000) and I have a loop that keeps concatenate the result into @output and at the end I made select @output My problem is the output length is truncated to the first 256 characters only!!! Other characters (output) is missing. I tried to use TEXT ...