Posts

Showing posts from January, 2012

Store proc

Overview A stored procedure is nothing more than prepared SQL code that you save so you can reuse the code over and over again. So if you think about a query that you write over and over again, instead of having to write that query each time you would save it as a stored procedure and then just call the stored procedure to execute the SQL code that you saved as part of the stored procedure. In addition to running the same SQL code over and over again you also have the ability to pass parameters to the stored procedure, so depending on what the need is the stored procedure can act accordingly based on the parameter values that were passed. CREATE PROCEDURE sp_name AS SELECT * FROM AdventureWorks.Person.Address GO EXEC sp_name input parameter@@@ CREATE PROCEDURE sp_name @City nvarchar(30) AS SELECT * FROM AdventureWorks.Person.Address WHERE City = @City GO EXEC sp_name @City = 'Delhi' default parameter:--- CREATE PROCEDURE Sp_name @City nvarchar(30) = NULL AS SEL

create a table

USE [MSSQLTIPS] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TipCategories]( [Category_ID] [int] IDENTITY(1,1) NOT NULL, [Category_Desc] [varchar](200) NOT NULL, [InActive] [nchar](10) NOT NULL, [CreatedBy] [varchar](50) NULL, [DateCreated] [datetime] NULL, [DateUpdated] [datetime] NULL, [UpdatedBy] [varchar](50) NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO

useful site link

Books Americabookshelf.com – One of the largest book exchange clubs across the US. BooksConnect – A book sharing community site connecting readers, authors, publishers, librarians and booksellers. BookCrossing.com – A community of users from over 130 countries who exchange books with each other at public places like cafes, parks etc. Bookhopper.co.uk – Free community for UK residents to share used books with each other. Bookins.com – Book sharing website that enables members to exchange used books with each other in real time. BookMooch.com – An interesting concept where users can exchange books with others through points. Users gain points when they give books to others. Booksalescout.com – Online community of users allowing them to sell books in the US. Bookswim.com – Book borrowing service with free shipping for registered website. ConnectViaBooks – A social networking site connecting book lovers and enabling them to discover other similar in