Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Table creation problem

Author  Topic 

MartinFalch
Starting Member

5 Posts

Posted - 2010-05-12 : 06:58:33
Hi there,

I have tried using a piece of query-code that I previously used with no problems. The code creates a new table, based on a previous table and looks like this:
-------------------------------------------------------

Select a.*, b.obstime as PrevObsTime, log(a.SPCLOSE)-log(b.SPCLOSE) as SPreturn
into ReturnSP
from SP a, SP b
where b.obstime=(select max(obstime) from SP where obstime<a.obstime)


-------------------------------------------------------

When I try this for top 10 or top 100, it works absolutely fine and I know that it worked in the past as well with tables as large as the SP table, which I'm basing this on. However, when I try it now, I get an error message like this:

Msg 1101, Level 17, State 12, Line 1
Could not allocate a new page for database 'Job2' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.


I guess this may be due to the fact that I'm using the free version of SQL server 2005. When I try to look at the properties of my database, it says that it has reached the maximum initial size of 4096 MB, but this happens also if I try the code in other databases - then they go from initial size of e.g. 12 MB to the 4096...

Does anyone have a clue on what I should do here to get this to work? It'd be a great help to me and I would appreciate it alot!

Best regards,

Martin

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-05-12 : 12:37:28
How big is the result set that is placed in ReturnSP?

You'll need to upgrade to a different edition unfortunately.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -