|
s*****r 发帖数: 424 | 2 各位老大 USO和DBO,买那个呢,想中长期持有 |
|
|
g*****1 发帖数: 998 | 4 有时候必须加dbo,有时候必须不加,
一般我出现问题改一下,请问有什么规律? |
|
i****a 发帖数: 36252 | 5 "dbo" is the schema name. if you have another table with the same name under
different schema, then you must specify the schema name |
|
g*****1 发帖数: 998 | 6 我是最近正式用sql server
比如我要写exec sp_help tablename时加了dbo就不行了。 |
|
gy 发帖数: 620 | 7 sp_help tablename by default goes to dbo schema.
You'd better use: sp_help 'schemaname.tablename'
You can do a test:
1) create a schema: xyz
2) create a table: xyz.test
3) use sp_help test and sp_help 'xyz.test'
..... what do you get? |
|
z***y 发帖数: 7151 | 8 这个不奇怪啊。
你可以看一看那个procedure, 你看里面有几个对temp table 的改变, 这些数据的改
变都会触发
recompilation。
我这个版本是2008 SP2的。
create procedure sys.sp_replmonitorrefreshagentdata
as
begin
set nocount on
declare @retcode int
,@agent_id int
,@agent_id2 int
,@publisher_id int
,@xact_seqno varbinary(16)
,@logreader_latency int
,@publisher_db sysname
,@publication sysname
-- security check
-- Has to b... 阅读全帖 |
|
|
h*****p 发帖数: 1516 | 9 一定双黄包奉上,多谢!
(@P1 varchar(30),@P2 varchar(15),@P3 varchar(15),@P4 varchar(15),@P5 varchar
(15),@P6 varchar(15),@P7 varchar(15),@P8 varchar(15),@P9 varchar(15),@P10
varchar(15),@P11 varchar(15),@P12 varchar(15),@P13 varchar(15),@P14 varchar(
15),@P15 varchar(15),@P16 varchar(15),@P17 varchar(15),@P18 varchar(15),@P19
varchar(15),@P20 varchar(15),@P21 varchar(15),@P22 varchar(15),@P23 varchar
(15),@P24 varchar(15),@P25 varchar(15),@P26 varchar(15),@P27 varchar(15),@
P28 varchar(15),@P29 varchar(15)... 阅读全帖 |
|
k***n 发帖数: 997 | 10 1, 有一个客户_good_.dbo.transactions, 其中包括
acct: unique customer identifier, purchdate: date when purchase occurred,
purchasemt: purchase amount
要求:select all acct with first purchase happened in 2012 and his total
purchase amount > 250$
2, 还是这个table, find the proportion of customers that made more than one
purchases in 2012 fiscal year. return a table where col1 is number of
customers that made more than one purchases in 2012 fiscal year, col2 total
number of customers ever purchased from us, col3 s... 阅读全帖 |
|
B*****g 发帖数: 34098 | 11 曾哥度假也要回答技术问题
【 以下文字转载自 Database 讨论区 】
发信人: zenny (素能), 信区: Database
标 题: Re: 各位各位,江湖救急 -- 数据被删
发信站: BBS 未名空间站 (Tue May 1 08:44:27 2012, 美东)
Please run this script first. Check the database properties first to get the
create date of the database
select * from sysdatabases
the crdate(?) is the create date for that database.
Then run the following script to find out available backups.
I'm on vacation now. So cannot verify the following script. If there's typo
or grammar error, please correct it y... 阅读全帖 |
|
y****3 发帖数: 131 | 12 非常感谢各位的指点。
我最后的design是:
/****** Object: Table [dbo].[Users] ******/
CREATE TABLE [dbo].[Users](
[UserID] [int] NOT NULL,
[UserName] [varchar](256) NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF
, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
/****** Object: Table [dbo].[Directories] ******/
CREATE TABLE [dbo].[Directories](
[DirectoryID] [bigint] NOT NULL,
[UserId] [int... 阅读全帖 |
|
z***y 发帖数: 7151 | 13 Please run this script first. Check the database properties first to get the
create date of the database
select * from sysdatabases
the crdate(?) is the create date for that database.
Then run the following script to find out available backups.
I'm on vacation now. So cannot verify the following script. If there's typo
or grammar error, please correct it yourself:
SELECT
msdb.dbo.backupset.database_name,
msdb.dbo.backupset.backup_start_date,
msdb.dbo.backupset.backup_finish_date,
... 阅读全帖 |
|
m****e 发帖数: 1197 | 14 原来的是:
SELECT dbo.tblDim_Period.Code AS MnthYr, dbo.tblDim_Account.Code AS
Account, dbo.tblDim_Prism.Code AS Prism, dbo.tblDim_Facility.Code AS
Facility,
dbo.tblDim_Product.Code AS Product, CASE WHEN dbo.
tblDim_Product.Accrual IS NULL
THEN 'ACT_ACT' ELSE dbo.tblDim_Product.Accrual END AS
ProdAccrl, dbo.tblDim_Channel.Code AS Channel, dbo.tblDim_Collateral.Code AS
Collateral,
dbo.tblDim_Reprice.Code AS RePrice, dbo.tblDim_Purpo |
|
e*n 发帖数: 1511 | 15 【 以下文字转载自 Stock 讨论区 】
发信人: mitbbs2020 (bbc), 信区: Stock
标 题: Re: 【Stragety论坛】Trading with correlations.
发信站: BBS 未名空间站 (Sun Jul 25 19:52:04 2010, 美东)
用option当然可以,但不是必须,
用option可以得到更高的leverage,
但是缺点是散户量小,不容易实现market neutral。
比如1.37的hedge ratio,你要long 137和short 100个才能实现。
13和10就不那么好,而且不容易adjust,看附图就知道不怎么neutral的情况。
说stock不便于对冲,这点我不懂你什么意思。
这本身就是market neutral的strategy。
我测试过DISCA和AXP(paper account),追踪了至少2个月,涨跌幅从来没超过3%的,
但是这反过来说明这不是一对好的pair。
别的pair,没有任何leverage,一年可以做到100%以上的也有,如果我实际做stock到
这个%,
已经很满意了... 阅读全帖 |
|
m****e 发帖数: 1197 | 16 我不太懂SQL,但是看起来这个QUERY不太优化。请提示一下,都是INNER JOIN,怎么改
?谢谢。
SELECT dbo.tblDim_Period.Code AS MnthYr, dbo.tblDim_Account.Code AS
Account, dbo.tblDim_Prism.Code AS Prism, dbo.tblDim_Facility.Code AS
Facility,
dbo.tblDim_Product.Code AS Product, CASE WHEN dbo.
tblDim_Product.Accrual IS NULL
THEN 'ACT_ACT' ELSE dbo.tblDim_Product.Accrual END AS
ProdAccrl, dbo.tblDim_Channel.Code AS Channel, dbo.tblDim_Collateral.Code AS
Collateral,
dbo.t |
|
l******9 发帖数: 579 | 17 I am designing a SQL Server 2008 R2 query.
If I used string concatenation to insert into table, it does not work.
DECLARE @s1 varchar(MAX);
DECLARE @s2 varchar(MAX);
DECLARE @s3 varchar(MAX);
DECLARE @s4 varchar(MAX);
SET @s1 = 'SELECT a.id, b.name as new_name, a.value FROM ['
SET @s2 = '].[dbo].[table1] as a, '
SET @s3 = 'a_temp_table as b ' -- a_temp_table is a table variable. No
matter I put "@" or "#" in front of a_temp_table, it doe snot work.
SET @s4 = 'WHERE a.id = b.i... 阅读全帖 |
|
p**********r 发帖数: 1693 | 18 报错,如下:
“/”应用程序中的服务器错误。
不能在具有唯一索引 'list' 的对象 'dbo.dnt_topics' 中插入重复键的行。
不能将值 NULL 插入列 'tid',表 'qbq_dnt35.dbo.dnt_mytopics';列不允许有 Null
值。INSERT 失败。
语句已终止。
语句已终止。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有
关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 不能在具有唯一索引 'list'
的对象 'dbo.dnt_topics' 中插入重复键的行。
不能将值 NULL 插入列 'tid',表 'qbq_dnt35.dbo.dnt_mytopics';列不允许有 Null
值。INSERT 失败。
语句已终止。
语句已终止。
源错误:
[没有相关的源行]
源文件: c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\root... 阅读全帖 |
|
l********u 发帖数: 195 | 19 query 如下:
select distinct prdoco from dbo.f43121 A where
(not exists
(select 1 from dbo.f43121 B where
A.prdoco=b.prdoco
and A.prdcto=b.prdcto
AND A.PRKCOo=B.PRKCOO
and B.PRMATC='2' AND((B.prdoc not in
(SELECT distinct prdoc FROM dbo.f43121, dbo.f0411
where prdoc=rpdoc and prdct=rpdct and prkco=rpkco))
or B.prdoc not in
(SELECT distinct prdoc FROM dbo.f43121, dbo.f0911
where prdoc=gldoc and prdct=gldct and prkco=glkco)))) |
|
gy 发帖数: 620 | 20 I did a test on this, and the conclusion is "字段id和原来表中的物理排列顺序
相关"
Here is the test code:
-- 1. First create a table with only one column
CREATE TABLE dbo.test(col varchar(5));
-- 2. Insert some test data
DECLARE @id int
SET @id = 1
WHILE(@id <= 5000)
BEGIN
INSERT INTO dbo.test(col)
VALUES(LEFT(CAST(NEWID() AS VARCHAR(50)), 5));
SET @id = @id + 1;
END
SELECT * FROM dbo.test
-- 3. Now, add the identity column:
ALTER TABLE dbo.test
ADD TID INT IDENTITY;
-- 4. Check the result compared w... 阅读全帖 |
|
l******9 发帖数: 579 | 21 I am designing a SQL Server 2008 R2 query.
If I used string concatenation to insert into table, it does not work.
DECLARE @s1 varchar(MAX);
DECLARE @s2 varchar(MAX);
DECLARE @s3 varchar(MAX);
DECLARE @s4 varchar(MAX);
SET @s1 = 'SELECT a.id, b.name as new_name, a.value FROM ['
SET @s2 = '].[dbo].[table1] as a, '
SET @s3 = 'a_temp_table as b ' -- a_temp_table is a table variable. No
matter I put "@" or "#" in front of a_temp_table, it doe snot work.
SET @s4 = 'WHERE a.id = b.i... 阅读全帖 |
|
c*****d 发帖数: 6045 | 22 create table dbo.product
(product_id int, name varchar(20), type int)
create table dbo.productprice
(product_id int, price int, regular_price int)
insert into dbo.product values(1,'a',1)
insert into dbo.product values(2,'b',2)
insert into dbo.productprice values(1,1,1)
insert into dbo.productprice values(2,2,0)
SELECT p.product_id, pp.price / pp.regular_price discount
FROM product p
INNER JOIN productprice pp ON pp.product_id = p.product_id
WHERE p.type = 1
product_id discount
----------- ----... 阅读全帖 |
|
c*****d 发帖数: 6045 | 23 create table dbo.product
(product_id int, name varchar(20), type int)
create table dbo.productprice
(product_id int, price int, regular_price int)
insert into dbo.product values(1,'a',1)
insert into dbo.product values(2,'b',2)
insert into dbo.productprice values(1,1,1)
insert into dbo.productprice values(2,2,0)
SELECT p.product_id, pp.price / pp.regular_price discount
FROM product p
INNER JOIN productprice pp ON pp.product_id = p.product_id
WHERE p.type = 1
product_id discount
----------- ----... 阅读全帖 |
|
l******9 发帖数: 579 | 24 I am designing a SQL Server 2008 R2 query.
If I used string concatenation to insert into table, it does not work.
DECLARE @s1 varchar(MAX);
DECLARE @s2 varchar(MAX);
DECLARE @s3 varchar(MAX);
DECLARE @s4 varchar(MAX);
SET @s1 = 'SELECT a.id, b.name as new_name, a.value FROM ['
SET @s2 = '].[dbo].[table1] as a, '
SET @s3 = 'a_temp_table as b ' -- a_temp_table is a table variable. No
matter I put "@" or "#" in front of a_temp_table, it doe snot work.
SET @s4 = 'WHERE a.id = b.i... 阅读全帖 |
|
m**2 发帖数: 3374 | 25 2015 Best Oil ETF No. 1: United States Oil Fund LP (NYSE Arca: USO) is the
most popular of the oil funds, with an average trading volume near 11
million shares. This ETF is actually a limited partnership rather than a
true ETF, though it trades like a stock (as ETFs do). USO’s managers invest
the partnership’s pooled assets in a variety of vehicles, from oil and gas
futures contracts to cash-settled energy options. The goal is to match the
performance in percentage terms (less expenses) of the s... 阅读全帖 |
|
R*********r 发帖数: 225 | 26 yeah,这个是工作的。多谢。
不过如果我想让#test的结构在不同的条件下完全不一样就不行了,不好事先定义。
下面两个例子,第一个报错,说#Test 已经存在,但是如果我把它换成一个permanent
table就完全没问题。
BTW: 用的是SQL SERVER 2008 R2
IF (2>1)
BEGIN
IF OBJECT_ID(N'tempdb.dbo.#Test','U') IS NOT NULL DROP TABLE #Test
SELECT 1 AS col1 into #Test
END
ELSE
BEGIN
IF OBJECT_ID(N'tempdb.dbo.#Test','U') IS NOT NULL DROP TABLE #Test
SELECT 2 as col1 INTO #Test
END
IF (2>1)
BEGIN
IF OBJECT_ID(N'dbo.test','U') IS NOT NULL DROP TABLE dbo.test
SELECT 1 AS col1 into dbo.test
END
ELSE
BEGIN
IF OBJECT_I |
|
c*****d 发帖数: 6045 | 27 你的回答解释不了他了问题
如果是你说的情况,people表这样
p1, p1_name
p2, p2_name
p3, p3_name
author表这样
a1, p1
a2, p2
SELECT * from PNTD.dbo.PEOPLE p
LEFT JOIN PNTD.dbo.AUTHORS at ON at.PEOPLEID = p.PEOPLEID ;
返回
p1, a1
p2, a2
p3, null
他的查询
SELECT count(*) from PNTD.dbo.PEOPLE p
LEFT JOIN PNTD.dbo.AUTHORS at ON at.PEOPLEID = p.PEOPLEID ;
应该返回3
SELECT count(*) from PNTD.dbo.PEOPLE p
应该返回3
the |
|
l******9 发帖数: 579 | 28 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: run SQL stored procedure from python
发信站: BBS 未名空间站 (Sat Aug 2 20:53:01 2014, 美东)
I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[m... 阅读全帖 |
|
a*****e 发帖数: 1717 | 29 Here's python one I used before,
drawbacks:
1. data pacing violation, limit on size of each quote, interval etc.
2. futures symbols are less standardized
3. IB data sucks, but ok for median to long term backtest
4. the ibpy is out-dated, you have to update yourself to get new
features.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from ib.ext.Contract import Contract
from ib.opt import ibConnection, message
from time import sleep
from datetime import date
import pyodbc, os, sys
# print all mess... 阅读全帖 |
|
w******w 发帖数: 215 | 30 What does following code do?
and what is corresponding My SQL code?
Thanks!
************************
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[FK_forum_bbsconfig]') and OBJECTPROPERTY(id,
N'IsForeignKey') = 1)
ALTER TABLE [dbo].[forum] DROP CONSTRAINT FK_forum_bbsconfig
GO
........
........
........
CREATE TABLE [dbo].[calendar] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[username] [varchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[title] [varchar] (255) COLLATE Chines |
|
i****a 发帖数: 36252 | 31 DECLARE @UserID AS INT
DECLARE @UserName AS VARCHAR(50)
SET @UserID = 3
SELECT @UserName = UserName
FROM dbo.[User]
WHERE UserID = @UserID
SELECT gm.GroupID
, @UserID AS UserID
, MAX(g.GroupName) AS GroupName
, COUNT(1) AS cnt
, @UserName AS CreatorName
FROM dbo.GroupMember gm
INNER JOIN dbo.[Group] g
ON gm.GroupID = g.GroupID
WHERE gm.GroupID IN ( SELECT GroupID
FROM dbo.GroupMember
WHERE Use... 阅读全帖 |
|
B*****g 发帖数: 34098 | 32 你水平不够的时候不要写太复杂的function,你需要把问题分成几个部分,我建议你这
么做
FUNCTION [dbo].[isWeekend](
@date datetime
)RETURNS bit -- 1for true, 0 for false
.....
FUNCTION [dbo].[isHoliday](
@date datetime
)RETURNS bit -- 1for true, 0 for false, check table
.....
FUNCTION [dbo].[isWorkingDay](
@date datetime
)RETURNS bit -- 1for true, 0 for false
As
Begin
if isWeekend(@date ) = 1 then
return 0
else if isHoliday(@date ) = 1 then
return 0
else
return 1
End
ALTER FUNCT... 阅读全帖 |
|
e****7 发帖数: 4387 | 33 -- CREATE TABLE STRUCTURE
IF OBJECT_ID('dbo.PEAK', 'U') IS NOT NULL DROP TABLE PEAK
GO
IF OBJECT_ID('dbo.CLIMBER', 'U') IS NOT NULL DROP TABLE CLIMBER
GO
IF OBJECT_ID('dbo.PARTICIPATED', 'U') IS NOT NULL DROP TABLE PARTICIPATED
GO
IF OBJECT_ID('dbo.CLIMBED', 'U') IS NOT NULL DROP TABLE CLIMBED
GO
CREATE TABLE PEAK
(
NAME VARCHAR(255),
ELEV INT,
DIFF INT,
MAP INT,
REGION INT
)
GO
CREATE TABLE CLIMBER
(
NAME VARCHAR(255),
SEX CHAR(1)
)
GO
CREATE TABLE PARTICIPATED
(
... 阅读全帖 |
|
l******9 发帖数: 579 | 34 I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[my_store_procedure] -- but this line
does not work, no run-time error message, but no results generated
"""
sql_str_connect = "DRIVER={S... 阅读全帖 |
|
c*****d 发帖数: 6045 | 35 drop index ind_p on dbo.product
drop index ind_pp on dbo.productprice
create index ind_p on dbo.product (product_id,type)
create index ind_pp on dbo.productprice(product_id,price,regular_price)
SELECT p.product_id, pp.price / pp.regular_price discount
FROM product p
INNER JOIN productprice pp ON pp.product_id = p.product_id
WHERE p.type = 1
product_id discount
----------- -----------
1 1
(1 row(s) affected) |
|
c*****d 发帖数: 6045 | 36 drop index ind_p on dbo.product
drop index ind_pp on dbo.productprice
create index ind_p on dbo.product (type)
create index ind_pp on dbo.productprice (price,regular_price)
SELECT p.product_id, pp.price / pp.regular_price discount
FROM product p
INNER JOIN productprice pp ON pp.product_id = p.product_id
WHERE p.type = 1
product_id discount
----------- -----------
1 1
(1 row(s) affected) |
|
c*****d 发帖数: 6045 | 37 drop index ind_p on dbo.product
drop index ind_pp on dbo.productprice
create index ind_p on dbo.product (product_id,type)
create index ind_pp on dbo.productprice(product_id,price,regular_price)
SELECT p.product_id, pp.price / pp.regular_price discount
FROM product p
INNER JOIN productprice pp ON pp.product_id = p.product_id
WHERE p.type = 1
product_id discount
----------- -----------
1 1
(1 row(s) affected) |
|
c*****d 发帖数: 6045 | 38 drop index ind_p on dbo.product
drop index ind_pp on dbo.productprice
create index ind_p on dbo.product (type)
create index ind_pp on dbo.productprice (price,regular_price)
SELECT p.product_id, pp.price / pp.regular_price discount
FROM product p
INNER JOIN productprice pp ON pp.product_id = p.product_id
WHERE p.type = 1
product_id discount
----------- -----------
1 1
(1 row(s) affected) |
|
l******9 发帖数: 579 | 39 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: run SQL stored procedure from python
发信站: BBS 未名空间站 (Sat Aug 2 20:53:01 2014, 美东)
I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[m... 阅读全帖 |
|
l******9 发帖数: 579 | 40 【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: run SQL stored procedure from python
发信站: BBS 未名空间站 (Sat Aug 2 20:53:01 2014, 美东)
I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[m... 阅读全帖 |
|
t****n 发帖数: 263 | 41 The result is right. There is no problem with the query.
This might be easier to understand:
SELECT COUNT(*)
FROM dbo.courses c
JOIN dbo.enrollment e
ON c.cid = e.cid
AND c.cname = 'Math'
RIGHT JOIN dbo.students s
ON e.SID = s.SID
WHERE c.cid IS NULL |
|
m*********h 发帖数: 764 | 42 MSSQL
--function
create function [dbo].[FindParents]
(
@child char(1)
)
returns char(1)
begin
Declare @temParents char(1)= null
WHILE EXISTS(SELECT * FROM A WHERE child=@child)
BEGIN
SELECT @temParents =(SELECT parents from A where child=@child)
return dbo.FindParents(@temParents)
END
IF(@temParents IS NULL)
BEGIN
SET @temParents = @child
END
return @temParents
end
--Table Name A
Child Parents
a b
b c
c d
e f
f g
--Query
SELECT child,(SELECT dbo.... 阅读全帖 |
|
l******9 发帖数: 579 | 43 【 以下文字转载自 Quant 讨论区 】
发信人: light009 (light009), 信区: Quant
标 题: create table on SQL server from python pyodbc
发信站: BBS 未名空间站 (Fri Aug 1 13:19:15 2014, 美东)
am trying to access SQL server 2008 R2 from Eclipse pydev ( python 3.2 ) on
win7 .
I need to create a table on database.
The code can be run well. But, I cannot create tables in the database. If I
print the sql string and run the query from SQL server management studio, no
problems.
import pyodbc
sql_strc = " IF OBJECT_ID('[my_db].[dbo].[my_t... 阅读全帖 |
|
p*******e 发帖数: 125 | 44 我觉得dbo不错,平均contango比uso小,可以hold更长时间,和大盘没什么关系,现在
holding是2017/03的合同。原先和usl都有liquidity不好,spread太大的问题。现在
dbo的spread是penny wide,买dbo相当于买远期合同。 |
|
p****u 发帖数: 2596 | 45 【 以下文字转载自 Quant 讨论区 】
发信人: pipinu (pipinu), 信区: Quant
标 题: 哪位大狭帮我看下这个SQL 出什么问题啊? 谢谢
发信站: BBS 未名空间站 (Tue May 25 14:55:43 2010, 美东)
1)是可以运行,2)就出错
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS"
and "SQL_Latin1_General_CP850_BIN" in the equal to operation
怎么回事情?头大了 :(:(
1)
select * from xf.dbo.security A1
join MGStrategy.dbo.MODEL6_UNIVERSE Univ1
on(Univ1.ENTRY_DATE='24-May-2010' and Univ1.BLOOMBERG_TICKER='C'+' US' and
A1.tic='C');
2)
select * from xf.dbo.security A |
|
n********6 发帖数: 1511 | 46 谢谢万能的coolbid和Assailant。sysobjects很好用。
我发现query out比programmability\stored procedures多了几个sp(e.g. name = sp_
alterdiagram)
又发现在programmability\stored procedures\system stored procedures里面(e.g.
name = dbo.sp_alterdiagram)
这些sp(e.g. dbo.sp_alterdiagram)是否user created?
如果是,怎么会在system stored procedure底下?dbo.是由什么决定的? |
|
n********6 发帖数: 1511 | 47 谢谢万能的coolbid和Assailant。sysobjects很好用。
我发现query out比programmability\stored procedures多了几个sp(e.g. name = sp_
alterdiagram)
又发现在programmability\stored procedures\system stored procedures里面(e.g.
name = dbo.sp_alterdiagram)
这些sp(e.g. dbo.sp_alterdiagram)是否user created?
如果是,怎么会在system stored procedure底下?dbo.是由什么决定的? |
|
v*****r 发帖数: 1119 | 48 interesting, I guess ...
The loading is trying to load into a table owned by a schema other than dbo,
while dbo schema happens to have a table with the same name as the target
table??? In that case, dropping the offending table in dbo schema is the
fix??? |
|
a********e 发帖数: 198 | 49 I run the simple query in MS sql2012
SELECT count(*) from PNTD.dbo.PEOPLE p
LEFT JOIN PNTD.dbo.AUTHORS at ON at.PEOPLEID = p.PEOPLEID ;
SELECT count(*) from PNTD.dbo.PEOPLE p
the return are 586 and 560.
why the left join return more rows? should the first query return less rows? |
|
l******9 发帖数: 579 | 50 【 以下文字转载自 Quant 讨论区 】
发信人: light009 (light009), 信区: Quant
标 题: create table on SQL server from python pyodbc
发信站: BBS 未名空间站 (Fri Aug 1 13:19:15 2014, 美东)
am trying to access SQL server 2008 R2 from Eclipse pydev ( python 3.2 ) on
win7 .
I need to create a table on database.
The code can be run well. But, I cannot create tables in the database. If I
print the sql string and run the query from SQL server management studio, no
problems.
import pyodbc
sql_strc = " IF OBJECT_ID('[my_db].[dbo].[my_t... 阅读全帖 |
|