Change Collations In Many Tables Defined Using COLLATE

Jun 9, 2004

I have (inherited a) a db with lots of tables looking like the definition at the end of the message.

I need to change all these tables, so that all the textual fields follow the default DB collation.

Any help appreciated!
THANX...

CREATE TABLE [Club] (
[id] [int] NOT NULL ,
[name] [varchar] (100) COLLATE Greek_CI_AS NOT NULL ,
[address] [varchar] (255) COLLATE Greek_CI_AS NULL ,
[zoomAreaId] [int] NULL ,
[phone] [varchar] (255) COLLATE Greek_CI_AS NULL ,
[contact] [varchar] (50) COLLATE Greek_CI_AS NULL ,
[clubCategoryId] [int] NULL ,
[unused] [varchar] (2) COLLATE Greek_CI_AS NULL ,
[monday] [int] NULL ,
[tuesday] [int] NULL ,
[wednesday] [int] NULL ,
[thursday] [int] NULL ,
[friday] [int] NULL ,
[saturday] [int] NULL ,
[sunday] [int] NULL ,
[comments] [text] COLLATE Greek_CI_AS NULL ,
[URL] [varchar] (255) COLLATE Greek_CI_AS NULL ,
[image] [varchar] (50) COLLATE Greek_CI_AS NULL ,
[priceCategoryId] [int] NULL ,
[ratingId] [int] NULL ,
[entryDate] [datetime] NULL ,
[WAPText] [varchar] (255) COLLATE Greek_CI_AS NULL ,
[SMSText] [varchar] (160) COLLATE Greek_CI_AS NULL ,
[SMSAddress] [varchar] (50) COLLATE Greek_CI_AS NULL ,
[active] [bit] NOT NULL ,
[content_id] [bigint] NULL ,
[disp_as_propos] [bit] NULL ,
[date2disp] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

View 2 Replies


ADVERTISEMENT

Question About User Defined Data Type And 'COLLATE SQL_Latin1_General_CP1_CI_AS'

Apr 8, 2004

What is 'COLLATE SQL_Latin1_General_CP1_CI_AS'? I am new to
SQLServer, and couldn't find much information on the Web. Also,
I am trying to understand user defined data types. For example,

In the following example, what is '[Price_DT]' data type? and how would
it be referenced at the time of 'INSERT'.

CREATE TABLE [dbo].[Dist_Orders_Master_Index] (
[SubTotal] [Price_DT] NOT NULL ,
[Tax] [Price_DT] NOT NULL
) ON [PRIMARY]

View 1 Replies View Related

How To Change The Collate?

Mar 3, 2008



I have created SQL Compact .sdf file and i want to change the collate for it now to Arabic?

how can i do that?

View 1 Replies View Related

Can't Change The Currente Collate Of My Database

Nov 5, 2007

Hi, i'm having a problem with my database. When i created it i specifie the collate sql_latin1_general_cp1_ci_as but now that i'm working on my domain server, the server only acepts databases with the collate latin1_general_ci_as so i tried to change my current (on my localhost) collate but i'm always getting this error:


Msg 5030, Level 16, State 2, Line 2

The database could not be exclusively locked to perform the operation.

Msg 5072, Level 16, State 1, Line 2

ALTER DATABASE failed. The default collation of database 'databasexpto' cannot be set to Latin1_General_CI_AS.

How can i do it?

View 5 Replies View Related

Updating Systemtables Directly To Change Column-collations

Mar 3, 2005

Hi there.

Is there any way to update the system tables directly, to alter the collations of the columns in the user db's?

I've tried the script below:

UPDATE Syscolumns SET collation = 'SQL_Latin1_General_CP1_CS_AS' WHERE name = '<AddrCode>'
AND id = object_id('<Compliance>')

but, I get the following error message:

Server: Msg 271, Level 16, State 1, Line 1
Column 'collation' cannot be modified because it is a computed column.

Can you please help me! I need to do thousands of these, and most of them has constraints on, so my script I generated to do the ALTER TABLE.... ALTER COLUMN does not suffice.

Thanks.

View 2 Replies View Related

Change Owner User Defined Datatype

Jan 12, 2006

Hello, We had a developer that created some user defined data types. He is no longer with our company and we want to change owner of those user defined data types so we will be able to delete his UUID. Is their a way to change the owner of the user defined data types from his ID to dbo. I don't see a way to change them with sp_changeobjectowner



Thanks in advance
Jef Wain

View 3 Replies View Related

Change Owner Of User Defined Data Types?

Jan 11, 2006

Hello is there a way to change the owner of a user defined data type in sql2000? If so help is appreciated

View 1 Replies View Related

Change Ownership For User Defined Data Types

May 10, 2006

Hello,

Does anybody know an easy way to change User Defined Data Types ownership to “dbo”, without dropping dependent objects?

I know that there is a st. proc sp_changeobject owner, but it does not deal with this particular db objects. Is there a similar st.procedure or script that would do the same operation?

Thank you

View 2 Replies View Related

Transact SQL :: Change Structure Of User Defined Table Types

Nov 4, 2015

Change structure of a User Defined Table Types

      field
([idConteudo] [int]
NULL)      to     
 ([idConteudo] [BigInt]
NULL)

Or really should drop and create again?

CREATE TYPE [dbo].[tbProjeto] AS TABLE(
[dsConteudo] [varchar](64) NOT NULL,
[idConteudo] [int] NULL,
[dtConteudo] [datetime] NULL DEFAULT (getdate())
)
GO

View 4 Replies View Related

User-defined Function And Temporary Tables

Mar 10, 2006

Hiya,Is there really no way to use temporary tables from within a UDF? Ilike UDFs because I can use them like a table -- e.g., SELECT row1,row2 from MyFunc('abc')

View 1 Replies View Related

SQL 2012 :: Nested Tables And User Defined Data Types?

Jun 5, 2015

I have a requirement of creating nested tables in SQL server. how to create them. Just to give a background I am trying to move the RDBMS from oracle to SQL server.

Structure of tables is as follows. I have table 'Employees' with address as one of the column. I have one more table with columns Street, Town, Dist, State. When I query the table 'Employees' I should see the attribute name and values of all the columns in address table in address column.

Employees: with columns: ID, FirstName, LastName, dept, gender, dob, address

Address (Nested table): with columns : Street, Town, Dist, State

This was done in oracle using Nested tables and user defined data types. what is alternative for this in SQL server. How can I achive this requirement in SQL server.

View 2 Replies View Related

Do You Know Anything About Collations

Nov 5, 2003

I want to change the collation on a column to be case-sensitive without affecting anything else. What do I do?

View 1 Replies View Related

Collations

Jun 26, 2003

Can anyone point me to collation chart for Latin1_General and CP850?

I'm having conversion difficulties dealing with diacritics and want to look into the specifics.

Thanks,

Al

View 1 Replies View Related

Collations

Nov 2, 2007

Hi there. I'm trying to create a copy of a remote database for development purposes. I am useing MySQL, the remote database is in MSSQL. The create table commands contain a collation titled

quote:SQL_Latin1_General_CP1_CI_AS

which MySQL doesn't recognise. The three most similar collations I can find in MySQL are:
quote:
'latin1_general_ci',
'latin2_general_ci'
'latin7_general_ci'


Does anyone know the difference between these collations? And whether any of them is equivalent to the MSSQL code I have to implement?

thanks! Dave

View 3 Replies View Related

Need Help With Collations

Jul 20, 2005

I want to create a database where the table names / column names / SP namesare NOTcase sensitive but where the data in the tables is, so that I canbuild a unique index where 'test' and TEST' is accepted as different.I have tried Installing SQL with a Collation designator with the CaseSensitive option checked- this caused all sp names / column names / table names to be casesensitive - not what I want.I have also tried installing SQL and selecting a SQL Collation and pickingan option from the drop down list. - again this cause everything to be casesensitive - not desiredDo I have to install SQL with a non case sensitive collation, then set eachcolumn in the table to be case sensitive? What if any are the problems I amlikely to come across?ThanksSteve

View 2 Replies View Related

SQL2000 Collations

Feb 4, 2002

Hi,
I noticed that when I installed SQL2000,with "typical install",
the default, the following will be used:
SQL collation (dictionary order, case-insensitive, assent sensitive)
sp_helpsort will give
SQL_Latin1_General_CP1_CI_AI

Is there any difference if I choose the "custom install", then and choose
the windows locale which gives the result of sp_helpsort:
Latin1_General_CI_AI

SQL_Latin1_General_CP1_CI_AI is supposed for backward compatibilty, so are
they actually equivalent ??
Any impact or difference we have to be aware of ??
Anyone knows..Thx

View 1 Replies View Related

Changing Collations...

Mar 2, 2006

I have looked thru the forum but have a couple of questions:
1) data base was created with case insensitive collation
2) all the tables were then create (72 tables) and by default got the CI collation on all columns
3) lots of data was added 2GB
4) discovered mistake and altered the database to have case sensitive collation
5)..... how to change all the collations for all the columns without doing them all manually
can i backup the database and change some settings and restore it?
export all the data, drop and recreate tables and import data?
????

View 7 Replies View Related

Changing Collations

Dec 19, 2005

Hi,We have around 150 databases as case sensitive, and we are planning tochange it to case insensitive. Each database has around 180 tables, Ihave changed the collation on DB, but changing collation manually oneach column is a daunting process. Is there any script or tool whichcan assist in doing this.Appreciate your help.ThanksSAI

View 5 Replies View Related

Collations And Nvarchar

Aug 22, 2007

Should a programmer bother using nvarchar for a person's name (special chracters allowed) if I still use SQL_Latin1_General_CP1_CI_AS?

View 1 Replies View Related

English And German Collations

Apr 10, 2007

I have developed a tool to allow project developers to easily re-create the entire schema for our base product. The current issue involves setting the correct collation for the customers' region. Our brother company in Germany uses the same db creation tool and scripts, and we here in the US also have customers in South America. My ultimate question is "what subset of collation names would be necessary to provide the project developer?" I could query the database to get all the collation names, but I think it was around 1000 names. Can I query to get a smaller subset of the most relevant collation names?

Ed

View 3 Replies View Related

Collate

Jun 4, 2002

Can you use "COLLATE" (see below) on SQL Server 7? I get "incorrect syntax" error?


CREATE TABLE [dbo].[CellFormat] (
[Category] [nvarchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[BackColor] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FontColor] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[BackColorDesc] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[FontColorDesc] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

Thanks,

strat

View 1 Replies View Related

Collate In SQL 8.0

Jul 17, 2002

Have an old DB (6.5) Upgrade to (8.0). And when i make a script from the SQL.8 to the backup server i gett Collate Errors. So i wonder if there are someway to script the Table without the Collate´s or if i can make som settings on the Backup server so it will accept Collate in the script..

Best Regards Johan

View 2 Replies View Related

Changing Collations For Master Database.

May 3, 2004

Hi there


I am using SQL server 2000 and
I want to Change Server Collations from SQL_Latin1_General_CP850_BIN to
SQL_Latin1_General_CP1_CS_AS.

Can anybody help me in this regard.

Rgds

Wilson

View 5 Replies View Related

Collations And Simple Import From A Csv-file

Apr 23, 2007

Hello. Here a two different problems that occur one and a while when I try to import a textfile to SQL Server 2005.

I have a flat file connection to a csv-file that originally is a export from an AS4000 DB2 database
This csv-file is defined as a variable length file
Why do SSIS automatically interpret the length of each column as varchar(50)? It does not matter if a define the same file as a fixed lenght file. The problem is that I will get a warning that information in columns will be truncated. I would like to do a direct export to the SQL Server 2005 table with shorter varchar fields. I can solve this by using the task for transforming data types but this only works on the text fields. This task cannot transform a string to a decimal or an integer column in the SQL Server 2005 table. Is there no other way than having a staging table between the text file and the SSIS-data pipe?
I also get a lot of collation or code page errors even if we set the receiving columns to nvarchar and nchar. Is there any good article on this subject? Code page errors

Last question. Is there parameter support in the data reader source connection?



I appreciate all help.

Regards

Thomas Ivarsson

View 3 Replies View Related

COLLATE Problem

Feb 8, 2008

Hi!

I have an application that access an SQL Server database with collate Turkish_CI_AS.

The application work fine (I have special attention with the 'i'/'I' problem).

We sended our application to some partners, that have the collate of their server as Turkish_CI_AI.

One of the database are alread with this collate, and one is create during installation, with the Turkish_CI_AS collate.

And they get some wird problems, like the message "Item cannot be found in collection corresponding to the requested name or ordinal".

Can someone bring me some "light" please? :)
I'm using SQL Server 2000, some stored procedures and an Delphi 7.0 application.

Thanks in advance and sorry for be so newbe ;)!

View 6 Replies View Related

What's COLLATE Latin1_General_BIN?

Mar 6, 2008

I am new to Stored Procedure, so I want to find out what is COLLATE Latin1_General_BIN means?

For example:

Declare @Var_Tbl Table
(CUSTID INT NOT NULL,
FIRSTNAME VARCHAR(20) COLLATE Latin1_General_BIN NOT NULL,
CUSTOMER VARCHAR(9) COLLATE Latin1_General_BIN NOT NULL
)

Any helps would appreciated.

NLD

View 2 Replies View Related

Need Idea About COLLATE

Sep 12, 2007

I need help regarding what is a collate and where to use.If any examples with INNER JOIN it could be more helpful....

View 13 Replies View Related

Unable To Resolve Column Level Collations

May 14, 2008

Hi,


When I try to execute a package I get this following error. I have a bunch of similar packages which runs fine on the same source(sybase) and destination(sqlserver 2005), just different tables. Only few of them fails and all of them have the same error of "Unable to resolve column level collations. Bulk-copy cannot continue". I checked for the dtatatype and length between source and destination, both are same. The user have all the required rights on the objects in both source and destination.


Error at Data Flow Task For Test1 - test_tbl_job [OLE DB Destination [16]]: An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Unable to resolve column level collations. Bulk-copy cannot continue.".

Error at Data Flow Task For Test1 - test_tbl_job [OLE DB Destination [16]]: Failed to open a fastload rowset for "testdb..tbl2". Check that the object exists in the database.

On further trial and error I found that if I remove the fast load option, it works without glitch.

Its kind of wierd though....

Any body has faced this situation?

Thanks
Karunakaran

View 5 Replies View Related

Syntax Error Near 'COLLATE'

May 19, 2004

I am attempting an import of an SQL DB from a local MSDE SQL Server to an SQLServer 2000. I used the Web Data Administrator to create an export file, and then I wanted to perform an import to the actual server. I get the error "Syntax error near 'COLLATE'". I don't know much about syntax when it comes to this. Here is a snippet from there. I am new to this, so I hope someone out there can help me out.
CREATE DATABASE [NewDB] ON (NAME = N'NewDB', FILENAME = N'CORRECTFILEPATH' , SIZE = 3, FILEGROWTH = 10%) LOG ON (NAME = N'NewDB_log', FILENAME = N'CORRECTFILEPATH' , SIZE = 1, FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
All the "N" don't look like they belong, but they have been added throughout the entire SQL document.

View 9 Replies View Related

Stored Procedure And A DB With Collate That Is CI...

Oct 12, 2006

i have a sp that when i add to a CS database it doesnt give me an error but when i add to a CI database it errors out.
what can i do to it to make it not error on the CI situtation?

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


-- Accounts Payable
ALTER PROCEDURE [dbo].[isp_ap_calc_apt_totals]
@p_comp char(2),
@p_vend char(6),
@p_asofdate char(8)
as

if (@p_asofdate <= '00000000')
begin
set @p_asofdate = '99999999'
end

delete from XAPAPTTOT
where xapt_comp = @p_comp and xapt_vend = @p_vend and xapt_asof_date = @p_asofdate

insert into XAPAPTTOT
select apph_comp, apph_vend, apph_type, apph_id, @p_asofdate,
sum(apph_paymnts),
sum(apph_discts),
sum(apph_adjts),
count(apph_paymnts),
sum(apph_paymnts)+ sum(apph_discts) + sum(apph_adjts) +
(select apt_gross from APTRANF
where apt_comp = @p_comp and apt_vend = @p_vend
and apt_type = apph_type and apt_id = apph_id),
0,
max(str(yy,4) + replace(str(mm,2),' ','0') + replace(str(dd,2),' ','0'))
from APPHISTF
where apph_comp = @p_comp and apph_vend = @p_vend
and str(yy,4) + replace(str(mm,2),' ','0') + replace(str(dd,2),' ','0') <= @p_asofdate
group by apph_comp, apph_vend, apph_type, apph_id

update XAPAPTTOT
set xapt_last_payck =
(select max(apph_payck) from APPHISTF
where apph_comp = xapt_comp and apph_vend = xapt_vend and apph_type = xapt_type
and apph_id = xapt_id
and str(yy,4) + replace(str(mm,2),' ','0') + replace(str(dd,2),' ','0') = xapt_last_paydt )
where xapt_comp = @p_comp and xapt_vend = @p_vend and xapt_asof_date = @p_asofdate

View 3 Replies View Related

Collate SQL_Latin1_General_CP850_BIN To SQL_Latin1_General_CP1_CI_AS

Jul 23, 2005

Hi, I have a SQL Server for a SAP database with the collationSQL_Latin1_General_CP850_BIN. When I connect to that server (or, inthis example, to another server with the SQL_Latin1_General_CP850_BINcollation) and execute a select, the accents seem weird:select t.TEXTfrom [GC-SAP02].P01.p01.AGR_TEXTS twhere t.MANDT = '300'and t.SPRAS = 'E'and t.AGR_NAME = 'ZCD_GEST_DEUDA_PATENTE_SD'TEXT-----------------------------------Gesti¾n de deudas patentes en SD UP(1 row(s) affected)But if I connect to a "normal" SQL Server with aSQL_Latin1_General_CP1_CI_AS collation, and execute the same selectthru a linked server:TEXT-----------------------------------Gestión de deudas patentes en SD UP(1 row(s) affected)I need to perform the select connected to theSQL_Latin1_General_CP850_BIN and get the results as I were connected tothe SQL_Latin1_General_CP1_CI_AS server. I tried with cast and collate,but I can't get it to work:select t.TEXT collate SQL_Latin1_General_CP1_CI_ASfrom [GC-SAP02].P01.p01.AGR_TEXTS twhere t.MANDT = '300'and t.SPRAS = 'E'and t.AGR_NAME = 'ZCD_GEST_DEUDA_PATENTE_SD'Any ideas??? Thanks in advance for your help !!!Manuel Daponte

View 1 Replies View Related

Why Do Some System Views Have Columns With Different Collations Then The Default Collation?

Oct 8, 2007

I'm recreating many of my DBA scripts that no longer work in 2005 due to the rework of system tables. It's a risk I lived with knowing that someday the system tables would change. I'm now encountering collation problems, which I do not understand. I know how to fix the problem, but I don't know why the collation issues exist in the first place.


Run the following command.


Select * From sys.all_objects a JOIN master..spt_values b on a.type = b.type

You will receive the following error.


Msg 468, Level 16, State 9, Line 1

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS_KS_WS" in the equal to operation.


Now run sp_help 'sys.all_objects' and look at the collation defintion for columns "type" and "type_desc". In my environment they have a collation of Latin1_General_CI_AS_KS_WS. This is different then the overall default collation of SQL_Latin1_General_CP1_CI_AS, thus causing the error.


My question is why did Microsoft need to make this collation different for these columns?


Any ideas?


Thanks, Dave

View 3 Replies View Related

Creating A Table In SQL Server With Fields From Other Tables And Some Fields User Defined

Feb 20, 2008

How can I create a Table whose one field will be 'tableid INT IDENTITY(1,1)' and other fields will be the fields from the table "ashu".
can this be possible in SQL Server without explicitly writing the"ashu" table's fields name.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved