Showing posts with label SQL Server 2008. Show all posts
Showing posts with label SQL Server 2008. Show all posts

Monday, October 20, 2014

Microsoft Announces Real-time Analytics For Apache Hadoop In Azure HDInsight


At Strata + Hadoop World in New York, Microsoft announced the expansion of their Azure data services. They annoucned the support of real-time analytics for Apache Hadoop in Azure HDInsight and new machine learning capabilities in the Azure Marketplace. Also, Hortonworks announced how they are integrating with Microsoft Azure with the latest release of the Hortonworks Data Platform.

More... http://microsoft-news.com/microsoft-announces-real-time-analytics-for-apache-hadoop-in-azure-hdinsight/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+msftnws+%28Microsoft+News%29 

Wednesday, October 16, 2013

Microsoft SQL Server CTP2 announced...

Microsoft SQL Server CTP2 announced...

Microsoft SQL Server 2014 brings to market new in-memory capabilities built into the core database and provides new cloud capabilities to simplify cloud adoption for your SQL databases and help you unlock new hybrid scenarios.
 
Key SQL 2014 Architecture features and improvements:
 
1.) Provides new disaster recovery and backup solutions with Windows Azure, enabling customers to use their existing skills with the on-premises product offerings to take advantage of Microsoft’s global datacenters.
2.) Code named "Hekaton" is now known simply "In-Memory" Online Transaction Processing (OLTP). In-Memory OLTP will let administrators move selected tables into main memory, thereby delivering performance improvements without having to touch the actual applications.
3.) Support for additional index types.
4.) Natively compiled stored procedures for efficient execution of business logic.
5.) New tools to help administrators access database performance so that they can determine which tables would most benefit from in-memory optimization.
 
Download Microsoft SQL Server 2014 here:
 
Here's more to In memory architecture overview of SQL server 2014 -
 
Tech net blog on how to get started with SQL 2014 -
 
Hardware Considerations for SQL Server 2014 (Microsoft does claim backward compatibility -if you can run your applications on SQL 2012, you can run on SQL 2014)-
 
Final release expected to be announced sometime later half of CY 2014, but will learn more from developer community as we play around this!
 
Pass Summit 2013 is going on now... stay tuned for more innovation!!!
 
Cheers - Dipesh

Tuesday, August 20, 2013

Microsoft Server 2014 CTP1 features and download available now...

Server 2014 CTP1 available now
 
  • SQL Server 2014 takes an integrated approach to in-memory database technology. In-Memory OLTP, which optimizes performance of OLTP workloads, is fully integrated in the core SQL Server relational data
  • SQL Server 2014 introduces enhancements to two common database maintenance operations namely Partition Switching and Online Index Rebuild which greatly increases enterprise application availability
 
  • Extending Memory to SSDs:  Seamlessly and transparently integrates solid-state storage into SQL Server by using SSDs as an extension to the database buffer pool, allowing more in-memory processing and reducing disk IO.
  • Buffer pool memory, which plays key role in storing data pages and in turn reducing the I/O demand
  • Easy Cloud migration - New cloud migration wizard to easily move on premises SQL Server to Windows Azure
  • Easy Integration with Excel - "GeoFlow" - richer insights with 3D Visualization , faster insights and predictive analytics with data mining add ins in Excel
 
Download Microsoft SQL Server 2014 Community Technology Preview 1 -
 
Looking forward to get hands on too....
 

Tuesday, October 30, 2012

Optimize the performance of Microsoft SQL Server environments


"Plan Explorer FREE and the launch of the new Plan Explorer PRO at 2012 Dev Connections in Las Vegas today, - will help for optimizing the performance of Microsoft SQL Server environments."

SQL Sentry Performance Advisor for
1. SQL Server delivers an advanced performance dashboard with relevant Windows and SQL Server metrics in a single view along with detailed insight of heavy SQL, blocking, deadlocks, and disk bottlenecks.

2. Analysis Services provides unparalleled insight into Analysis Services performance, including bottlenecks related to memory, storage systems, aggregation usage, queries and processing.
3. Event Manager is the ultimate scheduling, alerting and response system for managing SQL Server jobs, SharePoint jobs and other events that impact performance.

P.S: I do not recieve any compensation for writing or promoting these products but is merely interest...

Monday, September 26, 2011

How to create Silverlight applications using Expression Studio - basics and fun learning

Learn how to create Silverlight applications using Expression Studio and to apply user interface design principles with the toolbox integrated course. Learn practical techniques to master creating Silverlight applications using Expression studio.


http://www.microsoft.com/design/toolbox/


School learning and helpful for fun study projects -
http://www.microsoft.com/design/toolbox/school/


- Dipesh Joshi

Sunday, September 25, 2011

WCF Interview questions and answers (reference only, uuber level)

The intent to draft this list of questions is for learning purpose only and at very high level understanding of WCF services. This is not a dump :)

Question 1: What is the difference WCF and Web services?
Answer: -
Web services can only be invoked by HTTP. While Service or a WCF component can be invoked by any protocol and any transport type. Second web services are not flexible. However, Services are flexible. If you make a new version of the service then you need to just expose a new end. Therefore, services are agile and which is a very practical approach looking at the current business trends.
Question 2: What are different bindings supported by WCF?
Answer: -
WCF includes predefined bindings. They cover most of bindings widely needed in day-to-day application. However, just incase you find that you need to define something custom WCF does not stop you. So let us try to understand what each binding provides.
BasicHttpBinding: - This binding is used when we need to use SOAP over HTTP. This binding can also be configured to be used as HTTPS. It can be also configured to send data in plain text or in optimized form like MTOM.
WsHttpBinding: - It is same like BasicHttpBinding. In short, it uses SOAP over HTTP. But with it also supports reliable message transfer, security and transaction. WS-Reliable Messaging, security with WS-Security, and transactions with WS-Atomic Transaction supports reliable message.
NetTcpBinding: - This binding sends binary-encoded SOAP, including support for reliable message transfer, security, and transactions, directly over TCP. The biggest disadvantage of NetTcpBinding is that both server and client should be also made in .NET language.
NetMsmqBinding: - This binding sends binary-encoded SOAP over MSMQ. This binding can only be used for WCF-to-WCF communication.
NetNamedPipesBinding:-Ths binding Sends binary-encoded SOAP over named pipes. This binding is only usable for WCF-to-WCF communication between processes on the same Windows-based machine.

Note: - An interprocess control (IPC) protocol is used for exchanging information between two applications, possibly running on different computers in a network. The difference between Named pipes and TCP is that named pipes have good performance in terms of communication with in processes. But when it comes to communicate across network TCP holds the best choice. So if you are using WCF to communicate with process it’s the best choice to use in terms for performance. Named pipes do not perform when the traffic is heavy as compared to TCPIP.

Question 3: What are the main components of WCF?
Answer: -
We need to define three main components in WCF:-
• Service class. • Hosting environment • End point

Question 4: What are the various ways of hosting a WCF service?
Answer: -
There are three major ways to host a WCF service:-
• Self-hosting the service in his own application domain. This we have already covered in the first section. The service comes in to existence when you create the object of Service Host class and the service closes when you call the Close of the Service Host class.
• Host in application domain or process provided by IIS Server.
• Host in Application domain and process provided by WAS (Windows Activation Service) Server.

Question 5: What is a service level message and transport level message?
Answer: -
You can log WCF message at two levels one is service level and the other is transport level. Service level:-In this the messages are logged as they enter the user code or leave the user code. Transport level: - In this the messages are logged as they are ready to be encoded / decoded. All transport level, infrastructure messages and also reliable messaging is logged. You specify the message levels in the diagnostics node as shown in the below code snippet.

Question 6: For which bindings are transport, message and mixed mode supported?
Answer: -
Below is a table which shows for which binding which mode is supported. We did not discuss the mixed mode. It’s nothing but combination of transport and mixed mode. For instance data encrypted and passed over WsHttp using HTTPS is a mixed mode of security. Encryption is nothing but message security and HTTPS is a transport mode. In a combination they form mixed mode.

Question 7: Which bindings in WCF support the message streaming?
Answer: -
Following bindings supports the streaming in WCF:
1. basicHttpBinding 2. netTcpBinding 3. netNamedPipeBinding

Question 8: What are the various ways of hosting a WCF Service?
Answer: - 1.IIS 2.Self Hosting 3.WAS (Windows Activation Service)

Question 9: What is the use of ServiceBehavior attribute in WCF ?
Answer: -
ServiceBehaviour attribute is used to specify the InstanceContextMode for the WCF Service class (This can be used to maintained a state of the service or a client too).

There are three instance Context Mode in the WFC PerSession : This is used to create a new instance for a service and the same instance is used for all method for a particular client. (eg: State can be maintained per session by declaring a variable) PerCall : This is used to create a new instance for every call from the client whether same client or different. (eg: No state can be maintained as every time a new instance of the service is created) Single : This is used to create only one instance of the service and the same instance is used for all the client request. (eg: Global state can be maintained but this will be applicable for all clients)

Question 10: How the concurrency mode is specified in WCF service?
Answer: - The concurrency mode is specified using the ServiceBehavior attribute on the class that implements the service. Ex. [ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Single)] Public class ServiceClass : IServiceInterface{ //Implementation Code } There are 3 possible values of ConcurrencyMode enumeration Single Reentrant Multiple.

Question 11: hat the different transaction options ?
Answer:-

We can specify transaction in 3 ways in WCF:-
TransactionFlowOption.NotAllowed This is a default option. Using this option no transaction will be propagated across the binding. If any client attempts to call the WCF service in a transaction it will be ignored for this option. This option specifies that client can call this WCF service in a transaction. It’s not compulsory that the service needs to be called in a transaction. You can call without the transaction also. TransactionFlowOption.Mandatory This option specifies that client must call the WCF service in a transaction mode. If the WCF service is called without transaction, ‘FaultException’ will be raised.

Question 12: Wat are the advantages of hosting WCF Services in IIS as compared to self-hosting?
Answer: - There are two main advantages of using IIS over self-hosting:-


Automatic activation IIS provides automatic activation that means the service is not necessary to be running in advance. When any message is received by the service it then launches and fulfills the request. But in case of self hosting the service should always be running.
Process recycling If IIS finds that a service is not healthy that means if it has memory leaks etc, IIS recycles the process. Ok let us try to understand what is recycling in IIS process. For every browser instance, a worker process is spawned and the request is serviced. When the browser disconnects the worker, process stops and you loose all information. IIS also restarts the worker process. By default, the worker process is recycled at around 120 minutes. So why does IIS recycle. By restarting the worker process it ensures any bad code or memory leak do not cause issue to the whole system. In case of self-hosting both the above features, you will need to code yourself.

Question 13: What is trace listener?

Answer - ‘Tracelistener’ are objects that get tracing information from the trace class and they output the data to some medium. For instance you can see from the figure ‘TraceListener’ how it listens to the trace object and outputs the same to UI, File or a windows event log. There are three different types of ‘tracelistener’ first is the ‘defaulttracelistener’ (this outputs the data to UI), second is ‘textwritertracelistener’ (this outputs to a file) and the final one is ‘Eventlogtracelistener’ which outputs the same to a windows event log.

Question 14: What is service host factory in WCF?
Answer-

1. Service host factory is the mechanism by which we can create the instances of service host dynamically as the request comes in.
2. This is useful when we need to implement the event handlers for opening and closing the service.
3. WCF provides ServiceFactory class for this purpose.

Question 15: What are the advantages of hosting WCF service in WAS?

Answer- WAS (Windows Activation Service) is a component of IIS 7.0. Following are few advantages : 1. We are not only limited to HTTP protocol. We can also use supported protocols like TCP, named pipes and MSMQ 2. No need to completely install IIS. We can only install WAS component and keep away the WebServer.

Question 16: In WCF which bindings supports the reliable session?

Answer- In WCF, following bindings supports the reliable session - 1. wsHttpBinding 2. wsDualHttpBinding 3. wsFederationHttpBinding 4. netTcpBinding

Reference - Prasham on dotnetfunda.com and Pro WCF: Practical Microsoft SOA Implementation -- Chris and Denis Mulder – Apress 2007.

- DJ

Friday, September 09, 2011

How to add diagnostics/troubleshooting for your applications hosted on Cloud/Azure?

Guide to implement Azure diagnostics simple yet powerful: http://msdn.microsoft.com/en-us/library/gg433052.aspx

-DJ

How to generate barcode from string in SSRS reports and PDF?

I stumbled upon this great article which I would like to point to you if you are looking for a solution on how to generate barcodes (Code 39 and 128) in SQL server reports with 2008 R2. There seems to be an existing issue with Code 128 testing in PDF (10v) but works fine in SSRS/reports.

There are free tools like Z Barcode reader (iphone) but can be used for testing the generated bar code.
Barcode reader free test Tool -

Here is the article in detail - http://www.ssrstips.com/free-reporting-services-barcodes

Also find John's blog useful here - http://www.jtbarton.com/Barcodes/Code39.aspx
You can also download the code demo here: Reporting Services Free Barcodes Demo

Here is the knowledge base article as well that explains how to install font files on your machine for the barcodes to read correctly - http://support.microsoft.com/kb/314960

Sweet, I am going to find some time to get my thumbs down on this pretty soon :) will share more learnings as I discover! - DJ

Monday, September 05, 2011

Lapping around SQL Azure - Migrating SQL server database to SQL Azure

Migrating SQL 2008 on premise/in network/local database to SQL Azure platform turns to be very straight forward and easy. Microsoft has done an excellent job in enabling developers to use SQL server management studio (SSMS) and Visual Studio 2010 tools for the migration effort.

Here are few helpful links that would help enable the SQL migration to Azure/cloud.

SQL Azure Videos: http://www.microsoft.com/en-us/sqlazure/videos.aspx SQL Azure
Tools and Labs: http://www.microsoft.com/en-us/sqlazure/tools-labs.aspx SQL Azure Migration
SQL server schema and data migration wizard (open source and free): http://sqlazuremw.codeplex.com/

Alternate options to migrate SQL schema and data is also - Writing SSIS packages

Wednesday, October 20, 2010

Different ranking functions in SQL Server 2005 and 2008 and strategy to remove duplicate records in ETL type apps

Quick glance of different ranking functions that we can use in SQL Server -

Ranking functions return a ranking value for each row in a partition. Depending on the function that is used, some rows might receive the same value as other rows. Ranking functions are nondeterministic.

SQL Server introduced four different ranking functions to rank the rows in partition or in general -
1 RANK
2 NTILE
3 DENSE_RANK
4 ROW_NUMBER

http://msdn.microsoft.com/en-us/library/ms189798.aspx

Example on different strategies to remove duplicate records in SQL server in a typical ETL OR OLTP type applications -

http://www.mssqltips.com/tip.asp?tip=1952

http://www.mssqltips.com/tip.asp?tip=1918

Thanks - D

Typical Sync up of tables scenario in ETL type projects

If you are faced by a scenario where you typically have to sync up 2 tables by comparing source, destination most of the times and writing Insert, Delete and Update statements to achieve that, SQL Server 2008 introduces MERGE feature which is very powerful and fairly easy to achieve such sync up issues quick.

Example - Products dimension table has information about the products; you need to sync-up this table with the latest information about the products from the source table. You would need to write separate INSERT, UPDATE and DELETE statements to refresh the target table with an updated product list or do lookups. Though it seems to be straight forward at first glance, but it becomes cumbersome when you have do it very often or on multiple tables, even the performance degrades significantly with this approach. In the article below the author walks you through how to use the MERGE statement and do this in one pass. :)

USE - The MERGE statement basically merges data from a source result set to a target table based on a condition that you specify and if the data from the source already exists in the target or not. The new SQL command combines the sequence of conditional INSERT, UPDATE and DELETE commands in a single atomic statement, depending on the existence of a record. The new MERGE SQL command looks like as below:


SYNTAX - MERGE [AS TARGET]
USING [AS SOURCE]
ON
[WHEN MATCHED
THEN ]
[WHEN NOT MATCHED [BY TARGET]
THEN ]
[WHEN NOT MATCHED BY SOURCE
THEN ];


Nice and easy article for quick reference on MERGE - http://www.mssqltips.com/tip.asp?tip=1704

Thanks - D

Use of "Coalesce" in SQL Server 2008

Use of "Coalesce" in SQL Server - efficent way to script and avoid mutiple Case statements and ISNULL.

COALESCE - Returns the first nonnull expression among its arguments.

Syntax
COALESCE ( expression [ ,...n ] )

Arguments
expression - Is an expression of any type.

n - Is a placeholder indicating that multiple expressions can be specified. All expressions must be of the same type or must be implicitly convertible to the same type.

Return Types - Returns the same value as expression.

Remarks - If all arguments are NULL, COALESCE returns NULL.

COALESCE(expression1,...n) is equivalent to this CASE function:

CASE
WHEN (expression1 IS NOT NULL) THEN expression1
...
WHEN (expressionN IS NOT NULL) THEN expressionN
ELSE NULL

Simple real life example from MSDN - http://msdn.microsoft.com/en-us/library/aa258244(SQL.80).aspx

Other many uses as well - http://www.mssqltips.com/tip.asp?tip=1521

(Fav one from this article = was to KILL all transactions forecfully that are locked and needed to be released before restoring the database -

------------------------------------------
DECLARE @SQL VARCHAR(8000)

SELECT @SQL=COALESCE(@SQL,'')+'Kill '+CAST(spid AS VARCHAR(10))+ '; '
FROM sys.sysprocesses
WHERE DBID=DB_ID('AdventureWorks')

PRINT @SQL --EXEC(@SQL)

Replace the print statement with exec to execute will give you a result set such as the following.
-----------------------------------------------

Thanks - D

Tuesday, May 20, 2008

Designing and working with Spatial data type in SQL 2008

One of the interesting feature of SQL 2008 that had my eye balls rolling was the introduction of Spatial data type/Column.

SQL Server 2008 and later versions support spatial data. This includes support for a planar spatial data type, geometry, which supports geometric data—points, lines, and polygons—within a Euclidean coordinate system. The geography data type represents geographic objects on an area on the Earth's surface, such as a spread of land. A spatial index on a geography column maps the geographic data to a two-dimensional, non-Euclidean space.

A spatial index is defined on a table column that contains spatial data (a spatial column). Each spatial index refers to a finite space. For example, an index for a geometry column refers to a user-specified rectangular area on a plane.

Here's more to it on msdn - http://msdn.microsoft.com/en-us/library/bb964712(SQL.100).aspx

Here's all that you wanted to know on designing and working with Spatial data type in SQL 2008 - http://msdn.microsoft.com/en-us/library/bb933790(SQL.100).aspx