DECLARE @myVar int SET @myVar = 5
you can do it in one line: DECLARE @myVar int = 5
C like math syntax. SET @i += 5
Table Value Parameters (TVP)
CREATE TYPE PeepsType AS TABLE (Name varchar(20), Age int)
DECLARE @myPeeps PeepsType INSERT @myPeeps SELECT 'murphy', 35 INSERT @myPeeps SELECT 'galen', 31 INSERT @myPeeps SELECT 'samuels', 27 INSERT @myPeeps SELECT 'colton', 42 exec sp_MySproc2 @myPeeps
And the sproc would look like this:
CREATE PROCEDURE sp_MySproc2(@myPeeps PeepsType READONLY)
New Management Studio - Easily Write Query With Autosuggest Feature
SQL Server 2008's new data types:
INSERT dbo.EMPLOYEE(SALARY) VALUES (1000) INSERT dbo.EMPLOYEE(SALARY) VALUES (2000) INSERT dbo.EMPLOYEE(SALARY) VALUES (3000) INSERT dbo.EMPLOYEE(SALARY) VALUES (4000) --SQL Server 2008
INSERT dbo. EMPLOYEE(SALARY) VALUES (1000),(2000),(3000),(4000)
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: