Data Transfer From Collation CI Database To A CS Database
Jul 20, 2005
I have a client who was installed improperly on a Case Insensitive
Collation SQL system and have been working with this system for over a
year. For them to move forward in application software versions, they
will need to be reinstalled on a Case Sensitive SQL system. I was
wondering if anyone has tried this and was willing to provide
information that may be of assistance? I have tried various some
options within DTS but without success.
i have a old database in foxpro and it has to be converted to sql server 6.5 database . the table in the foxpro has been broken into more than 1 tables in the sql server . so how can i transfer the data from 1 foxpro table to different tables in sql server 6.5. vineet
Hi, I want to transfer some tables and their data from a database to another database so what is the best way of doing.. In the source Database i right click on that table and then gave Script table and then selected Create To and then copied that create table query and pasted it in the destination table..
So is there is way i can get the rows from all of that table.. There are around... 1000 rows or something like that and that database consits of 5 - 6 tables. any help will be appreciated.. Regards, Karen
Ok, so thank you first off to Arnie for helping with my auto-increment problem. I'm not in the office now, but I can't wait to try out what he showed me to get this thing running.
My bigger problem that I'm hoping you guys can help me with though is this:
I have two servers, and two databases, lets call them dev, and staging. These are exactly the same, except in different physical locations, and changes are made on dev, and then the info is updated to staging. I am writing a C# script to automate the process of updating the information from the dev database on the dev server, to staging. I am profficient with C#, but this is the first time i've ever touched SQL.
So by using the INSERT and SELECT method, I can get the info over properly, I am assuming (as I said I haven't been in the office to try it out yet) but for each table on the database there are different sets of column names, so I can't do a simple
Loop{
SqlCommand del = new SqlCommand("Truncate table " +MyTable", connectionstring)
del.ExecuteNonQuery();
SqlCommand com = new SqlCommand("INSERT INTO MyTable (MyColumn)
SELECT MyOtherColumn FROM MyOtherTable", connectionstring);
com.ExecuteNonQuery();
}While(...) and change the MyTable/MyOtherTable values for each loop.
Is there a quick and easy way of calling a list of columns for each table, so that I can change the table value, get the list of columns, and assign those as a variable? That way it can run through every table on the database, and no matter what the number or names of the columns in each table, it will grab all the necessary data and pass it over.
What is the best approach when transferring all database objects & data from a SQL Server 6.5 database to SQL Server 7.0 database running on different servers.
I 'am working with SQL Server7.0, and I need to transfer bulk of data(in millions) from aremote database in Rdb to SQL Server. What is the best approach other than using a comma delimited flat file? Is there a way to create a database link and then use a copy script in SQL to copy the data directly? I would appreciate any help. Thank You.
i have two database on my sql server,, and i m trying to create a report in whch both database need to share their data.. @ the moment what i did, i simply create a view on one database to access the table of other database.. but is anyone has a better idea how can i transfer data from one database to another database... i think if i do with creating temp table that might resolve this problem.. but when it comes on another server of another database , how can i will do this ... please give me any idea if u got my point .
I'm new to SQL server, and I would like to achieve below tasks. Kindly provide brief guildline on how to achieve these:
1.) I have managed to schedule job in SQL server to download the access database from remote server. 2.) Second, I would like to transfer all the data from my acccess database to my SQL tables.
May I know how do I achieve my task no 2???? I believe I need to write some script (procedure) in order to achieve this.
I have question regarding SQL Transactional Replication methodology
1. Let's say successfully created SQL Transactional Replication and running / transferring data from publisher to subscriber
2. Now one day the source production / publisher SQL Server is down and the remaining DR SQL Server is up (subscriber)
3. Next day, we fixed and bring up the production / publisher SQL Transactional Replication server, then how can we sync back all existing data records from subscriber into publisher side ?
Is there a way to transfer data from a SqlServer db to a SqlServer Express db. I tried to use the backup file of SqlServer, but this file is not valid for SqlServer Express. Or there any alternatives?
Hi All, i have mutiple text file. let us say,a1.txtb1.txtc1.txt i have to port this text file data into the table (SqlServer Database) which have the same file structure.(i.e)x1 (SqlServer table)y2 (SqlServer table)z3 (SqlServer table) now i have to transfer a1.txt file data ----to--- x1b1.txt file data ----to--- y2c1.txt file data ----to--- z3 using SSIS. like that, i have to transfer more than 250 files at a time.manually binding 250 files into the package is very cumbersome and time consuming process. so, can any one give ur valuable sugession to solve this issue.
I have several access database files. Now, we have new backoffice server with SQL6.5. How do I transfer the existing access database files to the new SQL server.
Thanks ps: please provide with details or direct me to any links (I am new to SQL server)
We currently install some of client's databases on SQL Server 2000 with the collation set to Latin1_General_BIN but we have one client that was installed and now running on SQL_Latin1_General_CP1_CI_AS and I was wondering if we can change the collation on the database to Latin1_General_BIN?
Would this have any adverse affects on the DB or the data within it? Our strings are nvarchar.
Is there a way (besides "ALTER DATABASE COLLATE ...") to change collation name for the whole database? I tried to use the "ALTER DATABASE" command, but it didn't work. And I wouldn't like to run "ALTER COLUMN" commands for over 100 tables.
I have to create a database (SQL2005) for multinational usage (Western, Eastern and asian langages included).
This database will be used by an international application.
Here are my questions :
* All the "wording" of the application will come from NVARCHAR database fields. However, for database fields which will not store any possibilities of special characters (and will not be shown on the application), should I also use NVARCHAR fields ?
(Then, the database will mix unicode and non unicode strings)
* The database must be replicated (transactional or Merge) with an "old" non international database on SQL 2000. Schemas are near the same, only datatype are different (varchar --> nvarchar). Then, should I use a SQL collation instead of Windows Collation as advised on MSDN ? http://msdn2.microsoft.com/en-us/library/ms175194.aspx
(MS tells to use Windows collation if the database has unicode and and non-unicode strings, but It also tells to use SQL collation to maintain compatibility with earlier versions of SQL)
I currently have a server with the collation set to SQL_Latin1_General_CP1_CI_AS.
However, some of the databases within the server are set to Latin1_General_BIN, probably because they were restored from another server some time ago. Also, even within the databases that have Latin1_General_BIN, some of the columns are set to SQL_Latin1_General_CP1_CI_AS, very confusing to say the least.
What i would like to do is change the database collation settings for these databases to match the server setting. I would also like to change all of the tables within these databases to have the columns also set to the server collation settings.
I'm looking for the steps that i would need to take to make sure i don't mess anything up as these databases have there own sets of views and sp's that run each day.
There have been several threads about changing a database's collation but none have come up with an easy answer before. The suggestion before was to create an empty database with the correct collation and then copy the data across. However this is hard work as you have to populate tables in a specific order in order not to violate foreign keys etc. You can't just dts the whole data.
There follows scripts we have written to do the job. If people use them, please could you add to this thread whether they worked successfully or not.
Firstly we change the default collation, then change all the types in the database to match the new collation.
=================== --script to change database collation - James Agnini -- --Replace <DATABASE> with the database name --Replace <COLLATION> with the collation, eg SQL_Latin1_General_CP1_CI_AS -- --After running this script, run the script to rebuild all indexes
ALTER DATABASE <DATABASE> COLLATE <COLLATION>
exec sp_configure 'allow updates',1 go reconfigure with override go update syscolumns set collationid = (select top 1 collationid from systypes where systypes.xtype=syscolumns.xtype) where collationid <> (select top 1 collationid from systypes where systypes.xtype=syscolumns.xtype) go exec sp_configure 'allow updates',0 go reconfigure with override go ===================
As we have directly edited system tables, we need to run a script to rebuild all the indexes. Otherwise you will get strange results like comparing strings in different table not working. The indexes have to actually be dropped and recreated in separate statements. You can't use DBCC DBREINDEX or create index with the DROP_EXISTING option as they won't do anything(thanks to SQL Server "optimization"). This script loops through the tables and then loops through the indexes and unique constraints in separate sections. It gets the index information and drops and re-creates it. (The script could probably be tidied up with the duplicate code put into a stored procedure).
==================== --Script to rebuild all table indexes, Version 0.1, May 2004 - James Agnini -- --Database backups should be made before running any set of scripts that update databases. --All users should be out of the database before running this script
print 'Rebuilding indexes for all tables:' go
DECLARE @Table_Name varchar(128) declare @Index_Name varchar(128) declare @IndexId int declare @IndexKey int
DECLARE Table_Cursor CURSOR FOR select TABLE_NAME from INFORMATION_SCHEMA.tables where table_type != 'VIEW'
OPEN Table_Cursor FETCH NEXT FROM Table_Cursor INTO @Table_Name
--loop through tables WHILE @@FETCH_STATUS = 0
BEGIN print '' print @Table_Name
DECLARE Index_Cursor CURSOR FOR select indid, name from sysindexes where id = OBJECT_ID(@Table_Name) and indid > 0 and indid < 255 and (status & 64)=0 and not exists(Select top 1 NULL from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = @Table_Name AND (CONSTRAINT_TYPE = 'PRIMARY KEY' or CONSTRAINT_TYPE = 'UNIQUE') and CONSTRAINT_NAME = name) order by indid
OPEN Index_Cursor FETCH NEXT FROM Index_Cursor INTO @IndexId, @Index_Name
--loop through indexes WHILE @@FETCH_STATUS = 0 begin
declare @SQL_String varchar(256) set @SQL_String = 'drop index ' set @SQL_String = @SQL_String + @Table_Name + '.' + @Index_Name
set @SQL_String = @SQL_String + 'index ' set @SQL_String = @SQL_String + @Index_Name set @SQL_String = @SQL_String + ' on ' set @SQL_String = @SQL_String + @Table_Name
set @SQL_String = @SQL_String + '('
--form column list SET @IndexKey = 1
-- Loop through index columns, INDEX_COL can be from 1 to 16. WHILE @IndexKey <= 16 and INDEX_COL(@Table_Name, @IndexId, @IndexKey) IS NOT NULL BEGIN
IF @IndexKey != 1 set @SQL_String = @SQL_String + ','
set @SQL_String = @SQL_String + index_col(@Table_Name, @IndexId, @IndexKey)
SET @IndexKey = @IndexKey + 1 END
set @SQL_String = @SQL_String + ')'
print @SQL_String EXEC (@SQL_String)
FETCH NEXT FROM Index_Cursor INTO @IndexId, @Index_Name end
CLOSE Index_Cursor DEALLOCATE Index_Cursor
--loop through unique constraints DECLARE Contraint_Cursor CURSOR FOR select indid, name from sysindexes where id = OBJECT_ID(@Table_Name) and indid > 0 and indid < 255 and (status & 64)=0 and exists(Select top 1 NULL from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = @Table_Name AND CONSTRAINT_TYPE = 'UNIQUE' and CONSTRAINT_NAME = name) order by indid
OPEN Contraint_Cursor FETCH NEXT FROM Contraint_Cursor INTO @IndexId, @Index_Name
--loop through indexes WHILE @@FETCH_STATUS = 0 begin
set @SQL_String = 'alter table ' set @SQL_String = @SQL_String + @Table_Name set @SQL_String = @SQL_String + ' drop constraint ' set @SQL_String = @SQL_String + @Index_Name
set @SQL_String = @SQL_String + '; alter table ' set @SQL_String = @SQL_String + @Table_Name set @SQL_String = @SQL_String + ' WITH NOCHECK add constraint ' set @SQL_String = @SQL_String + @Index_Name set @SQL_String = @SQL_String + ' unique '
I have an O2 Xda IIs Pocket PC running PPC 2003 SE, WWE (Worldwide English) edition.
I want to create a database which contains all Chinese characters that have been mapped under the Unicode Standard. I already have a similar database on my desktop PC. On my desktop PC, I have used the collation Chinese_Hong_Kong_Stroke_90_CI_AS. However, on my Pocket PC, I do not see any Chinese or even Unicode sort orders. The best I get is "General".
I want to use the Chinese sort order to govern the way the characters are sorted (ie., characters with fewer strokes appear first).
How am I able to do this? / Is there anything extra that I may install to make additional collations available?
I have two databases with different collation sequences, let them be called A (SQL_Latin1_General_CI_AS) and B (Latin1_General_CI_AS). Now I need to join between the two (including through temp tables with server collation being Latin1_General_CI_AS). In order to get rid of the errors when trying to do so I changed all my statements in the WHERE and ON clauses to
If I were to change the collation of the character typed columns in database A to the one in database B, would it make any difference in terms of performance, or would it just be a useless exercise? Just asking because many of those columns are part of a primary or foreign key that would need to first be dropped and then recreated after changing the collation, and I'd prefer to save myself the effort of writing scripts to do so if the answer is NO.
BTW, I tried to change the database's collation sequence, but that leaves the collation of the columns unchanged.
Hi,Can anyone advice me which is commonly used collation name for adatabase that store Korean characters as there are a few options like"Korean_Wansung_Bin, etc.."?
My application supports multiple languages/locales in a single database. Some of our new customers want to support Chinese, Japanese, Korean, Italian, Spanish, and German in addition to English. Supporting the Latin based languages is not a problem. But I am having trouble finding a collation sequence that allows me to store the other double byte languages in the same database correctly.
I have found changing the data types from text, char, varchar to ntext, nchar, nvarchar and adding an N in front of the various strings that getting inserted seems to work:
insert into CONTENTDATA (recordid, xml) values (newid(), N'<CHANNEL1><FILE1/><TEXT1><![CDATA[和红魔拉拉队的动感精神 ]]></TEXT1><TEXT3><![CDATA[和红魔拉拉队的动感精神]]></TEXT3></CHANNEL1>');
But this is not going to be a practical solution for us. Is there a collation sequence that would allow us to store multiple locales like we do in Oracle (AL32UTF8)?
I've been tasked with supporing Polish on a program that was written as single byte. I have the basics working, but need to find out what the best collation for SQL 2005 is, or justification for testing and supporting both collations.
When I migrated data from one SQL Server to another I got collection problems because collation of the target server was different from the source one.
The best solution I thought about was to change collation of the database in target server to be equal to the server collation so that when a temporary table is created, and the collation used would be the server collation, no error would occur. All sounds logic, but, after I ran ALTER DATABASE command and changed the collation of the database, I verified that all varchar fields of all database tables retained the old collation, not the new database collation I set.
Is there any way to change the collation of all fields at once when I change the database collation?
Complete: SetPackageInstallStateAction at: 2007/9/23 7:33:43, returned true Running: DeterminePackageTransformsAction at: 2007/9/23 7:33:43 Complete: DeterminePackageTransformsAction at: 2007/9/23 7:33:43, returned true Running: ValidateSetupPropertiesAction at: 2007/9/23 7:33:43 Complete: ValidateSetupPropertiesAction at: 2007/9/23 7:33:43, returned true Running: OpenPipeAction at: 2007/9/23 7:33:43 Complete: OpenPipeAction at: 2007/9/23 7:33:43, returned false Error: Action "OpenPipeAction" failed during execution. Running: CreatePipeAction at: 2007/9/23 7:33:43 Complete: CreatePipeAction at: 2007/9/23 7:33:43, returned true Running: RunRemoteSetupAction at: 2007/9/23 7:33:43 <Func Name='CProcessCtrl::GetInstallPath'> <EndFunc Name='CProcessCtrl::GetInstallPath' Return='0' GetLastError='0'> Error: 0x80070050 TaskScheduler::NewWorkItem for SQL Server Remote Setup Error: 0x80070005 TaskSchedulerWorkItem failed to save the task [SQL Server Remote Setup ] Complete: RunRemoteSetupAction at: 2007/9/23 7:33:43, returned false Error: Action "RunRemoteSetupAction" failed during execution. Error information reported during run: Attempting to determine log files for remote install. Connection to remote computer's scheduler service. Creating new workitem. Deleting existing work item and trying again... Starting remote setup onSQL1N2 Error: 80070005 Access is denied. Running: PopulateMutatorDbAction at: 2007/9/23 7:33:43 Complete: PopulateMutatorDbAction at: 2007/9/23 7:33:43, returned true Running: GenerateRequestsAction at: 2007/9/23 7:33:43 SQL_Engine = 3 SQL_Data_Files = -1 SQL_Replication = -1 SQL_FullText = -1 SQL_SharedTools = -1 SQL_BC_DEP = -1 Analysis_Server = -1 AnalysisDataFiles = -1 AnalysisSharedTools = -1 RS_Server = -1 RS_Web_Interface = -1 RS_SharedTools = -1 Notification_Services = -1 NS_Engine = -1 NS_Client = -1 SQL_DTS = -1 Client_Components = -1 Connectivity = -1 SQL_Tools90 = -1 SQL_WarehouseDevWorkbench = -1 SDK = -1 SQLXML = -1 Tools_Legacy = -1 TOOLS_BC_DEP = -1 SQL_SSMSEE = -1 SQL_Documentation = -1 SQL_BooksOnline = -1 SQL_DatabaseSamples = -1 SQL_AdventureWorksSamples = -1 SQL_AdventureWorksDWSamples = -1 SQL_AdventureWorksASSamples = -1 SQL_Samples = -1 Complete: GenerateRequestsAction at: 2007/9/23 7:33:44, returned true Running: CreateProgressWindowAction at: 2007/9/23 7:33:44 Complete: CreateProgressWindowAction at: 2007/9/23 7:33:44, returned false Error: Action "CreateProgressWindowAction" failed during execution. Running: ScheduleActionAction at: 2007/9/23 7:33:44 Complete: ScheduleActionAction at: 2007/9/23 7:33:45, returned true Skipped: InstallASAction.11 Waiting for actions from remote setup(s) Breaking wait state and aborting package due to cancel code received: 1602 Remote setup(s) are ready Notify package action is determined: 1602 Error Code: 0x800700e9 (233) Windows Error Text: No process is on the other end of the pipe.
Source File Name: remotemessageliboverlappedpipelistener.cpp Compiler Timestamp: Sat Oct 7 09:43:54 2006 Function Name: sqls:verlappedPipeListener::writePipe Source Line Number: 294
Notification failed to send. ---- Context ----------------------------------------------- sqls::HostSetupPackageInstallerSynch::installAction
Removing machine from list of targets to sync. Skipped: Action "InstallASAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "as", will not be installed. Skipped: InstallASAction.18 Skipped: Action "InstallASAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "as", will not be installed. Skipped: InstallASAction.22 Skipped: Action "InstallASAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "as", will not be installed. Skipped: InstallASAction.9 Skipped: Action "InstallASAction.9" was not run. Information reported during analysis: All installs have been cancelled, so package: "msxml6", referred by package: "as", will not be installed. Skipped: InstallDTSAction Skipped: Action "InstallDTSAction" was not run. Information reported during analysis: All installs have been cancelled, so package: "dts", will not be installed. Skipped: InstallDTSAction.11 Skipped: Action "InstallDTSAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.12 Skipped: Action "InstallDTSAction.12" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlncli", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.18 Skipped: Action "InstallDTSAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.22 Skipped: Action "InstallDTSAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.9 Skipped: Action "InstallDTSAction.9" was not run. Information reported during analysis: All installs have been cancelled, so package: "msxml6", referred by package: "dts", will not be installed. Skipped: InstallNSAction Skipped: Action "InstallNSAction" was not run. Information reported during analysis: All installs have been cancelled, so package: "ns", will not be installed. Skipped: InstallNSAction.11 Skipped: Action "InstallNSAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "ns", will not be installed. Skipped: InstallNSAction.12 Skipped: Action "InstallNSAction.12" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlncli", referred by package: "ns", will not be installed. Skipped: InstallNSAction.18 Skipped: Action "InstallNSAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "ns", will not be installed. Skipped: InstallNSAction.22 Skipped: Action "InstallNSAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "ns", will not be installed. Skipped: InstallNSAction.9 Skipped: Action "InstallNSAction.9" was not run. Information reported during analysis: All installs have been cancelled, so package: "msxml6", referred by package: "ns", will not be installed. Skipped: InstallRSAction.11 Skipped: Action "InstallRSAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "rs", will not be installed. Skipped: InstallRSAction.18 Skipped: Action "InstallRSAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "rs", will not be installed. Skipped: InstallRSAction.22 Skipped: Action "InstallRSAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "rs", will not be installed. Skipped: InstallSqlAction Clustered feature detected: SQL_Engine Clustered feature detected: SQL_FullText Loaded DLL:C:Program FilesMicrosoft SQL Server90Setup Bootstrapsqlsval.dll Version:2005.90.3042.0 Windows Error Text: User cancelled installation.
Source File Name: sqlchainingsqlchainingactions.cpp Compiler Timestamp: Thu Nov 16 20:32:00 2006 Function Name: sqls::ReportChainingResults:erform Source Line Number: 3667
---- Context ----------------------------------------------- sqls::RunRemoteSetupAction::waitForRemoteSetupComplete king package: "patchRS2000" as failed due to cancel code received from cancel source: 1602 sqls Delay load of action "UploadDrWatsonLogAction" returned nothing. No action will occur as a result. Message pump returning: 1602
I had Sql Server 2005 installed on my machine, with that I am working on Visual Studio 2005. I just need to add an existing database into the app_data folder. The database is existing in the Sql server, it contains 180 tables so I cannot manually copy that tables in the app_data folder. for that is there any another way to copy all the tables into the database into the folder app_data with the data in the table. Thanks & Regards Girish Nehte
I am trying to transfer my database from my computer where built it to another computer. I have microsoft SQL server 2005 CTP on my computer and the other computer has Microsoft SQL server. Does anyone have any suggestions on how to do this??? I cannot find much info on SQL server 2005 CTP. I have found some info about the copy database wizzard, but I cannot find that in CTP. Please any ideas or info would be wonderful Thanks Sarah
Anybody has idea how to transfer database from SQL Server 7 to 6.5? I know how to migrating/upgrading database from 6.5 to 7.0, but from 7.0 to 6.5 seems not an easy one. DTS only transfer tables and data but not trigers, SPs, etc. The script generated in 7 can not be applied to 6.5. Any ideas? Thanks in advance.
i transferred the database on 6.5 SQL server to 7.0 , only the tables were transfered . none of the stored procedures or triggers were transfered. how can one transfer these objects also.