When I try to shrink one of my db's, I get the following error: "File ID 1 of database ID 6 cannot be shrunk as it is either being shrunk by another process or is empty."
The database is 140GB, of which it shows 40GB free, I just can't get it to shrink. I have done DBCC shrinkfile, and DBCC...
I would like to select top rows by multiple criteria. I have division and dollars, and I would like to select the top 200 from each division by dollars. I keep trying things like this:
SELECT TOP 200 DIV, Dollars
FROM [This Week Data]
WHERE ((([This Week Data].DIV)=11))
ORDER BY [This Week...
I should also add, my goal is to use SQL Server 2005 to automate several queries, so that's the ideal place for a solution. However, I can't make it work using other query tools as well.
Thanks,
Paul
I have 11 different databases to query from, each with a different IP address, name, etc. I have installed SDK, the driver version is 3.80. My problem is this:
I have created 11 data sources, 11 entries in the hosts file also, but each data source points to the same host. If I change the...
CautionMP, thanks, I will check this out. I haven't used VB before, but I'm sure I can get someone to assist.
SkipVought, that was the first thing I said to my customer, but in the end, I have to satisfy them. I'll make sure to pass on my pain the them, though ;-)
Hi Doug,
Exporting really isn't the problem, it's exporting to multiple sheets. I've been able to export the whole thing to one sheet pretty easily. I need some iterative way to export, I guess.
I have a query which returns about 10,000 rows. One of the columns is dept. My customer would like me to create one Excel sheet per value of dept (all in the same .xls file, about 30 of them). It's easy enough, though tedious, to copy and paste, or create multiple queries, but I would like to...
Sorry, I'll post the work-around, I never got an email that you had posted this. Basically, what I wanted to do was select only the row that had the most recent date. So I created a subquery from the same table which had the max(date):
SELECT a.DIV_NO,a.ITM_NO
FROM NOKDE.OKIITIO a...
I can't get the following query to work:
SELECT DIV_NO,ITM_NO, RANK() OVER (ORDER BY ITM_LAST_SH_DT) AS R1
FROM NOKDE.OKIITIO
WHERE ITM_NO= '15310'
It gives me a "Function Rank was not found" error. I thought Rank was an ANSI standard function. There's always the chance our system was...
I suspect I might have corrupted the database somehow. In making other changes, I suddenly had relationships appear that weren't there before. So I just created new tables and appended the data from the old tables. Problem solved, though with extra work. Sorry for bothering you with this.
Paul
PH and Alex,
I've done both of those, and still I can't change the table designs. I get the message that I have to delete its relationships in the Relationships window.
I should add that there are no links between the two tables, they simply won't go away. Any other ideas? Your assistance...
I have 2 tables that I can't delete from the Relationships window. They have no line between them, they just won't go away. I delete them, but when I show all again, they reappear. It's preventing me from making a change to one of my tables. Any ideas?
Thanks,
Paul
PHV, this is sweet. It makes perfect sense when I think about it, but I never would have thought about it without seeing your post. Big star for you, buddy!
I don't think so, I think I might be out of luck. Thanks for your help, though, you're great to try and help. I guess I'll have to come up with something else.
Paul
Thanks, BillDHS. I've tried to use this, but I'm not sure how I could do it. I can make a table with the column names, but how can I use that to select from and join my tables? I'm no expert on derived tables. Conceptually, I can see how you could do something like:
create table tab1 as (...
I have several tables which I want to join into one very large table (~950 columns). These tables all have a key to link them, but that key has the same name in all tables. So when I type in:
select a.*, b.*, c.*
from a left outer join b left outer join c
(I've simplified to save space)
I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.