473,409 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

SQL - Smoke and mirrors stuff

It is hard to test SQL because running a test twice does not give the same results.

Anyway, what I am trying to do is create a database (in initialization
circumstances) and do the following by Executing .sql scripts

DROP database
CREATE database
CREATE each table

So far so good

Then when I try to use the database, as in the normal case, I get an error like
'Database in use by another process' and test fails.

Try the test again

This time get the error 'Login failed'

I think what I need is to somehow really close the database because I think that
there are connections hanging around (I am not sure because I don't know).

Are there some settings/commands to handle this situation ?
Jul 2 '06 #1
5 1321
"Ian Semmel" <is***********@NOKUNKrocketcomp.com.auwrote in message
news:uG**************@TK2MSFTNGP02.phx.gbl...
It is hard to test SQL because running a test twice does not give the same
results.
???
Anyway, what I am trying to do is create a database (in initialization
circumstances) and do the following by Executing .sql scripts

DROP database
CREATE database
CREATE each table
This is a C# forum - please show the C# code which is not working as you
expect.
Jul 2 '06 #2
Ian,

When you are using the database, are you actually disposing of all the
connections? Are you also sure that others are closing all the connections?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ian Semmel" <is***********@NOKUNKrocketcomp.com.auwrote in message
news:uG**************@TK2MSFTNGP02.phx.gbl...
It is hard to test SQL because running a test twice does not give the same
results.

Anyway, what I am trying to do is create a database (in initialization
circumstances) and do the following by Executing .sql scripts

DROP database
CREATE database
CREATE each table

So far so good

Then when I try to use the database, as in the normal case, I get an error
like 'Database in use by another process' and test fails.

Try the test again

This time get the error 'Login failed'

I think what I need is to somehow really close the database because I
think that there are connections hanging around (I am not sure because I
don't know).

Are there some settings/commands to handle this situation ?

Jul 2 '06 #3
That sound to me you are attaching the mdf file in VS 2005 using connection
string. I would say attach your mdf to SQL 2005 server and use the database
in the server.

chanmm

"Ian Semmel" <is***********@NOKUNKrocketcomp.com.auwrote in message
news:uG**************@TK2MSFTNGP02.phx.gbl...
It is hard to test SQL because running a test twice does not give the same
results.

Anyway, what I am trying to do is create a database (in initialization
circumstances) and do the following by Executing .sql scripts

DROP database
CREATE database
CREATE each table

So far so good

Then when I try to use the database, as in the normal case, I get an error
like 'Database in use by another process' and test fails.

Try the test again

This time get the error 'Login failed'

I think what I need is to somehow really close the database because I
think that there are connections hanging around (I am not sure because I
don't know).

Are there some settings/commands to handle this situation ?

Jul 2 '06 #4
This sounds like exactly what I am doing, but I am not sure what your solution
actually means.

chanmm wrote:
That sound to me you are attaching the mdf file in VS 2005 using connection
string. I would say attach your mdf to SQL 2005 server and use the database
in the server.

chanmm

"Ian Semmel" <is***********@NOKUNKrocketcomp.com.auwrote in message
news:uG**************@TK2MSFTNGP02.phx.gbl...
>>It is hard to test SQL because running a test twice does not give the same
results.

Anyway, what I am trying to do is create a database (in initialization
circumstances) and do the following by Executing .sql scripts

DROP database
CREATE database
CREATE each table

So far so good

Then when I try to use the database, as in the normal case, I get an error
like 'Database in use by another process' and test fails.

Try the test again

This time get the error 'Login failed'

I think what I need is to somehow really close the database because I
think that there are connections hanging around (I am not sure because I
don't know).

Are there some settings/commands to handle this situation ?


Jul 2 '06 #5
I'm doing something similar and in the beginning I did as you are now -
trying sql scripts to achieve this.

Eventually I moved onto SQLDMO with some hard work, it did get easier and
more controllable. Even through things like adding keys and foreign keys.

Some pointers:

Add a reference to SQLDMO
SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass();

SQLDMO.SQLServer sqlServer = new SQLDMO.SQLServerClass();

SQLDMO.Database sqlDB = new SQLDMO.Database();

SQLDMO.DBFile sqlMDF = new SQLDMO.DBFile();

SQLDMO.LogFile sqlLDF = new SQLDMO.LogFile();

SQLDMO.Table tbl = new SQLDMO.Table();

tbl.Name = "tblmaster";

SQLDMO.Column colId = new SQLDMO.Column(); // Add the ID Column

colId.Name = "id";

colId.Datatype = "int";

colId.AllowNulls = false;

colId.IdentityIncrement = 1;

blah blah blah...
"Ian Semmel" <is***********@NOKUNKrocketcomp.com.auwrote in message
news:uG**************@TK2MSFTNGP02.phx.gbl...
It is hard to test SQL because running a test twice does not give the same
results.

Anyway, what I am trying to do is create a database (in initialization
circumstances) and do the following by Executing .sql scripts

DROP database
CREATE database
CREATE each table

So far so good

Then when I try to use the database, as in the normal case, I get an error
like 'Database in use by another process' and test fails.

Try the test again

This time get the error 'Login failed'

I think what I need is to somehow really close the database because I
think that there are connections hanging around (I am not sure because I
don't know).

Are there some settings/commands to handle this situation ?

Jul 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DesignGuy | last post by:
I have a script that incorporates content from an external site ($rootdomain). During peak traffic periods the external site experiences severe slowdowns, thereby slowing down the site here. The...
2
by: Jeff Lambert | last post by:
I have this function everywhere in our SQL server 2000 stored procedures. Has anyone written a workaround function for it? I would appreciate if you could share. As you can imagine, searching the...
6
by: lkrubner | last post by:
Me and some friends are working on some PHP based templates for web pages. We've templates that look like this (simplified): <html> <head> <title> The green and blue design for carpentry...
0
by: Pixi | last post by:
If you smoke, go to www.pixi.biz
6
by: Steve C | last post by:
Hi, I've had a strange request for a website. The client is after a smoke effect which will gradually fill the screen for a few moments before clearing again. This is too be written in...
1
by: Andrew Rawnsley | last post by:
There used to be instructions on the web site about becoming a mirror - can't find it anymore. Does the project still need mirror sites? -------------------- Andrew Rawnsley President The...
9
by: Dan Vande More | last post by:
Hey list, I'm just wondering if anyone can point me in the direction of a mirror that doesn't suck. I generally don't do alot with postgres other than downloading and installing the newest...
4
by: www.gerardvignes.com | last post by:
I'd like to join or start a small group of Ajax web developers who are willing to smoke test each others Ajax applications, quid pro quo. I can smoke test on W2K SP4 with IE6, FF2, SM 1 and O9. ...
6
by: Jon | last post by:
I'm a frequent helper in the IRC channel for the Pylons web framework. Pylons is installed from eggs using easy_install, and when Cheeseshop is down (or so slow it might as well be down), it gives...
4
by: YASIN786 | last post by:
Hi ol My name is yasin i am currently developing an application in vbnet 2003 the requirements are as follows: On the form will be located a number of points (no more than 4) through a light ray...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.