Examples of TI-Nspire calculators, TI-Nspire CAS software, TI-84 Plus C Silver Edition
Nspire
Category:Texas Instruments programs
Category:Calculators
calculators
Category:Handheld_computing
Category:Digital_calculators
Category:Mainframe computers
Category:History of TexasQ:
One time data - SQL Server 2005
I need to insert data once in database, not more.
I would like to store a value of a boolean or a date or a string - it doesn't matter. The idea is to store the data, access it and then never see it again.
Is it possible? Is there a 'data table' where I can store it?
A:
You can use a table variable.
declare @bool_var bit = 1
insert into @bool_var values (0)
insert into @bool_var values (1)
declare @date_var date = getdate()
insert into @date_var values (getdate())
declare @string_var varchar(100) = 'Hello'
insert into @string_var values (convert(varchar(100),'World'))
declare @bool_table table
(
bool_id int,
bool_val bit
)
insert into @bool_table values (1,1)
insert into @bool_table values (2,0)
insert into @bool_table values (3,0)
insert into @bool_table
select
@bool_id as bool_id,
bool_val
from @bool_table
select * from @bool_table
drop table @bool_table
In SQL Server 2012, the table-valued variables cannot be used.
There are two types of table-valued variables. Scalar variables are
defined as
follows:
CREATE TABLE Table1(
int_col INT,
float_col FLOAT,
char_col CHAR(5),
varchar_col VARCHAR(5),
datetime_col be359ba680
Related links:
Comments