Tutorial SQLServer 05

Telechargé par youcef hedibel
242James Knight
Constant
SQL
DECLARE
DECLARE Options
DECLARE Transact-
SQL
C/C++, Pascal, Java, C#
Transact-SQL
DECLARE @264
_@_n@act@Second
_
@_24@act_52t
@DateHired, @_RealSport, @DriversLicenseNumber
DECLARE @VariableName DataType;
DECLARE @Variable1 DataType1, @Variable2 DataType2, @Variable_n
DataType_n;
C/C++, C#, Java, Pascal
Initializing a Variable
Null
SELECTSET
SELECT @VariableName = DesiredValue
SET @VariableName = DesiredValue
SELECTPRINT
SQL
01bit
DECLARE @IsOrganDonor bit;
0
0False
True
1
DECLARE @IsMarried bit
SET @IsMarried = 1
SELECT @IsMarried AS [Is Married?];
GO
2
Integer
Integer2,147,483,648
2,147,483,64
79,435,794
SQL
Integerint
DECLARE @Category int;
SET @Category = 1450;
PRINT @Category;
GO
1450
int4 bytes
tinyinttinyint
0255
smallintint
32.76732.768
DECLARE @NumberOfPages SMALLINT;
SET @NumberOfPages = 16;
SELECT @NumberOfPages AS [Number of Pages];
GO
bigintint
9.223.372.036.854.775.8089.223.372.036.854.775.807
DECLARE @CountryPopulation BigInt;
SET @CountryPopulation = 16500000;
SELECT @CountryPopulation AS 'Country Population';
GO
binary data
hexadecimal0x7238, 0xFA36
varbinaryvarbinary
Integer
1
DECLARE @IsMarried bit, @EmplStatus int;
SET @IsMarried = 1;
SET @EmplStatus = 2;
SELECT @IsMarried AS [Is Married?],
@EmplStatus AS [Employment Status];
GO
1 / 18 100%

Tutorial SQLServer 05

Telechargé par youcef hedibel
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans linterface ou les textes ? Ou savez-vous comment améliorer linterface utilisateur de StudyLib ? Nhésitez pas à envoyer vos suggestions. Cest très important pour nous !