<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" >
   <channel>
    <atom:link href="https://satmd.webnode.page/rss/sql-notes.xml" rel="self" type="application/rss+xml" />
      <title><![CDATA[SQL Notes - satmd.webnode.page]]></title>
      <link>https://satmd.webnode.page</link>
      <language>en</language>
      <pubDate>Fri, 19 Oct 2012 18:04:00 +0200</pubDate>
      <lastBuildDate>Fri, 19 Oct 2012 18:04:00 +0200</lastBuildDate>
      <category><![CDATA[SQL Notes]]></category>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs>
      <generator>Webnode</generator>
      <item>
         <title><![CDATA[how to List of Dates by given month and date]]></title>
         <link>https://satmd.webnode.page/news/how-to-list-of-dates-by-given-month-and-date/</link>
         <description><![CDATA[
	&nbsp;

	&nbsp;

	--SELECT dbo.Fn_HowManyDays_Month('February','2012') AS [Days]

	&nbsp;

	ALTER FUNCTION dbo.Fn_HowManyDays_Month

	(

	@Month VARCHAR(15),

	@Year VARCHAR(10)

	)&nbsp;

	RETURNS INT

	&nbsp;

	AS

	BEGIN

	&nbsp;

	DECLARE @Date VARCHAR(50),

	@Days TINYINT

	&nbsp;

	SELECT @Date = @Year+'-'+ @Month + '-01',&nbsp;

	@Days = DatePart(Day,DateAdd(Month,1,@Date) -1)

	&nbsp;

	RETURN @Days

	&nbsp;

	END

	------------------------------------------------------

	
		--EXEC...]]></description>
         <pubDate>Fri, 19 Oct 2012 18:04:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/how-to-list-of-dates-by-given-month-and-date/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[how to get count of given date name in that month]]></title>
         <link>https://satmd.webnode.page/news/how-to-get-count-of-given-date-name-in-that-month/</link>
         <description><![CDATA[
	&nbsp;

	
		&nbsp;
	
		--SELECT dbo.Fn_HowManyDays_Month('February','2012') AS [Days]
	
		&nbsp;
	
		ALTER FUNCTION dbo.Fn_HowManyDays_Month
	
		(
	
		@Month VARCHAR(15),
	
		@Year VARCHAR(10)
	
		)&nbsp;
	
		RETURNS INT
	
		&nbsp;
	
		AS
	
		BEGIN
	
		&nbsp;
	
		DECLARE @Date VARCHAR(50),
	
		@Days TINYINT
	
		&nbsp;
	
		SELECT @Date = @Year+'-'+ @Month + '-01',&nbsp;
	
		@Days = DatePart(Day,DateAdd(Month,1,@Date) -1)
	
		&nbsp;
	
		RETURN...]]></description>
         <pubDate>Fri, 19 Oct 2012 18:02:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/how-to-get-count-of-given-date-name-in-that-month/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[How to find total no of days count in given month]]></title>
         <link>https://satmd.webnode.page/news/how-to-find-total-no-of-days-count-in-given-month/</link>
         <description><![CDATA[
	&nbsp;

	&nbsp;

	--SELECT dbo.Fn_HowManyDays_Month('February','2012') AS [Days]

	&nbsp;

	ALTER FUNCTION dbo.Fn_HowManyDays_Month

	(

	@Month VARCHAR(15),

	@Year VARCHAR(10)

	)&nbsp;

	RETURNS INT

	&nbsp;

	AS

	BEGIN

	&nbsp;

	DECLARE @Date VARCHAR(50),

	@Days TINYINT

	&nbsp;

	SELECT @Date = @Year+'-'+ @Month + '-01',&nbsp;

	@Days = DatePart(Day,DateAdd(Month,1,@Date) -1)

	&nbsp;

	RETURN @Days

	&nbsp;

	END

	&nbsp;
]]></description>
         <pubDate>Fri, 19 Oct 2012 18:01:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/how-to-find-total-no-of-days-count-in-given-month/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Join Examples]]></title>
         <link>https://satmd.webnode.page/news/join-examples/</link>
         <description><![CDATA[
	&nbsp;

	USE deva

	GO

	&nbsp;

	CREATE TABLE table1

	(ID INT, Value VARCHAR(10))

	INSERT INTO Table1 (ID, Value)

	SELECT 1,'First'

	UNION ALL

	SELECT 2,'Second'

	UNION ALL

	SELECT 3,'Third'

	UNION ALL

	SELECT 4,'Fourth'

	UNION ALL

	SELECT 5,'Fifth'

	GO

	&nbsp;

	CREATE TABLE table2

	(ID INT, Value VARCHAR(10))

	INSERT INTO Table2 (ID, Value)

	SELECT 1,'First'

	UNION ALL

	SELECT 2,'Second'

	UNION ALL

	SELECT 3,'Third'

	UNION ALL

	SELECT 6,'Sixth'

	UNION ALL

	SELECT...]]></description>
         <pubDate>Thu, 12 Apr 2012 11:19:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/join-examples/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Joins in sql]]></title>
         <link>https://satmd.webnode.page/news/joins-in-sql/</link>
         <description><![CDATA[
	http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/
]]></description>
         <pubDate>Wed, 11 Apr 2012 19:19:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/joins-in-sql/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Insert values into the table]]></title>
         <link>https://satmd.webnode.page/news/insert-values-into-the-table/</link>
         <description><![CDATA[  TABLE [dbo].[TRAINING]  int IDENTITY(1,1) NOT NULL,varchar(50) NULL,text NULL,char(1) NULL,varchar(8) NULL CONSTRAINT [DF_TRAINING_DISPLAY_STATUS] DEFAULT ('ACTIVE'),CONSTRAINT [PK_TRAINING] PRIMARY KEY([TRAINING_ID]) TABLE [dbo].[PARENT_GUARDIAN]  int IDENTITY(150,1) NOT NULL,nvarchar(25) NOT NULL,nvarchar(25) NOT NULL,CONSTRAINT [PK_PARENT_GUARDIAN] PRIMARY KEY([PG_ID]) TABLE [dbo].[xref_PG_TRAINING]  int NOT NULL,int NOT NULL,datetime NOT NULL  INTO PARENT_GUARDIAN (PG_FNAME, PG_LNAME)...]]></description>
         <pubDate>Thu, 16 Jun 2011 11:12:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/insert-values-into-the-table/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Trigger]]></title>
         <link>https://satmd.webnode.page/news/trigger1/</link>
         <description><![CDATA[Create trigger T_EmpDetails on TblEmpDetails
--INSTEAD OF UPDATE,INSERT,DELETE
AFTER UPDATE,INSERT,DELETE
AS
BEGIN--[

&#160;&#160;&#160; &#160;&#160;&#160; insert dbo.TblEmpDetailsBak
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; (
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;...]]></description>
         <pubDate>Tue, 24 May 2011 13:39:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/trigger1/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Stored Procedure Calculation]]></title>
         <link>https://satmd.webnode.page/news/stored-procedure-calculation1/</link>
         <description><![CDATA[
/*
&#160;&#160;&#160; &#160;&#160;&#160; Created By : Shankar Karuppanna Gounder
&#160;&#160;&#160; &#160;&#160;&#160; Created On : 16.06.2010
&#160;&#160;&#160; &#160;&#160;&#160; Mail Id&#160;&#160;&#160; : shakar_ct@yahoo.co.in
&#160;&#160;&#160; &#160;&#160;&#160; Contact&#160;&#160;&#160; &#160;&#160; : 09865353972
&#160;&#160;&#160; &#160;&#160;&#160; Description:Newly Created.

*/

USE KCTSHAN
GO
CREATE TABLE dbo.TblEmpmasterDetails
(
&#160;&#160;&#160; &#160;&#160;&#160;...]]></description>
         <pubDate>Tue, 24 May 2011 13:38:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/stored-procedure-calculation1/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Transaction]]></title>
         <link>https://satmd.webnode.page/news/transaction/</link>
         <description><![CDATA[select&#160;&#160;&#160; *
from&#160;&#160;&#160; TblEmpDetails(nolock)

select&#160;&#160;&#160; *
from&#160;&#160;&#160; TblEmpDetails

delete&#160; from TblEmpDetails
where&#160; EmpName='mahesh'


update TblEmpDetails Set Address='Pondy' where empId='emp106'

BEGIN TRANSACTION SHAN05
&#160;&#160;&#160; BEGIN TRANSACTION SHAN04
&#160;&#160;&#160; COMMIT TRANSACTION SHAN04
ROLLBACK TRANSACTION SHAN05
&#160;&#160;&#160; &#160;&#160;&#160; 

sp_depends TblEmpDetails]]></description>
         <pubDate>Tue, 24 May 2011 13:38:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/transaction/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
      <item>
         <title><![CDATA[Temporary Table]]></title>
         <link>https://satmd.webnode.page/news/temporary-table/</link>
         <description><![CDATA[Temporary Tables:-
-----------------

CREATE PROCEDURE TempTbl
AS
BEGIN

&#160;&#160;&#160; &#160;&#160;&#160;&#160; --drop table #EmpTemp
&#160;&#160;&#160; &#160;&#160;&#160; --drop table ##EmpTemp1

--Temporary Table
&#160;&#160;&#160; &#160;&#160;&#160; CREATE TABLE #EmpTemp
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; (
&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; EmpId&#160;&#160;&#160; &#160;varchar(100),
&#160;&#160;&#160; &#160;&#160;&#160;...]]></description>
         <pubDate>Tue, 24 May 2011 13:37:00 +0200</pubDate>
         <guid isPermaLink="true">https://satmd.webnode.page/news/temporary-table/</guid>
         <category><![CDATA[SQL Notes]]></category>
      </item>
   </channel>
</rss>