Viewing 15 posts - 196 through 210 (of 388 total)
Check permissions of the login linked server uses to connect to SVR2. Is it mapped to databases you need to access?
Piotr
May 23, 2008 at 7:33 am
That was a good one 🙂
The idea is to get normalized numbers for months (1..12) and join on them.
the ; must be there if with is not first statement in...
May 21, 2008 at 8:59 am
Here, this works:
update rentalsTest set sortOrder = newSortOrder
from rentalsTest a inner join
(select id, userid, movieid, row_number() over(partition by(userid) order by id) newSortOrder
from rentalsTest) b on a.id = b.id
Piotr
May 21, 2008 at 7:28 am
Well, you seem to have syntax error. Shouldn't month names be in quotes?
Could you send DDL, and a few rows of sample inserts?
It would be easier. By exceeding 12 I...
May 21, 2008 at 6:59 am
What results / error messages do you get when you run the query?
What I meant, is that you join for example month 8 with month 7 in the lower...
May 21, 2008 at 6:25 am
I think that there is one issue here - you can't join straight on previous month number because Jan will not join to Dec. Try to normalize month numbers so...
May 21, 2008 at 5:14 am
Well the options are documented in help, one of them allows for locking the table during insert. This in my opinion can cause blocking. These amounts of rows are not...
May 20, 2008 at 6:13 pm
Hi David,
This is CTE - new construct in SQL 2005 that allows for easy browsing of recursive structures. In this case you can't say that data are recursive, but...
May 20, 2008 at 9:16 am
Yes Jeff I agree, but there are only 12 moths in an average year. 😉
Piotr
May 20, 2008 at 8:28 am
Just a question - if you have circular dependencies and you cannot delete data, how can you insert data to these tables? Do you drop constraints as well?
Piotr
May 20, 2008 at 7:40 am
I gave it a bash, see if this can work for you:
create table monthacc(monthnum int, amount int)
go
insert monthacc(monthnum, amount)
select 1, 10
union all
select 2, 30
union all
select 3, 15
union all...
May 20, 2008 at 7:37 am
How do you know it is quicker? Did you measure both queries on your data?
What if you have ten times more data? Do you realize that your solution will not...
May 20, 2008 at 7:24 am
Now this works but this is going to perform poorly always for big tables. There is no way this query can use any indexes.
Piotr
May 20, 2008 at 7:10 am
How did you do it Sandy? What is your solution?
I believe Grant wanted to say that if these three columns are indexed on both tables, outer join approach will perform...
May 20, 2008 at 6:41 am
Viewing 15 posts - 196 through 210 (of 388 total)