DECLARE @t1 DATETIME;
DECLARE @t2 DATETIME;
SET @t1 = GETDATE();
/* Put here the query to measure */;
SET @t2 = GETDATE();
SELECT DATEDIFF(millisecond,@t1,@t2) AS elapsed_ms;
The simple answer is yes you can. Let look at a simple CREATE TABLE statement:
CREATE TABLE #Yaks ( YakID int, YakName char(30) )
tempdb. If you run this query:
CREATE TABLE #Yaks ( YakID int, YakName char(30) ) select name from tempdb..sysobjects where name like '#yak%' drop table #yaks
CREATE TABLE #TibetanYaks( YakID int, YakName char(30) ) INSERT INTO #TibetanYaks (YakID, YakName) SELECT YakID, YakName FROM dbo.Yaks WHERE YakType = 'Tibetan' -- Do some stuff with the table drop table #TibetanYaks
If you are using SQL Server 2000 or higher, you can take advantage of the new TABLE variable type. These are similar to temporary tables except with more flexibility and they always stay in memory. The code above using a table variable might look like this:
DECLARE @TibetanYaks TABLE ( YakID int, YakName char(30) ) INSERT INTO @TibetanYaks (YakID, YakName) SELECT YakID, YakName FROM dbo.Yaks WHERE YakType = 'Tibetan' -- Do some stuff with the table
DECLARE @TibetanYaks TABLE ( YakID int, YakName char(30) ) INSERT INTO @TibetanYaks (YakID, YakName) SELECT YakID, YakName FROM dbo.Yaks WHERE YakType = 'Tibetan' UPDATE @TibetanYaks SET YakName = UPPER(YakName) SELECT * FROM @TibetanYaks
You can also create global temporary tables. These are named with two pound signs. For example,
##YakHerders is a global temporary table. Global temporary tables are visible to all SQL Server connections. When you create one of these, all the users can see it. These are rarely used in SQL Server.
That shows you an example of creating a temporary table, modifying it, and returning the values to the calling program. I hope this gives you what you were looking for.
a platform or marketplace for online learning
What Wikipedia has to say about UDemy:
Udemy.com is a platform or marketplace for online learning. Unlike academic MOOC programs driven by traditional collegiate coursework, Udemy provides a platform for experts of any kind to create courses which can be offered to the public, either at no charge or for a tuition fee.Udemy provides tools which enable users to create a course, promote it and earn money from student tuition charges.
In addition to SQL You will find there also the following tutorials:
Very good link for creating and managing every aspect of SQL Server database by Visual Studio IDE.
Microsoft SQL Server Analysis Services, SSAS, is an online analytical processing (OLAP) and data mining tool inMicrosoft SQL Server. SSAS is used as a tool by organizations to analyze and make sense of information possibly spread out across multiple databases, or in disparate tables or files. Microsoft has included a number of services in SQL Server related to business intelligence and data warehousing. These services include Integration Services, Reporting Services and Analysis Services. Analysis Services includes a group of OLAP and data mining capabilities and comes in two flavors – Multidimensional and Tabular (from wikipedia).
Learn SSAS: PDF, Videos and Demo files:
01. Download SSAS Tutorials PDF file from Microsoft 02. Adventure Works for SQL Server 2012 from CodePlex 03. SSAS 11 Videos of PCTeach.me: 04. http://pcteach.me/Series/microsoft-ssas/ 05. 6 Lessons of SSAS MDX 06. 7 Videos of SSAS MDX
SSAS Videos at PCTeach.me:
01. Analysis Services - 01 Prerequisite Guide 02. Analysis Services - 02 Data Source Creation 03. Analysis Services - 03 Data Source Views 04. Analysis Services - 04 Cube Creation 05. Analysis Services - 05 Dimension Fundamentals 06. Analysis Services - 06 Dimension Hierarchies 07. Analysis Services - 07 Dimension Attribute Relationships 08. Analysis Services - 08 Dimension Storage 09. Analysis Services - 09 Dimension Discretization 10. Analysis Services - 10 Parent/Child Dimension Hierachies 11. Analysis Services - 11 Star and Snowflake Schemas
Here you will find all you need regarding MS SQL:
During the following Scripts, the following Databases will be used: 1. ACDB 2. hr_script 3. Northwind 4. AdventureWorks 2012 5. AdventureWorks 2014
DBA Database Design, Tables structure and indexing, T-SQL programming:
17 - Views (includes views with encryption)
Advanced Dynamic SQL Cursors - Solution DDL Additional Demo Divide Sample Merge Solution The 3 and 5 Divide Question The Find_A_Question The One Line Question The Salary Question