Thursday, 17 November 2016

Table Valued Functions in Sql


What are Table Valued Functions in Sql ?


There are two types of “User Defined” fucntions in sql server
  1. scalar function ( that returns single value in response to function call )
     2. inline table valued ( that returns function result in tabulated form but query can single lined e.g.

     3. return (select * from table_name).

1. Inline Table Valued Functions
If function is made to execute a select query with or without parameters and return result as table type it comes in category of Inline table valued functions.
Sql Code Example -


CREATE FUNCTION GetAuthorsByState( @state char(2) )
RETURNS table AS
RETURN (SELECT au_fname, au_lname FROM Authors WHERE state=@state)
GO


2. Multi-statement table valued Functions

Multi-statement table valued that returns function result in tabulated form but query may have multiple statements that can make changes to query and return the tabulated data.

If functions is made to execute multiple sql statements including insert, update statements etc and return result as table type then it comes in category of Multistatement table valued functions

Example

CREATE FUNCTION GetAuthorsByState( @state char(2) )
RETURNS
@AuthorsByState table (
au_id Varchar(11),
au_fname Varchar(20)
)
AS
BEGIN
INSERT INTO @AuthorsByState
SELECT au_id,au_fname FROM Authors WHERE state = @state
IF @@ROWCOUNT = 0
BEGIN
INSERT INTO @AuthorsByState VALUES ('','No Authors Found')
END
RETURN
END
GO

Wednesday, 16 November 2016

Google Joined .NET Foundation



Its great news by microsoft that google joined .net foundation. Recently Samsung also joined .Net foundation for Tizen platform. Apart from everything its great that all tech companies are working collectively to make good environment for innovation.

This Move of Big companies also gives inspiration to many developers working in different technologies to come and work together in a team. They have shown an example of working in a team that will empower and motivate many others in future and present.



Google is now a member of the .NET Foundation, where it joins the likes of Red Hat, Unity, Samsung  Jet-brains and (of course) Microsoft in the Technical Steering Group.

Google already allows developers on its Cloud Platform to deploy .NET applications

Samsung, too, is deepening its commitment to .NET by launching support for it on its Tizen platform. As Samsung’s Hong-Seok Kim told me, Samsung was looking for a framework in addition to the web framework and C API that Tizen developers currently use to write their applications.

SQL Server Public Preview available on Ubuntu





Microsoft has just announced its public preview of the next release of SQL Server, and Canonical is delighted to announce that this preview is available for Ubuntu.

Moreover, with SQL Server on Ubuntu, there are significant cost savings, performance improvements, and the ability to scale & deploy additional storage and compute resources easier without adding more hardware.

Read Complete Details Here -

Full Article details Sql Server Public Preview Available on Ubuntu

Download Sql Server on Linux 


Visual studio for mac is released



Very Nice Move from microsoft and cheers for Mac Users. Microsoft launched Visual studio preview for Mac .you can enjoy using dotnet development on mac platform now. Microsoft released Visual Studio for Mac it is currently in preview and still work is in progress for several tools. check download link below -

Tuesday, 8 November 2016

No assembly found containing an OwinStartupAttribute



The Common scenario that one of student got was during creating signalr project from empty web project. so i would like to spread it online with others. you may have see Error Screen as shown in below Screenshots -

Error : No assembly found containing an OwinStartupAttribute.
           No assembly found containing a Startup or [AssemblyName].Starup class.

         
No Assembly found containing an OwinStartupAttribute Error


Solution For error : Simple straightforward solution is to Add Below code ( as shown in below screenshot ) in web.config under <configuration> tag as shown in image below. you error will be
gone

line of Code to Add is written below and also shown written in Screenshot below

<appSettings>
    <add key="owin:AutomaticAppStartup" value="false" />
  </appSettings>