Assessment Tool for Microsoft Business Intelligence from Microsoft
The assessment tool can be used to compare your infrastructure against industry best practices and the latest IT research. For more information please visit below location.
The assessment tool can be used to compare your infrastructure against industry best practices and the latest IT research. For more information please visit below location.
About Temporary Tables in SQL Server 2005
Let’s look at a simple example.
–Temporary Table Example
/*
Please execute as a batch. Since this will be executed in a SQL Query Browser (Analyzer) temporary table will be available till the session exists. So you might get error if you create table with the same name again in the same session.Because the table already exists.
you can also drop temporary table..Follow the below example
*/
–Create Temporary Table
CREATE TABLE #Temp1 (Empno int PRIMARY KEY)
–Inserting row into a temporary table
INSERT INTO #Temp1 VALUES (1001)
–Select rows from Temporary Table
SELECT * FROM #Temp1
–Insert rows from other Table
INSERT INTO #Temp1 SELECT EMPNO from Test
–Select rows from Temporary Table
SELECT * FROM #Temp1
–Using Temporary Table in a stored procedure
CREATE PROCEDURE TempTableTest (@NewEmpNo int)
AS
SET NOCOUNT ON
BEGIN
–Create new Temporary Table
CREATE TABLE #Temp2 (Empno int PRIMARY KEY)
–Insert new Record
INSERT INTO #Temp2 VALUES (@NewEmpNo)
–Display new Inserted Record
SELECT * FROM #Temp2
END
EXEC TempTableTest 2
Result
Happy Learning..I will be posting few more articles on Temporary Tables
A list of the bugs that are fixed in SQL Server 2005 Service Pack 2
http://support.microsoft.com/default.aspx?scid=kb;en-us;921896
Thanks for visiting my blog….
I have created this blog to share my ideas, experience and resources on SQL Server. Over a period of time I will be posting articles on SQL Server 2005, SQL Server 2008, Interview Questions, Microsoft SQL Server 2005 Business Intelligence (SSIS,SSAS,SSRS, Office PerformancePoint Server) and many other resources related to SQL Server.
Thank You and have a great year ahead…
Harsh Shah
(Sr. Consultant – Database and Business Intelligence)
Recent Comments