SlideShare una empresa de Scribd logo
1 de 29
Lightning Talks
GogulaAryalingam Business Intelligence
01
Navantis
Thank you
My data-mart is better thanyour data warehouse
ShihamSamsudeen T-SQL
02
Zone 24x7
TRY… CATCH…Alien?
• Your Code in the TRY block
• Check for the Errors in the CATCH block
Can be found in
Modern Programming Languages
TRY… CATCH…T-SQLStyle
• Your SQLStatement in the TRY block
• Check for the Errors in the CATCH block
Find it in
Transact-SQL
sql_statement:
any Transact-SQL statement
statement_block :
any group of Transact-SQL statements
in a batch or enclosed in a BEGIN…END block.
Why your codeFAILED?
List of SQL Server functions to identify:
ERROR_NUMBER() returns the number of the error
ERROR_SEVERITY() returns the severity of the error
ERROR_STATE() returns the error state number
ERROR_PROCEDURE() returns the name of the stored procedure or trigger where the error
occurred, this will be NULL if you run an ad-hoc SQL statement
ERROR_LINE() returns the line number inside the routine that caused the error
ERROR_MESSAGE() returns the complete text of the error message.
The text includes the values supplied for any substitutable parameters, such as
lengths, object names, or times
NEED to see some T-SQL
Nice Result
Check out what
being selected
out?
What can we do with this ?
I will Hold Error
Info
I will Fill the
Error Info
Error Occurs…
Recording
Error Info
Take Out the
Error Info.
Results!
Error 1
Error 2
Error 3
Information isWealth!
 the ability to log all errors plus any
other information you want to capture like
user name, host name etc with 1 Stored
Proc that you can call from everywhere
 the ability to do anything with the
logged data Once YOU have it.
I CAN NOT do ANYTHING on SOMETHING until I have that THING!
Thank you
Try… Catch…
SusanthaBathige T-SQL
03
Pearson Lanka
Thank you
ParameterSniffing
SudeshWijayatilake
PerformanceTuning
04
Finlays Colombo PLC
The Feature
• The DataCompression featureof SQL Server, can reduce
thestorage footprint of your databases.
– Often, datacompression mayleadto degrade inCPU
performance duetocompress/decompress;
• However,SQLServer2008datacompressionsimply storesdatamore
efficiently intherowsandpages,which meansthatthein-memory
storageandIOOperations datamanagementisefficient.
Mainly 2 Types ofCompression
• SQLServer 2008supports2specifictypesofdata compressionmethods:
– Row Compression
• lower level whichstoresthe fixed characterstrings by using variable-lengthformat bynot
storingthe blankcharacters.NULLand 0 values acrossalldatatypes areoptimized and take
no bytes.
– Page Compression
• Is Higherlevel compressing & uses twotypes of compression
– Prefix-Prefixcompressionworkson common values patternacross all rowson thepage
– Dictionary - Workson exactvaluesmatchpatternacrossallpages.
Considerations
• Datacompressvery well:
– Columnswith numericor fixed-length characterdata types wheremost valuesdon’t requireall the
allocated bytes: For example, integers wheremost values are less than1000
– Null-ablecolumns wherea significant numberof the rows havea NULLvalue for the column
– Significant amounts of repeating data values orrepeating prefixvalues in the data
• Somepatternsof datathatdonotbenefitmuch fromcompressionare:
– Columnswith numericor fixed-length characterdata typeswheremost values requireall the bytes
allocated for the specific data type
– Not muchrepeating data
– Repeating data with non-repeatingprefixes
– Data stored out of the row
– FILESTREAMdata
• Compression is Version dependant [Cannot be decompressed on another version]
ImplementData compression
• You can implement both types of data compression when
you create a table or index, or by altering existing tables
and indexes. You can do this by using Transact-SQL code
or theDataCompression Wizard.
USE [AdventureWorks]
Go
/*Estimating how much space can be saved by row or page*/
EXEC
sp_estimate_data_compression_savings 'Sales', 'SalesOrderDetail', NULL, NULL,'ROW' ;
Go
EXEC
sp_estimate_data_compression_savings 'Sales', 'SalesOrderDetail', NULL,NULL, 'PAGE' ;
GO
---------------------------------------------------------------------------------------------------------------
/*Enabling Table compression by row or page */
ALTER TABLE Sales.SalesOrderDetail
REBUILD WITH (DATA_COMPRESSION = ROW);
–OR
ALTER TABLE [Sales].[SalesOrderDetail] REBUILD PARTITION = ALL
WITH (DATA_COMPRESSION = PAGE)
Referredfrom
http://msdn.microsoft.com/en-us/library/dd894051(v=sql.100).aspx
Boltof Lightening
Queriesand ShareYour Findings
• Pleaseemailme
Sudesh.wijayatilaka@yahoo.com
–OR uploadto ourSQL Server Universe site
http://www.sqlserveruniverse.com/ forums
Thank you
DataCompression
SupunThrikawala PerformanceTuning
05
CAMManagement Solutions
Thank you
Table variables, the good and thebad
AvanthaSiriwardana General
06
CAMManagement Solutions
Thank you
SQL Server Standards

Más contenido relacionado

Similar a Anything SQL: Lightning Talks

Introduction to Threading in .Net
Introduction to Threading in .NetIntroduction to Threading in .Net
Introduction to Threading in .Net
webhostingguy
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
Axmed Mo.
 
05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx
MohamedNowfeek1
 

Similar a Anything SQL: Lightning Talks (20)

Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
Module02
Module02Module02
Module02
 
Introduction to Threading in .Net
Introduction to Threading in .NetIntroduction to Threading in .Net
Introduction to Threading in .Net
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
SQL Track: In Memory OLTP in SQL Server
SQL Track: In Memory OLTP in SQL ServerSQL Track: In Memory OLTP in SQL Server
SQL Track: In Memory OLTP in SQL Server
 
SQL - RDBMS Concepts
SQL - RDBMS ConceptsSQL - RDBMS Concepts
SQL - RDBMS Concepts
 
U-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for DevelopersU-SQL - Azure Data Lake Analytics for Developers
U-SQL - Azure Data Lake Analytics for Developers
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
SQL Server 2008 Performance Enhancements
SQL Server 2008 Performance EnhancementsSQL Server 2008 Performance Enhancements
SQL Server 2008 Performance Enhancements
 
Columnstore indexes in sql server 2014
Columnstore indexes in sql server 2014Columnstore indexes in sql server 2014
Columnstore indexes in sql server 2014
 
Sq lite module6
Sq lite module6Sq lite module6
Sq lite module6
 
Simplifying SQL with CTE's and windowing functions
Simplifying SQL with CTE's and windowing functionsSimplifying SQL with CTE's and windowing functions
Simplifying SQL with CTE's and windowing functions
 
SQL Server 2008 Development for Programmers
SQL Server 2008 Development for ProgrammersSQL Server 2008 Development for Programmers
SQL Server 2008 Development for Programmers
 
(BDT401) Amazon Redshift Deep Dive: Tuning and Best Practices
(BDT401) Amazon Redshift Deep Dive: Tuning and Best Practices(BDT401) Amazon Redshift Deep Dive: Tuning and Best Practices
(BDT401) Amazon Redshift Deep Dive: Tuning and Best Practices
 
Dan Hotka's Top 10 Oracle 12c New Features
Dan Hotka's Top 10 Oracle 12c New FeaturesDan Hotka's Top 10 Oracle 12c New Features
Dan Hotka's Top 10 Oracle 12c New Features
 
05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx05 Create and Maintain Databases and Tables.pptx
05 Create and Maintain Databases and Tables.pptx
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Super scaling singleton inserts
Super scaling singleton insertsSuper scaling singleton inserts
Super scaling singleton inserts
 

Más de SQL Server Sri Lanka User Group (7)

Minding SQL Server Memory
Minding SQL Server MemoryMinding SQL Server Memory
Minding SQL Server Memory
 
Using Extended Events
Using Extended EventsUsing Extended Events
Using Extended Events
 
Breaking a Myth in 600 Seconds: Seek is Always Better than Scan
Breaking a Myth in 600 Seconds: Seek is Always Better than ScanBreaking a Myth in 600 Seconds: Seek is Always Better than Scan
Breaking a Myth in 600 Seconds: Seek is Always Better than Scan
 
Windowing Functions in SQL Server
Windowing Functions in SQL ServerWindowing Functions in SQL Server
Windowing Functions in SQL Server
 
Whirlwind DBA Demos
Whirlwind DBA DemosWhirlwind DBA Demos
Whirlwind DBA Demos
 
Why OLAP? How OLAP.
Why OLAP? How OLAP.Why OLAP? How OLAP.
Why OLAP? How OLAP.
 
Using Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource UtilizationUsing Resource Governor to Control Resource Utilization
Using Resource Governor to Control Resource Utilization
 

Último

Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
shambhavirathore45
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
shivangimorya083
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 

Último (20)

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
Best VIP Call Girls Noida Sector 39 Call Me: 8448380779
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 

Anything SQL: Lightning Talks

  • 3.
  • 4. Thank you My data-mart is better thanyour data warehouse
  • 6. TRY… CATCH…Alien? • Your Code in the TRY block • Check for the Errors in the CATCH block Can be found in Modern Programming Languages
  • 7. TRY… CATCH…T-SQLStyle • Your SQLStatement in the TRY block • Check for the Errors in the CATCH block Find it in Transact-SQL sql_statement: any Transact-SQL statement statement_block : any group of Transact-SQL statements in a batch or enclosed in a BEGIN…END block.
  • 8. Why your codeFAILED? List of SQL Server functions to identify: ERROR_NUMBER() returns the number of the error ERROR_SEVERITY() returns the severity of the error ERROR_STATE() returns the error state number ERROR_PROCEDURE() returns the name of the stored procedure or trigger where the error occurred, this will be NULL if you run an ad-hoc SQL statement ERROR_LINE() returns the line number inside the routine that caused the error ERROR_MESSAGE() returns the complete text of the error message. The text includes the values supplied for any substitutable parameters, such as lengths, object names, or times
  • 9. NEED to see some T-SQL Nice Result Check out what being selected out?
  • 10. What can we do with this ? I will Hold Error Info I will Fill the Error Info
  • 11. Error Occurs… Recording Error Info Take Out the Error Info. Results! Error 1 Error 2 Error 3
  • 12. Information isWealth!  the ability to log all errors plus any other information you want to capture like user name, host name etc with 1 Stored Proc that you can call from everywhere  the ability to do anything with the logged data Once YOU have it. I CAN NOT do ANYTHING on SOMETHING until I have that THING!
  • 17. The Feature • The DataCompression featureof SQL Server, can reduce thestorage footprint of your databases. – Often, datacompression mayleadto degrade inCPU performance duetocompress/decompress; • However,SQLServer2008datacompressionsimply storesdatamore efficiently intherowsandpages,which meansthatthein-memory storageandIOOperations datamanagementisefficient.
  • 18. Mainly 2 Types ofCompression • SQLServer 2008supports2specifictypesofdata compressionmethods: – Row Compression • lower level whichstoresthe fixed characterstrings by using variable-lengthformat bynot storingthe blankcharacters.NULLand 0 values acrossalldatatypes areoptimized and take no bytes. – Page Compression • Is Higherlevel compressing & uses twotypes of compression – Prefix-Prefixcompressionworkson common values patternacross all rowson thepage – Dictionary - Workson exactvaluesmatchpatternacrossallpages.
  • 19. Considerations • Datacompressvery well: – Columnswith numericor fixed-length characterdata types wheremost valuesdon’t requireall the allocated bytes: For example, integers wheremost values are less than1000 – Null-ablecolumns wherea significant numberof the rows havea NULLvalue for the column – Significant amounts of repeating data values orrepeating prefixvalues in the data • Somepatternsof datathatdonotbenefitmuch fromcompressionare: – Columnswith numericor fixed-length characterdata typeswheremost values requireall the bytes allocated for the specific data type – Not muchrepeating data – Repeating data with non-repeatingprefixes – Data stored out of the row – FILESTREAMdata • Compression is Version dependant [Cannot be decompressed on another version]
  • 20. ImplementData compression • You can implement both types of data compression when you create a table or index, or by altering existing tables and indexes. You can do this by using Transact-SQL code or theDataCompression Wizard.
  • 21. USE [AdventureWorks] Go /*Estimating how much space can be saved by row or page*/ EXEC sp_estimate_data_compression_savings 'Sales', 'SalesOrderDetail', NULL, NULL,'ROW' ; Go EXEC sp_estimate_data_compression_savings 'Sales', 'SalesOrderDetail', NULL,NULL, 'PAGE' ; GO --------------------------------------------------------------------------------------------------------------- /*Enabling Table compression by row or page */ ALTER TABLE Sales.SalesOrderDetail REBUILD WITH (DATA_COMPRESSION = ROW); –OR ALTER TABLE [Sales].[SalesOrderDetail] REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = PAGE)
  • 24. Queriesand ShareYour Findings • Pleaseemailme Sudesh.wijayatilaka@yahoo.com –OR uploadto ourSQL Server Universe site http://www.sqlserveruniverse.com/ forums
  • 27. Thank you Table variables, the good and thebad
  • 29. Thank you SQL Server Standards

Notas del editor

  1. More on this argument: http://dbantics.wordpress.com/2011/04/03/my-data-mart-is-better-than-your-data-warehouse/