Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server: difference between hashtable and table declared using declare keyword

There are quite differences like below.
1. Declarations: Table variables are declared as normal variables with type as table and columns along with their datatype.
whereas hashtables are created just like the normal tables.
Eg. i) Table Variable:  Declare @tmpTable as Table(id Int, Name Varchar(500), Salary Decimal)
	ii) Hashtable: Create Table(id Int, Name Varchar(500), Salary Decimal);

2. Next differences are where they are stored like Table variables are in Memory and Hashtables in tempdb.
3. As Hashtables are just like normal tables you can use them in transactions whereas not the table variables.
4. You can create indexes on Hashtables but not on table variables except the primary key indexes.
5. It's best to use table variables when you have small to moderate data to handle because of their better performance, as they reside in the memory.
Comment

PREVIOUS NEXT
Code Example
Sql :: sql update table remove spaces 
Sql :: To count number of rows in SQL table 
Sql :: insert query return id mysql 
Sql :: tsql insert 
Sql :: postgres add column integer 
Sql :: execute mysql file 
Sql :: sql remove last 2 digit 
Sql :: mysql average of multiple columns 
Sql :: create table in mysql 
Sql :: how to get nearest location in mysql with latitude and longitude 
Sql :: amazon linux postgresql client 
Sql :: how to import large sql file in phpmyadmin in ubuntu 
Sql :: is between inclusive or exclusive sql 
Sql :: mysql set password for user 
Sql :: Assign value to var in SQL 
Sql :: postgres set column based on another column 
Sql :: drop df constraint sql server 
Sql :: How do I add a user to a postgres database? cli 
Sql :: select nextval from sequence sql 
Sql :: phpmyadmin change password 
Sql :: mysql utc timestamp 
Sql :: mysql count with if 
Sql :: Postgresql get diff between two dates in Months 
Sql :: check postgresql version in rails console 
Sql :: kill a pid redshift 
Sql :: 1) PostgreSQL DESCRIBE TABLE using psql 
Sql :: postgres create column with default value 
Sql :: in mysql workbench contnent not feching 
Sql :: sqlite save db 
Sql :: postgresql Create a new role with a username and password 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =