REset the Identiy Column to Zero
==================================================
DBCC CHECKIDENT ( tbl_MOduleImages,RESEED,0)
Synatx :
DBCC CHECKIDENT (tbl_name,RESEED,0)
Adding Foreign Key To Tables
===================
GO
ALTER TABLE [dbo].[UserFavorite] WITH CHECK ADD CONSTRAINT [FK_UserFavorite_Users] FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([EntityID])
GO
ALTER TABLE [dbo].[UserFavorite] CHECK CONSTRAINT [FK_UserFavorite_Users]
GO
========================================
Modify Table
Syntax to add new Column
alter table <tablename> ADD columnname <datatype> <width>
example
--------------
alter table dept add empname varchar(50)Copy Data from table from Diferent Existing Database
===========================================
Drop table tbl_Property_Master
Note:Remove the Table if already Existsselect * into tbl_Property_Master from Property.dbo.Property_Master
Copy the data from table Property_Master in database Property to a new table tbl_Property_Master in another database
No comments:
Post a Comment