functions,stored procedures, etc. One of the ways to run T-SQL statements is to connect to an instance of theSQL Server Database Engineand execute code inSQL Server Management Studio
In the 1st part of this post, I explained how to create a partitioned table using a partition function as well as a partition schema. Now I’ll continue talking about how to merge or split partitions changing the partition function and the partition schema and...
The INSERT INTO statement is used to insert single or multiple records into a table in the SQL Server database. Syntax: INSERT INTO table_name(column_name1, column_name2...) VALUES(column1_value, column2_value...); Here, we will insert data into the following Employee table which we ...
SET @SQL = @SQL + ' INNER JOIN ' + @SourceDB + '.sys.Types ST ON SC.system_type_id = ST.system_type_id WHERE object_id = object_id(@SourceTable) ' SET @SQL = @SQL + ' AND ST.Name NOT IN (''xml'',''Text'',''Image'',''Geometry'',''Geography'')' EXEC sp_exe...
SQL> SELECT TABLE1.X, TABLE2.X 2* FROM TABLE1, TABLE2; X X - - A A B A C A D A A B B B C B D B A C B C C C D C A D B D C D D D 16 rows selected. CAUTION Be careful to always join all tables in a query. If two tables in a query have not been joine...
The other day I was wondering about how to use Pivot tables in SQL Server with SQL, and I didn’t find any simple examples on this. So I had to do my own and I thought I’d share this here and also as to have as a future reference for myself. ...
In my next post, I'll take a look at how SQL Server 2008 handles scans and seeks on partitioned indexes. USE TestDB GO -- Step 1: Create the partition function(s) CREATE PARTITION FUNCTION fnPartitionId (INT) AS RANGE LEFT FOR VALUES (1400, 2800, 4200, 5600) ...
I’m trying to use a temp table in an SSIS package. It seems like everything is working correctly until I try to query the temp table. What am I doing wrong? Solution Creating temp tables in SSIS seems like a straight-forward process using the Execute SQL Task, however there are a co...
SQL Server Usage Tables in SQL Server are created using theCREATE TABLEstatement and conform to the ANSI and ISO entry level standard. The basic features ofCREATE TABLEare similar for most relational database management engines and are well defined in the ANSI and ISO ...
Partitioned Tables in SQL Server 2005 Definitions and Terminology Range Partitions Defining the Partitioning Key Index Partitioning Special Conditions for Partitions: Split, Merge, and Switch Steps for Creating Partitioned Tables Determine If Object Should Be Partitioned Determine Partitioning Key and Number...