SELECT OBJECTPROPERTY(OBJECT_ID('TableName'), 'IsMSShipped')
0 --> Indicates User Table
1 --> Indicates System Table
Friday, June 6, 2008
Query to mark a user table as a system table
EXEC sp_ms_marksystemobject 'TableName' Go
Labels:
SQL Queries
dtproperties Table in SQL Server 2000
dtproperties is a system table that stores the information about the Database Diagrams created in a particular database. Whenever a Database diagram is created or modified this table
gets updated automatically.
Basically this is a system table but when we run the below query we will get the name of
dtproperties table in the result set, indicating that this is user table.Microsoft has
confirmed that this is a bug in the Microsoft SQL Server.
Select * from sysobjects where xtype='u'
gets updated automatically.
Basically this is a system table but when we run the below query we will get the name of
dtproperties table in the result set, indicating that this is user table.Microsoft has
confirmed that this is a bug in the Microsoft SQL Server.
Select * from sysobjects where xtype='u'
Labels:
MSSQL,
SQL Information
Thursday, June 5, 2008
Finding Difference between Tables in SQL 2005
In SQL 2005 the difference between tables can be easily found by using the tool
TableDiff.exe.
TableDiff.exe is a comparison tool that is provided with the sql server.
It will be found in the following location:
"C:\Program Files\Microsoft SQL Server\90\COM\TableDiff.exe"
The Drive name depends on where the SQL is Installed.
This tool compares 2 tables of the same database on the same server and creates a new
table called new Table that holds the differences.
"C:\Program Files\Microsoft SQL Server\90\COM\tablediff.exe"
-sourceserver ServerName
-sourcedatabase DatabaseName
-sourcetable TableName
-destinationserver ServerName
-destinationdatabase DatabaseName
-destinationtable TableName
-et NewTableName
For more information on this utility check out the microsoft website:
http://msdn2.microsoft.com/en-us/library/ms162843.aspx
TableDiff.exe.
TableDiff.exe is a comparison tool that is provided with the sql server.
It will be found in the following location:
"C:\Program Files\Microsoft SQL Server\90\COM\TableDiff.exe"
The Drive name depends on where the SQL is Installed.
This tool compares 2 tables of the same database on the same server and creates a new
table called new Table that holds the differences.
"C:\Program Files\Microsoft SQL Server\90\COM\tablediff.exe"
-sourceserver ServerName
-sourcedatabase DatabaseName
-sourcetable TableName
-destinationserver ServerName
-destinationdatabase DatabaseName
-destinationtable TableName
-et NewTableName
For more information on this utility check out the microsoft website:
http://msdn2.microsoft.com/en-us/library/ms162843.aspx
Labels:
MSSQL,
SQL Information
Undocumented Stored Procedure to get SQL Version
EXEC master..sp_MSgetversion
Labels:
SQL Information
Subscribe to:
Posts (Atom)