USE [DB_Name]
ALTER TABLE Foreign_Key_Table
ADD CONSTRAINT FK_ForiegnKeyTable_PrimaryKeyTable FOREIGN KEY (ForeignKeyColumn)
REFERENCES PrimaryKeyTable(PrimaryKeyTable_PrimaryKeyColumn);
USE [DB_Name]
ALTER TABLE Foreign_Key_Table
ADD CONSTRAINT FK_ForiegnKeyTable_PrimaryKeyTable FOREIGN KEY (ForeignKeyColumn)
REFERENCES PrimaryKeyTable(PrimaryKeyTable_PrimaryKeyColumn);
یک تفاوت مهم این است که datalength تعداد بایت و len تعداد کاراکتر را می شمارد.
http://sqlhints.com/tag/sql-len-vs-datalength/
USE AdventureWorks2012; GO SELECT length = DATALENGTH(Name), Name FROM Production.Product ORDER BY Name; GO
SELECT LastName,FirstName,Address FROM Persons
WHERE Address IS NULL
SELECT LastName,FirstName,Address FROM Persons
WHERE Address IS NOT NULL
insert into [Ali_Safarnavadeh_Test_Database].[dbo].[tbFamilyMember] (FirstName, LastName)
select personfirstname, personlastname
from [ُOriginal_Database].[dbo].[person]