declare @t table
DECLARE @t TABLE(date char(21))
INSERT @t SELECT '1900-1-1 00:00:00.000'
INSERT @t SELECT '1900-1-1 00:00:00.001'
INSERT @t SELECT '1900-1-1 00:00:00.009'
INSERT @t SELECT '1900-1-1 00:00:00.002'
INSERT @t SELECT '1900-1-1 00:00:00.003'
INSERT @t SELECT '1900-1-1 00:00:00.004'
INSERT @t SELECT '1900-1-1 00:00:00.005'
INSERT @t SELECT '1900-1-1 00:00:00.006'
INSERT @t SELECT '1900-1-1 00:00:00.007'
INSERT @t SELECT '1900-1-1 00:00:00.008'
SELECT date,转换后的日期=CAST(date as datetime) FROM @t
DECLARE @t TABLE(date char(21)) --定義一個表 @t,含有一列date ,char型,長度21
INSERT @t SELECT '1900-1-1 00:00:00.000' --把'1900-1-1 00:00:00.000'插入到@t
DECLARE @t TABLE(date char(21))创建一个名称为t的临时表变量,和表一样,只是在内存上创建的,而不是在硬盘上创建的,速度快.参见declare帮助.
INSERT @t SELECT '1900-1-1 00:00:00.000'向临时表变量中插入值,等价于insert @t(date) values(''1900-1-1 00:00:00.000').参见insert帮助.
declare @t table的更多相关文章
- (转)create table #temptable 临时表 和 declare @bianliang table ()表变量
在开发过程中,经常会遇到使用表变量和本地临时表的情况.下面是对二者的一个介绍: 1. 为什么要使用表变量 表变量是从2000开始引入的,微软认为与本地临时表相比,表变量具有如下优点: a.与其他变量 ...
- SQL Server中的临时表和表变量 Declare @Tablename Table
在SQL Server的性能调优中,有一个不可比面的问题:那就是如何在一段需要长时间的代码或被频繁调用的代码中处理临时数据集?表变量和临时表是两种选择.记得在给一家国内首屈一指的海运公司作SQL Se ...
- create table #temptable 临时表 和 declare @bianliang table ()表变量
create table #temptable 临时表 和 declare @bianliang table ()表变量 在开发过程中,经常会遇到使用表变量和本地临时表的情况.下面是对二者的一个介绍: ...
- T-SQL Recipes之 Table Variables and Temporary Tables
Problem 许多时候, 我们想要Table Variables在动态SQL中执行,但现实是很骨感的.比如这个示例: DECLARE @sql_command NVARCHAR(MAX); DECL ...
- SQL:将字符串以特定字符分割并返回Table
split 语法 ALTER FUNCTION [dbo].[F_SPLIT] ( @str VARCHAR(MAX) , ) ) /********************************* ...
- Declare Cusror of SQLServer
Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query ...
- SQLServer temporary table and table variable
Temporary tables are created in tempdb. The name "temporary" is slightly misleading, for ...
- 查询Table name, Column name, 拼接执行sql文本, 游标, 存储过程, 临时表
018_Proc_UpdateTranslations.sql: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO if (exists (select ...
- SqlServer存储过程传入Table参数
今天是周日,刚好有空闲时间整理一下这些天工作业务中遇到的问题. 有时候我们有这样一个需求,就是在后台中传过来一个IList<类>的泛型集合数据,该集合是某个类的实例集合体,然后将该集合中的 ...
随机推荐
- C# web server的开发流程
http://blog.csdn.net/h0322/article/details/4776819
- R 语言词云wordcloud
来源:http://blog.chinaunix.net/uid-25135004-id-4311592.html wordcloud函数--用于绘制词云图 用法: wordcloud(words,f ...
- 天梯L2-003-测试点
测试点3无法过,题目说是正整数用了int,结果得用double输入才能AC.
- First Missing Positive -- LeetCode
Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] ...
- JavaEE目录
第一章: Spring介绍 Spring项目搭建 Spring概念 第二章: Sprin配置详解 属性注入(构造方法注入,设值注入) 实例化(构造器(空参构造器),静态工厂,工厂方法) 装配(xml方 ...
- 深入分析GCC 与 编绎系统透视
- sql索引从入门到精通(十亿行数据测试报告)
原文:sql索引从入门到精通(十亿行数据测试报告) 导读部分 --------------------------------------------------------------------- ...
- NoHttp详解之NoHttp最基本使用(无封装)
NoHttp详细使用文档,请点我移步! 这里是一个最基本的使用,在项目中也可以直接这样使用,如果想学习更多请移步NoHttp主页: https://github.com/yanzhenjie/NoHt ...
- apache只记录指定URI的日志
我的需求是,把类似请求 www.aaa.com/aaa/... 这样的请求才记录日志.在httpd.conf 或者 相关的虚拟主机配置文件中添加SetEnvIf Request_URI "^ ...
- IE常见BUG总结(持续更新)
ie6~7下display:inline-block无效 解决方案:需要hack触发hasLayout 1 //IE6.7中内联元素(如span)触发layout属性后, 它的行为和标准中的 inli ...