Microsoft SQL Server
instance / database / schema / object
login / user / schema (dbo)
sequence
Collation
PSM: Both Instance and DB need case insensitive
Windchill: Both Instance and DB as SQL_Latin1_General_CP1_CS_AS (Since 2012, it is Latin1_General_100_CS_AS_SC)
Cognos: DBs need case insensitive, can share same instance as Windchill
Upgrade:
- To 10.2 on SQL Server 2012 or 2014
- Upgrade firstly with SQL Server 2008 R2
- and then convert - https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS115367
- To 10.1 on SQL Server 2012
- Still use SQL_Latin1_General_CP1_CS_AS as before.
About Microsoft SQL Server Collation settings in Windchill
- Instance/Server Collation
- Database Collation
Instance/database
- Instance
- “Empty” means default Instance Name of MSSQLSERVER
- Can get from Service
- Or run query below –again NULL means default of MSSQLSERVER
SELECT SERVERPROPERTY('InstanceName')
Login/user/schema
- Here Instance > Security > login show the Instance Login
- Login user can access Instance/Server, but cannot access Database/Tables
- Database User who map to a Instance Login and define a Default Schema
- Why SQL select * from wind.wtuser does not work (small case of wtuser)?
wtuser needs to be WTUser
- Why SQL select * from WTUser does not work (without wind.)?
The user’s default schema is not wind
- What is the default schema?
dbo
Transaction log
- Windchill down due to database full
- Option #1:
- Forget backup log
- Reason #2:
- Windchill code problem leads to log full
Sequence
- Sample create_QueueEntry_Table.sql
- Create table for sequence
CREATE TABLE
entryNumber_seq (dummy
CHAR(1), value BIGINT IDENTITY(1,1))
go
- Create the procedure to get/generate the
sequence
CREATE PROCEDURE
wt_get_next_sequence_entryNumber
AS
INSERT entryNumber_seq (dummy) VALUES ('x')
RETURN SCOPE_IDENTITY()
go
Note: the
procedure changes to as below since 10.1, and then leads to CS128703
CREATE PROCEDURE
wt_get_next_sequence_entryNumber
@returnValue BIGINT OUTPUT
AS
INSERT entryNumber_seq (dummy)
VALUES ('x')
SELECT @returnValue = SCOPE_IDENTITY()
go
- Retrieve the sequence
DECLARE @return_value int
EXEC @return_value = [wind].[wt_get_next_sequence_entryNumber]
SELECT 'Return Value' = @return_value
GO
- How to break the IDENTITY temporarily for some
reason, e.g. configure to a BIG value to avoid ID confliction?
- Two methods
SET IDENTITY_INSERT
wind.entryNumber_seq ON
Insert into
wind.entryNumber_seq(dummy, value) values ('x', 99999)
SET IDENTITY_INSERT
wind.entryNumber_seq OFF
GO
OR
DBCC
CHECKIDENT('entryNumber_seq', RESEED, 100014)
GO
- How to verify sequences, like “select * from
user_sequences” in Oracle?
SELECT TABLE_NAME,IDENT_INCR(TABLE_NAME) AS IDENT_INCR, IDENT_CURRENT(TABLE_NAME) as IDENT_CURRENT
FROM INFORMATION_SCHEMA.TABLES
where IDENT_CURRENT(TABLE_NAME)is not null
order by TABLE_NAME;
Microsoft SQL Server的更多相关文章
- Microsoft SQL Server中的事务与并发详解
本篇索引: 1.事务 2.锁定和阻塞 3.隔离级别 4.死锁 一.事务 1.1 事务的概念 事务是作为单个工作单元而执行的一系列操作,比如查询和修改数据等. 事务是数据库并发控制的基本单位,一条或者一 ...
- Microsoft SQL Server 2008 R2 安装卸载
问题 问题1 标题: Microsoft SQL Server 2008 R2 安装程序 ------------------------------ 出现以下错误: Could not open k ...
- Sql Server系列:Microsoft SQL Server Management Studio模板资源管理器
模板资源管理器是Microsoft SQL Server Management Studio的一个组件,可以用来SQL代码模板,使用模板提供的代码,省去每次都要输入基本代码的工作. 使用模板资源管理器 ...
- 未能加载包“Microsoft SQL Server Data Tools”
直接在vs2013里的App_Data目录创建数据库,在服务器资源管理器中查看时报错: 未能加载包“Microsoft SQL Server Data Tools” 英文: The 'Microsof ...
- SQL SERVER错误:已超过了锁请求超时时段。 (Microsoft SQL Server,错误: 1222)
在SSMS(Microsoft SQL Server Management Studio)里面,查看数据库对应的表的时候,会遇到"Lock Request time out period e ...
- Cannot set a credential for principal 'sa'. (Microsoft SQL Server,错误: 15535)
在SQL SERVER 2008上上禁用sa登录时,遇到下面错误:"Cannot set a credential for principal 'sa'. (Microsoft SQL Se ...
- Microsoft SQL Server 2005 Service fails to start
今天碰到一雷死人的事情,在Windows Server 2012 R2上安装SQL SERVER 2005标准版过程中一直遇到"The SQL Server service failed t ...
- Microsoft SQL Server 2008 R2官方中文版(SQL2008下载).rar
Microsoft SQL Server 2008 R2官方中文版(SQL2008下载).rar
- 无法打开物理文件xxx.mdf操作系统错误 5:“5(拒绝访问。)” (Microsoft SQL Server,错误: 5120)的解决方法
无法打开物理文件xxx.mdf操作系统错误 5:“5(拒绝访问.)” (Microsoft SQL Server,错误: 5120)的解决方法 问题描述: 在附加数据库到sql server时,附 ...
- 无法删除服务器 'old_server_name',因为该服务器用作复制过程中的发布服务器。 (Microsoft SQL Server,错误: 20582)
无法删除服务器 'old_server_name',因为该服务器用作复制过程中的发布服务器. (Microsoft SQL Server,错误: 20582) 2013-01-05 15:02 478 ...
随机推荐
- Convert.ChangeType转换泛型的性能损失测试
经常要传入参数包,当时一直是用泛型+ChangeType解决的.测试了下,看来这样确实慢了. 另外,可能都会认为Release发布之后会被优化掉.但测试了Release和Debug结果一样慢,比较失望 ...
- JMeter基于http请求的web接口性能测试总结
[本文出自天外归云的博客园] 基于http请求的web接口性能测试总结 压测的目的:对于Web接口压测的目的最终是要在对数据库造成压力的情况下观察压测服务器的cpu是否达到预警值.memory是否发生 ...
- if else 语句练习
一.if else 语句.
- SaveXml的方法汇总
/// <summary> /// 保存XML文件 /// </summary> /// <returns></returns> public bool ...
- 关于三星A7屏幕锁已由管理员、加密政策,或证书存储禁用
解决办法:设定-安全-清除证书-再返回锁定屏幕-把密码锁定-改为滑动.....
- Android-表格布局 计算器 修改版
<?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android=" ...
- 一个js搜索功能的实现
这次的重点就在于一个兼容性的问题.就是innerText(微软ie)和textContent(火狐)的知识点,兼容性永远都是伤啊 <!DOCTYPE html PUBLIC "-//W ...
- python 列表函数
list函数: 功能:将字符创转化为列表,例: 列表基本函数: 1.元素赋值,例: 注意:通过list[0]= 'hel',如果原来位置上有值,会覆盖掉原来的. 2.分片操作 1)显示序列,例: 注意 ...
- [Lonlife1031]Bob and Alice are eating food(递推,矩阵快速幂)
题目链接:http://www.ifrog.cc/acm/problem/1031 题意:6个水果中挑出n个,使得其中2个水果个数必须是偶数,问有多少种选择方法. 设中0代表偶数,1代表奇数.分别代表 ...
- Beaglebone Black–GPIO 高低电平控制 LED 灯
上一篇,运用 Linux 的 sysfs,控制本机上的 LED 灯,usr0 至 usr3,这次用 GPIO 控制外部的电路,点亮 LED 灯. 这次的全部材料: BBB 一台 购买 BBB 自带的 ...