Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Table error "Table not found"

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
0
36
US
Here is my SQL
Code:
USE master
GO
CREATE DATABASE CADTime
ON 
( NAME = CADTime_dat,
   FILENAME = 'c:\CADTime.mdf',
   SIZE = 10,
   MAXSIZE = 50,
   FILEGROWTH = 5 )
LOG ON
( NAME = 'CADTime_log',
   FILENAME = 'c:\CADTime.ldf',
   SIZE = 5MB,
   MAXSIZE = 25MB,
   FILEGROWTH = 5MB )
GO

Use CADTime '<<<<<<<<<<<<<< ERROR Here (can't find CADTime)
GO
CREATE TABLE CADTime 
(
blah 
blah
blah
)

When I run this it creates the Database OK but it can't find the newly created Database to add a table to it.
I can run just the Create Table code later and it works OK.
What do I nedd to do to refresh it

DougP, MCP, A+
 
Where do you run the script from?
Works fine from my Query Analyzer.

Nevertheless, I would separate the tasks anyhow, just to be on the safe side.
 
I'm running it from Query Analyzer.
How do I separate tasks?
I eventually want to run this from my VB.NET app when it is first installed to create the Database and tables on the clients SQL server.


DougP, MCP, A+
 
Use WAITFOR DELAY|TIME between the tasks.
It should not really matter as DDL is committed right away,
but your server might be busy, or something.
Also, if you are going to run it during installation time, use OSQL interface (not isql, which is an old DB-LIB interface). And, of course, test it in the installation scenario, not QA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top