Alter Database/collate Error

Dec 6, 2007

We're upgrading to SQL Server 2005, and we've restored databases from SQL Server 2000 to the development server (SQL Server 2005). Part of what we need to do is alter the database collation to SQL_Latin1_General_CP1_CI_AS; our SQL Server 2000 server is case-sensitive.

My initial attempts to alter the database;

alter database RGDWDEV collate SQL_Latin1_General_CP1_CI_AS

failed because of the presence of computed columns and user functions. So, I wrote scripts to save the definitions of the computed columns and functions, and wrote scripts to drop them. Now that they are gone, I expected to be able to successfully execute the above 'alter database' statement, but I am now getting this error;

Msg 1505, Level 16, State 1, Line 1
CREATE UNIQUE INDEX terminated because a duplicate key was found for object name 'sys.sysschobjs' and index name 'nc1'. The duplicate key value is (0, 1, DISB_ADJ).
Msg 5072, Level 16, State 1, Line 1
ALTER DATABASE failed. The default collation of database 'RGDWDEV' cannot be set to SQL_Latin1_General_CP1_CI_AS.

I do not know how to fix this.

Can anyone help me?

thank you, beth

View 9 Replies


ADVERTISEMENT

Alter Database Model COLLATE SQL_Latin1_General_CP1_CI_AS

Jun 8, 2005

Hi folks,

I do not have a backup of the model database and have had to rebuild SQL Server 2000 once already. All my databases except model and tempdb have the collation SQL_Latin1_General_CP1_CI_AS those two have Latin1_General_CI_AS.

During SQL rebuild I've restored over master and msdb and they work fine. Only came across problem with stored procedure and I'm lost as to how to alter model without a backup of it.

Any easy way to change model collation?
The command listed in subject fails as it is a system table.

Is it as simple as going into single user mode and trying that command again?

Help please this is day 3 of my little nightmare.

View 3 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

Parsing Error In ALTER DATABASE

Apr 20, 2007

Hi.



I'm very new to DB stuff. I've created a SQL Server CE database and I'm trying to implement a query notification using a SqlDependency object, as per the instructions at:

http://www.codeproject.com/cs/database/chatter.asp



I've connected to my DB using SQL Server Management Studio Express, and I'm getting the following error when trying to execute an ALTER DATABASE command:



I have no clue what I could be doing wrong. Is this operation supported using CE? Is there really something wrong with my syntax?



Major Error 0x80040E14, Minor Error 25501

> alter database GESim.Diagnostics set ENABLE_BROKER

There was an error parsing the query. [ Token line number = 1,Token line offset = 7,Token in error = database ]



Help appreciated...



Just Mike

View 3 Replies View Related

COLLATE Error In DTS File Import

Mar 19, 2001

I am getting an error inserting a simple text file into a SQL2000 database table.
The text file is one column, comma delimited, and the DTS package to insert it into a table fails citing an error executing a 'COLLATE' statement.
Thanks for the help!

View 1 Replies View Related

What Is The Query To Kown The Collate Of The Database ?

Sep 14, 2006

What is the SQL query or stored procedure to kown the collate of the database ?
Thanks

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

Alter Table Syntax Error - Anyone Sees The Error?

Nov 24, 2004

Hello,

the following alter table statement:

ALTER TABLE [dbo].[CalCalendar]
ALTER COLUMN [OID] uniqueidentifier NOT NULL PRIMARY KEY NONCLUSTERED

is answered with:

Server: Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'PRIMARY'.

which I consider to be interesting. Anyone has an idea why? I checked documentation but I do not see an error.

Note that:

ALTER TABLE [dbo].[CalCalendar]
ALTER COLUMN [OID] uniqueidentifier NOT NULL

DOES get executed, and

ALTER TABLE [dbo].[CalCalendar]
ALTER COLUMN [OID] uniqueidentifier NOT NULL PRIMARY KEY

produces the same error.

Now, in my understanding this has nothing to do with an index may already exist etc. - the eror indicates a SYNTAX error, before any checking. Makes no sense to me, though, reading the documentation.

So - anyone an idea?

View 4 Replies View Related

Granting Permission To A Database User To Alter Database Role

Sep 5, 2006

I want a database user to be able to alter login, database user and database role from my application. so, i assigned that user to sccurityadmin server role, db_accessadmin and db_securityadmin database roles....By now, the user can add or remove login and database user. However, the user cannot add or remove any database role membership. What am I missing here?? What should I do so that the user can create, and alter database roles in the database??

View 1 Replies View Related

SQL Security :: ALTER DATABASE Failed Because A Lock Could Not Be Placed On Database

Jul 20, 2015

I have a script that automates some db drop/restore operations and bringing the database to single user mode is part of it: ALTER DATABASE ... SET SINGLE_USER WITH ROLLBACK IMMEDIATE...I want this to executes under a login, that has restricted privileges, so I've created a login and granted it a dbcreator role + ALTER ANY DATABASE privileges.

Problem: When I run the script against a database with an active/sleeping connection:It fails when using the restricted login: "Msg 5061...ALTER DATA BASE failed because a lock could not be placed on database ..."It completes successfully when using a sysadmin login According to stackoverflow.com the solution is to kill the active/sleeping connections to the database, before ALTER-ing it, which works fine, but the question is....

Questions: Why the "ALTER DATABASE..." statement works under the sysadmin login, but not under a dbcreator one?Does this mean the sysadmin login kills the connections to the target database in the background?Is it possible to grant additional privileges to the restricted login, so the "ALTER DATABASE..." statement won't need preventive killing of the connections?

View 5 Replies View Related

Database Mirroring Hangs On ALTER DATABASE SET PARTNER

Jun 26, 2005

Hi,

View 6 Replies View Related

Create Database And Alter Database In One SQL Script

Aug 25, 2000

I am using SQL 6.5. Can I create a database and Alter the same
database in one SQL Script?
Thanks in advance.

View 1 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

Alter Table Error

Aug 28, 2007

Hello,

I have written the query below to add a field to my sport
table called 'list', but am getting the error outlined below.
What have I done wrong?

$query = "ALTER TABLE sport ADD COLUMN list TEXT(3)";
$result = odbc_exec($iConnect, $query) or die('Select failed!');


Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'COLUMN'., SQL state 37000 in SQLExecDirect in E:inetpubscriptsathleteaa_sports_table.php on line 57
Select failed!

View 1 Replies View Related

Alter Table Alter Column In MSACCESS. How Can I Do It For A Decimal Field?

Jul 23, 2005

Hi people,I?m trying to alter a integer field to a decimal(12,4) field in MSACCESS 2K.Example:table : item_nota_fiscal_forn_setor_publicofield : qtd_mercadoria integer NOT NULLALTER TABLE item_nota_fiscal_forn_setor_publicoALTER COLUMN qtd_mercadoria decimal(12,4) NOT NULLBut, It doesn't work. A sintax error rises.I need to change that field in a Visual Basic aplication, dinamically.How can I do it? How can I create a decimal(12,4) field via script in MSACCESS?Thanks,Euler Almeida--Message posted via http://www.sqlmonster.com

View 1 Replies View Related

Alter Database

Jan 23, 2001

I am trying to move one of my database log to different location but I am geeting an error when I try to do this.

I am moving Registration DB log file from 'c:mssql7
egistrstion_log.ldf'
to 'e:sql
egistration_log.ldf'

Here the syntax I am using to do this:

alter database registration modify file (name='registration_log',filename= 'e:sql
egistration_log.ldf')

But I get the following error:
Server: Msg 5037, Level 16, State 1, Line 2
MODIFY FILE failed. Do not specify physical name.


Thank You,
John

View 1 Replies View Related

Alter Database

Jul 31, 2006

Hi all this is my first of most likely many posts.
I am writting a stored proc that will be used on many diffrent named databases and i am setting the database name with a variable. I would like to use this variable in the following situation any clues on this would be greatly appreciated.

DECLARE @DBName varchar(50)
SET @DBName='Database'
alter database @DBName set recovery full

regards
Phil

View 4 Replies View Related

ALTER DATABASE

Apr 25, 2008



Hey,

I am trying to give a user permission to change the name of a database.

They are a member of the server role 'secuirtyadmin'
They are a member of the database role 'db_owner'
They have been granted ALTER permission on the database.

But every time I try and run the command

ALTER DATABASE <dbname> MODIFY NAME = <newdbname>

I get an error saying the database doesn't exist or you don't have permissions.

What am I missing?

View 7 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

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

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

Syntax Error ALTER TABLE

Jul 25, 2006

HiHaving a problem with a ms sql 2000 server. The script below wascreated i SQL manager 2005 lite and gives a syntax error near '('ALTER TABLE [dbo].[Community_ActivityLog]ADD CONSTRAINT [PK_Community_Errors]PRIMARY KEY CLUSTERED ([activity_ID])WITH (PAD_INDEX = OFF,IGNORE_DUP_KEY = OFF,STATISTICS_NORECOMPUTE = OFF,ALLOW_ROW_LOCKS = ON,ALLOW_PAGE_LOCKS = ON)ON [PRIMARY]GOAny ideas of what might be wrong?/Michael

View 1 Replies View Related

Alter Database Failed

Mar 13, 2003

Hello,

I have Test database with Log file property Automatically grow the file, option Unrestricted file growth, I wanted to alter it with Restrict file growth upto 200 MB. I'm getting an error that you cannot modify as file doesnot exist
But the file does exist. I cannot figure out what is giving the problem.
below is the sql statements
select name from sysfiles
go

Test_Data
Test_Log

USE master
go
ALTER DATABASE Test MODIFY FILE
( NAME='Test_Log',
MAXSIZE=200MB )
go

ERROR
Server: Msg 5041, Level 16, State 1, Line 1
MODIFY FILE failed. File 'Test_Log' does not exist.

Any help is appreciated.

Thanks
Sejal

View 3 Replies View Related

Alter Database While Suspect

Jan 22, 2004

Hi

I got the following error
Error: 823, Severity: 24, State: 4
I/O error 33(The process cannot access the file because another process has locked a portion of the file.) detected during write at offset
0x0000000a796000 in file xxxxxxxxx.ndf'.

and the respective database could not be brought online - this was just due to a problem with a .ndf file containing only indexes...is there any way to connect to/alter a database while it is in this transitional state? (it would be no loss if i could just remove the file & its filegroup)

(i tried starting with -f -c, but no go)

thanks in advance
des

View 3 Replies View Related

Can Alter (current) Database?

Apr 7, 2006

I have a *.sql script that creates database tables, and I need to modify the database to enable the service broker. In addition, the actual name of the database is not known in advance - it is set per instance of the application.

I know I need to do:

ALTER DATABASE dbname SET ENABLE_BROKER

But I must avoid including the name of the database in the script. I did wonder if this would work:

DECLARE @DB varchar(50)

SELECT @DB = DB_NAME()

ALTER DATABASE @DB SET ENABLE_BROKER

But I just get a syntax error. Presumably this also rules out setting the database name as a parameter to the script (SqlParameter stuff)

The only option I can think of is dynamically creating the statement, either in T-SQL or in the calling .NET environment.

Any thoughts?

Ruth

View 6 Replies View Related

ALTER DATABASE SET PARTNER OFF

Oct 25, 2006

I've read that when this run's, it removes all db mirroring information on that db. What exactly does it remove?

Here's my senario:

We are using SQL 2005€™s db mirroring process. We are using the certificate method of authentication between the principle and the mirror db€™s.

My question is that when the ALTER DATABASE dbname SET PARTNER OFF is run, does it remove these certificate settings as well? In other words when I want to enable the db mirroring, will I need to recreate these certificates or just recreate the endpoints to use these certificates?

View 5 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

Syntax Error With &#34;alter Table&#34; Statement

Mar 27, 2001

Folks!

What is wrong with my syntax with the following command?:

alter table EmployeeInfo alter column OriginDate smalldatetime not null default getdate()

I'm getting:

Incorrect syntax near the keyword 'default'

Currently, in my table OriginDate is nullable with no default.
Thanks in advance for your help!

APF

View 2 Replies View Related

Alter Table Drop Column Error

Apr 11, 2001

1. We have user defined type (Sql type = bit ) with rule setting it to 0
2. New column(isVIP) was created using this user defined type
3. sp_unbindrule was used to unbind rule from new column (isVIP)
4. Alter table Client drop Column isVIP !!!! (invalid syntax )

Any ideas ?
Thanks

View 4 Replies View Related

[help] ALTER TABLE: Error Message 4929

Oct 2, 2006

Hi,I’ve the following error message:---------------ALTER TABLE [dbo].[AnagraficoAutomezzi]ALTER COLUMN [CodiceXTrascodifica] varchar(10)GoServer: messaggio 4929, livello 16, stato 1, riga 1Cannot alter table ‘AnagraficoAutomezzi’ because it is being published forreplication.---------------This is only part of a script with much more alter table…How can I lunch the script without this problem?Thanks for your help!Giacomo--Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

View 5 Replies View Related







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