Home
Articles
Forums
Tips
Training
FAQ's
Blogs
Software
Books
About Us
RSS Feeds
FAQ Topics
All FAQ's
General DBA
General Developer
DBA Performance Tuning
Developer Performance Tuning
Clustering
Error Messages
USEFUL SITES :
ASP.NET Tutorials
Windows and SQL Azure Tutorials
Cloud Hosting Magazine
SharePoint Tutorials
Windows Server Help
Write for Us
Share your SQL Server knowledge with others and raise your profile in the community
More...
Latest Articles
WebMatrix Tutorial - Getting Started
Working with IIS using PowerShell
Know your Data with Data Profiling
Overview of SQL Server 2008 R2 Express Edition
More
Latest FAQ's
SQL Agent job getting suspended.
Queries which include DMFs return a syntax error ...
Could not find stored procedure 'dbo.sp_MSins_dboTest'
How to change server name when replication is enabled.
More
Latest Software Reviews
dbForge Review
Spotlight on ApexSQL Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Data Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Doc 2008
More
ALTER TABLE SWITCH statement failed because column '%.*ls' has data type %s in source table '%.*ls' which is different from its type %s in target table '%.*ls'.
$0
Error Message:$0
Msg 4944, Level 16, State 1, Line 1$0ALTER TABLE SWITCH statement failed because column '%.*ls' has data type %s in source table '%.*ls' which is different from its type %s in target table '%.*ls'.$0$0
Severity level:
$016.$0$0
Description:$0
This error message appears when you try to execute an ALTER TABLE SWITCH command, for which column(s) in the source and table table have different datatypes.$0$0
Consequences:$0
The T-SQL statement can be parsed, but causes the error at runtime.$0$0
Resolution:
$0Errors of the Severity Level 16 are generated by the user and are corrigible by the user. The statement cannot be executed this way. All column(s) in the source and target table must have the same datatype.$0$0
Versions:
$0This error message was introduced with SQL Server 2005.$0$0
Example(s):$0
USE Pubs$0GO$0CREATE PARTITION FUNCTION myPartFunction (int)$0AS RANGE LEFT FOR VALUES (1, 10, 100);$0GO$0$0CREATE PARTITION SCHEME myPartScheme$0AS PARTITION myPartFunction$0ALL TO ([PRIMARY]);$0GO$0$0CREATE TABLE myPartTable$0($0c1 int$0)$0ON myPartScheme (c1);$0$0GO$0CREATE TABLE myNonPartTable $0($0c1 bigint$0)$0ON [PRIMARY];$0GO$0ALTER TABLE myPartTable SWITCH PARTITION 1 TO dbo.myNonPartTable ;$0GO$0$0DROP TABLE myNonPartTable, myPartTable;$0DROP PARTITION SCHEME myPartScheme;$0DROP PARTITION FUNCTION myPartFunction;$0$0
Remarks:
$0In the above example we try to execute an ALTER TABLE SWITCH command. Because the columns in the source and target table do haev different datatypes, the error is raised.$0
Ask A Question In the Forums
C# Help and Tutorials
|
PHP MySQL Tutorial
|
Sharepoint Tutorial
|
Azure Tutorial
|
Cloud Hosting Magazine
|
ASP.NET Tutorials
|
Derivatives
|
Windows Server Help
|
Windows Phone Pro
|
Silverlight Ace
|
Visual Studio Tutorials
|
Home
|
Peformance Articles
|
Audit Articles
|
Business Intelligence Articles
|
Clustering Articles
|
Developer Articles
|
Reporting Services Articles
|
DBA Articles
|
ASP.NET / ADO.NET Articles
|
SQL Server Training Videos
|
DBA FAQ's
|
Developer Peformance FAQ's
|
DBA Peformance FAQ's
|
Developer FAQ's
|
Clustering FAQ's
|
Error Messages
|
Audit Tool Reviews
|
Sonasoft
|
Andy Khanna
|
Backup Tool Reviews
|
Coding Tool Reviews
|
Compare Tool Reviews
|
Documentation Tool Reviews
|
Design Tool Reviews
|
Monitoring Tool Reviews
|
Log Tool Reviews
|
Reporting Tool Reviews
|
Clustering Tool Reviews
|
Security Tool Reviews
|
Change Management Tool Reviews
|
Remote Access Tool Reviews
|
Book Reviews
|
Security Tool Reviews
|
ADO.NET / ASP.NET
|
Administration
|
Analysis/OLAP Services
|
Application Development
|
Configuration
|
Components
|
ETL
|
Hardware
|
High Availability
|
Hints
|
Index
|
Misc
|
Operating Systems
|
Performance Tuning
|
Replication
|
T-SQL
|
Views
© 2010 Jude O'Kelly. All rights reserved