developers' new features of sql server express 2012

23
Presented By Md. Ziaur Rahman Senior Software Engineer Astha IT Research and Consultancy Ltd.

Upload: ziaur-rahman

Post on 05-Jul-2015

860 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Developers' New features of Sql server express 2012

Presented By

Md. Ziaur Rahman

Senior Software EngineerAstha IT Research and Consultancy Ltd.

Page 2: Developers' New features of Sql server express 2012

Targeted Product : SQL Server 2012 Express

Hardware and Software Requirement

Limitations

Installation

New Features

How to publish Data By MSSQL 2012 Express

Page 3: Developers' New features of Sql server express 2012

32-bit systems Computer with Intel or compatible 1GHz or faster

processor (2 GHz or faster is recommended.)

64-bit systems 1.4 GHz or faster processor

Minimum of 512 MB of RAM (2 GB or more is recommended.)

2.2 GB of available hard disk space

OS : Windows 7, Windows Server 2008 R2, Windows Server 2008 Service Pack 2, Windows Vista Service Pack 2

Page 4: Developers' New features of Sql server express 2012

Installations can only make use of one CPU with a four core maximum

Installations can only make use of 1GB of RAM, regardless of the amount of memory installed

Databases built with Express Edition are limited to 10GB in size

Express Edition does not offer the database mirroring, log shipping, or merge publication features offered in the larger product

SQL Server Express Edition does not include Oracle replication functionality

The tools available with Express Edition are limited – the installer does not include Database Tuning Advisor, SQL Agent, or SQL

Profiler

Page 6: Developers' New features of Sql server express 2012

SQL Server 2012 introduces 14 new built-in functions. The new functions are: Conversion functions PARSE (Transact-SQL) TRY_CONVERT (Transact-SQL) TRY_PARSE (Transact-SQL) Date and time functions DATEFROMPARTS (Transact-SQL) DATETIME2FROMPARTS (Transact-SQL) DATETIMEFROMPARTS (Transact-SQL) DATETIMEOFFSETFROMPARTS (Transact-SQL) EOMONTH (Transact-SQL) SMALLDATETIMEFROMPARTS (Transact-SQL) TIMEFROMPARTS (Transact-SQL) Logical functions CHOOSE (Transact-SQL) IIF (Transact-SQL) String functions CONCAT (Transact-SQL) FORMAT (Transact-SQL)

Page 7: Developers' New features of Sql server express 2012

Syntax : CHOOSE ( index, val_1, val_2 [, val_n ] )Example :SELECT CHOOSE ( 3, 'Manager', 'Director', 'Developer',

'Tester' ) AS Result;

Result -------------Developer (1 row(s) affected)

Page 8: Developers' New features of Sql server express 2012

Execute a stored procedure or function [ { EXEC | EXECUTE } ] { [ @return_status = ] { module_name [ ;number ] | @module_name_var } [ [ @parameter = ] { value | @variable [ OUTPUT ] | [ DEFAULT ] } ] [ ,...n ] [ WITH <execute_option> [ ,...n ] ] } [;]

Execute a character string { EXEC | EXECUTE } ( { @string_variable | [ N ]'tsql_string' } [ + ...n ] ) [ AS { LOGIN | USER } = ' name ' ] [;]

Page 9: Developers' New features of Sql server express 2012

Execute a pass-through command against a linked server { EXEC | EXECUTE } ( { @string_variable | [ N ] 'command_string [ ? ]' } [ + ...n ] [ { , { value | @variable [ OUTPUT ] } } [ ...n ] ] ) [ AS { LOGIN | USER } = ' name ' ] [ AT linked_server_name ] [;]

<execute_option>::= { RECOMPILE | { RESULT SETS UNDEFINED } | { RESULT SETS NONE } | { RESULT SETS ( <result_sets_definition> [,...n ] ) } }

<result_sets_definition> ::= { ( { column_name data_type [ COLLATE collation_name ] [ NULL | NOT NULL ] } [,...n ] ) | AS OBJECT [ db_name . [ schema_name ] . | schema_name . ] {table_name | view_name | table_valued_function_name } | AS TYPE [ schema_name.]table_type_name | AS FOR XML }

Page 10: Developers' New features of Sql server express 2012

-- Execute the procedure

EXEC Production.ProductList '%tire%‘

WITH RESULT SETS (

(ProductID int, -- first result set

Name nvarchar(255),

ListPrice money) , -- comma & 2nd RS

(Name nvarchar(255) ,

NumberOfOrders int

));

Page 11: Developers' New features of Sql server express 2012

Old Code :

DECLARE @Offset AS INT = 6 DECLARE @PageSize AS INT = 5 SELECT Id, Name FROM ( SELECT Id, Name, ROW_NUMBER() OVER (ORDER BY Id) AS

RowNumberFROM Users ) UsersSelectionWHERE UsersSelection.RowNumber > @Offset AND

UsersSelection.RowNumber <= @Offset + @PageSize

Page 12: Developers' New features of Sql server express 2012

SQL server 2012 Code :

DECLARE @Offset AS INT = 6

DECLARE @PageSize AS INT = 5

SELECT Id,

Name

FROM Users

ORDER BY Id

OFFSET @Offset ROWS

FETCH NEXT @PageSize ROWS ONLY

Page 13: Developers' New features of Sql server express 2012

Purpose :Better performance for auto-generated IDs and easier to have

IDs unique across tables.

Scenarios :

The application requires a number before the insert into the table is made.

The application requires sharing a single series of numbers between multiple tables or multiple columns within a table.

The application must restart the number series when a specified number is reached. For example, after assigning values 1 through 10, the application starts assigning values 1 through 10 again.

Page 14: Developers' New features of Sql server express 2012
Page 15: Developers' New features of Sql server express 2012
Page 16: Developers' New features of Sql server express 2012

INSERT INTO Monitors

(

Id,

Width

)

VALUES

(

NEXT VALUE FOR seqInventory,

19

)

Page 17: Developers' New features of Sql server express 2012

Data publishing is same like SQL Server 2008.

Steps are :

Page 18: Developers' New features of Sql server express 2012
Page 19: Developers' New features of Sql server express 2012
Page 20: Developers' New features of Sql server express 2012
Page 21: Developers' New features of Sql server express 2012
Page 22: Developers' New features of Sql server express 2012
Page 23: Developers' New features of Sql server express 2012