473,714 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1333
"Ian Semmel" <is***********@ NOKUNKrocketcom p.com.auwrote in message
news:uG******** ******@TK2MSFTN GP02.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.co m

"Ian Semmel" <is***********@ NOKUNKrocketcom p.com.auwrote in message
news:uG******** ******@TK2MSFTN GP02.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***********@ NOKUNKrocketcom p.com.auwrote in message
news:uG******** ******@TK2MSFTN GP02.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***********@ NOKUNKrocketcom p.com.auwrote in message
news:uG******** ******@TK2MSFTN GP02.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.Applicat ion sqlApp = new SQLDMO.Applicat ionClass();

SQLDMO.SQLServe r sqlServer = new SQLDMO.SQLServe rClass();

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.AllowNull s = false;

colId.IdentityI ncrement = 1;

blah blah blah...
"Ian Semmel" <is***********@ NOKUNKrocketcom p.com.auwrote in message
news:uG******** ******@TK2MSFTN GP02.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
1454
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 external site does have some secondary mirrors, which I would like to revert to if the primary does not respond, say within 2 or 3 seconds. Here's the bit of the script that does the connection: $fp = fopen( $rooturl, "r" ); $html = join( "",...
2
13885
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 groups for "stuff" returns a lot of, well... stuff. But not what I'm looking for! Using STUFF The STUFF function inserts a string into another string. It deletes a specified length of characters in the first string at the start
6
1842
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 companies </title> </head> <body>
0
946
by: Pixi | last post by:
If you smoke, go to www.pixi.biz
6
5357
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 Javascript, has anyone out there got any ideas on how this could be accomplished? Many thanks for any help on this one!!! Steve C
1
1509
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 Ravensfield Digital Resource Group, Ltd. (740) 587-0114
9
504
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 releases. Everytime there is a release, it takes forever for it to show up on an ftp server. This is in the case that the ftp server even works. Now in a case where onelikes to browse with the browser of their choice, it totally blows becauseit's _so_...
4
1293
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. I need the following smoke tests: IE7 on XP (are they SP1 or SP2 now?) IE and FF on VISTA (any SPs yet?) SAF, IE and FF on MAC (Panther, Tiger, ...?) KON and FF on LINUX (Debian, Ubuntu, ...?)
6
1271
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 a bad impression of our framework and Python in general. It took us half an hour to figure out how to bootstrap setuptools onto one person's machine, since ez_install.py sources from the cheeseshop, and even when we got that installed,...
4
1444
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 must pass. The light ray emerges in a specific direction from a fixed point. Pls note the light ray is to be represented by a line The light is deflected by reflection using a suitable number of plane mirrors. Note that for a plane mirror the...
0
8711
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9075
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9017
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4464
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4726
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3158
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.