Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Wednesday, March 28, 2012

opening up odbc data source in the query query inside of the server manager

I'm trying to find the command to open up an odbc conection inside sql2005 express. I only have ues of an odbc connector, we're conection to remedy. We will eventually be using stored procedures to extract the data we need from remedy and doing additional data crunching. I'm a foxpro programmer so once I get the correct syntax for making the odbc connector I shold be ok. Also I need a really good advanced book on sql2005. The type of book that would have my odbc answer. I've spent all morning trying to find this information and was unable to.

Thanks in advance

Daniel Buchanan.

If this was the wrong forum to post this on, please move this question to the correct one. I need this answer soon.

You can set up linked servers on one of the SQL Servers and join the data.

http://msdn2.microsoft.com/en-us/library/ms188279(SQL.90).aspx

hth

BobP

Opening SQL Server Express files with SQL Server Management Studio (2005)

I am trying to open a SS2005 Express file with the full version of SQL Server Management Studio but it will not let me. I cannot install SQL Server Express Management Studio as they cannot co-exist on the same machine!

I can open the file in Visual Studio but itb will not allow me to change table names or move tables etc to another SQL Express database.

Is there an addin tool that will allow me to work on these files with SQL 2005 Studio or any other tool that will allow me to change table names and move tables/data between SQL Express files?

You cannot open database files in Management Studio.

You have to attach the database to your SQL Express in order to connect to it with Management Studio.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||

i think what you are refering is User Instance feature of SQL Server Express. This feature is only available in Express edition. So you may change the connection string which connecting to otherversion.

attach the mdf and ldf file using sp_attach_db and then you can view the database in Management Studio

Madhu

Monday, March 12, 2012

Open Connections - Can't Drop

Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
I have no problems Dropping the Tables.
Thanks,
Chuck
Where is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>
|||Hello Thank You for you help.
I have the Stored Procedure inside the Master Table.
I am immediately running the query given after connecting. I also cannot
remove it from SQL Express Management Studio. - That is if I copy the SQL
into a query window and run it. I get the exact same error.
Chuck
"Hardik Bati" <hardikb_removethis_@.microsoft.com> wrote in message
news:OLkzPow9GHA.4376@.TK2MSFTNGP03.phx.gbl...
Where is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>
|||Hello,
I have been doing some testing. I am filling a Dataset using a DataAdapter.
If I create a new connection to SQL Express without calling the
DataAdapter's Fill Method I can Drop the Database.
If I Fill the Dataset with the DataAdapter, dispose the connection and the
DataAdapter and create a new connection it still wont Drop the Database.
Even if the Dataset is empty it still does not work. It appears that
calling the DataAdapter before dropping the table keeps the database in use
weather it has finished it's job or not.
I can't even call a Stored Procedure to drop the Database if I call the
DataAdapter First. Even if I run the program and call the DataAdapter and
go into SQL Express Management Studio, I still get the same error. Only
when I shut down the program or drop the table without using the DataAdapter
does it work.
Is there a way around this?
Thanks
Chuck
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
I have no problems Dropping the Tables.
Thanks,
Chuck
|||The most likely cause is that the closed/disposed connection is pooled and
the pooled connection is preventing you from dropping the database. You can
specify Pooling=False in the connection string (or similar, depending on the
provider you are using) to disable connection pooling.
Another method is to execute "ALTER DATABASE MyDatabase SET SINGLE_USER WITH
ROLLBACK IMMEDIATE" to kill all connections to the database befor the drop.
Hope this helps.
Dan Guzman
SQL Server MVP
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:OgZmXqz9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I have been doing some testing. I am filling a Dataset using a
> DataAdapter.
> If I create a new connection to SQL Express without calling the
> DataAdapter's Fill Method I can Drop the Database.
> If I Fill the Dataset with the DataAdapter, dispose the connection and the
> DataAdapter and create a new connection it still wont Drop the Database.
> Even if the Dataset is empty it still does not work. It appears that
> calling the DataAdapter before dropping the table keeps the database in
> use
> weather it has finished it's job or not.
> I can't even call a Stored Procedure to drop the Database if I call the
> DataAdapter First. Even if I run the program and call the DataAdapter and
> go into SQL Express Management Studio, I still get the same error. Only
> when I shut down the program or drop the table without using the
> DataAdapter
> does it work.
> Is there a way around this?
> Thanks
> Chuck
>
> "Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
> news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>

Open Connections - Can't Drop

Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
I have no problems Dropping the Tables.
Thanks,
ChuckWhere is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>|||Hello Thank You for you help.
I have the Stored Procedure inside the Master Table.
I am immediately running the query given after connecting. I also cannot
remove it from SQL Express Management Studio. - That is if I copy the SQL
into a query window and run it. I get the exact same error.
Chuck
"Hardik Bati" <hardikb_removethis_@.microsoft.com> wrote in message
news:OLkzPow9GHA.4376@.TK2MSFTNGP03.phx.gbl...
Where is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>|||Hello,
I have been doing some testing. I am filling a Dataset using a DataAdapter.
If I create a new connection to SQL Express without calling the
DataAdapter's Fill Method I can Drop the Database.
If I Fill the Dataset with the DataAdapter, dispose the connection and the
DataAdapter and create a new connection it still wont Drop the Database.
Even if the Dataset is empty it still does not work. It appears that
calling the DataAdapter before dropping the table keeps the database in use
weather it has finished it's job or not.
I can't even call a Stored Procedure to drop the Database if I call the
DataAdapter First. Even if I run the program and call the DataAdapter and
go into SQL Express Management Studio, I still get the same error. Only
when I shut down the program or drop the table without using the DataAdapter
does it work.
Is there a way around this?
Thanks
Chuck
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
I have no problems Dropping the Tables.
Thanks,
Chuck|||The most likely cause is that the closed/disposed connection is pooled and
the pooled connection is preventing you from dropping the database. You can
specify Pooling=False in the connection string (or similar, depending on the
provider you are using) to disable connection pooling.
Another method is to execute "ALTER DATABASE MyDatabase SET SINGLE_USER WITH
ROLLBACK IMMEDIATE" to kill all connections to the database befor the drop.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:OgZmXqz9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I have been doing some testing. I am filling a Dataset using a
> DataAdapter.
> If I create a new connection to SQL Express without calling the
> DataAdapter's Fill Method I can Drop the Database.
> If I Fill the Dataset with the DataAdapter, dispose the connection and the
> DataAdapter and create a new connection it still wont Drop the Database.
> Even if the Dataset is empty it still does not work. It appears that
> calling the DataAdapter before dropping the table keeps the database in
> use
> weather it has finished it's job or not.
> I can't even call a Stored Procedure to drop the Database if I call the
> DataAdapter First. Even if I run the program and call the DataAdapter and
> go into SQL Express Management Studio, I still get the same error. Only
> when I shut down the program or drop the table without using the
> DataAdapter
> does it work.
> Is there a way around this?
> Thanks
> Chuck
>
> "Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
> news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>

Open Connections - Can't Drop

Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
I have no problems Dropping the Tables.
Thanks,
Chuck
Where is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>
|||Hello Thank You for you help.
I have the Stored Procedure inside the Master Table.
I am immediately running the query given after connecting. I also cannot
remove it from SQL Express Management Studio. - That is if I copy the SQL
into a query window and run it. I get the exact same error.
Chuck
"Hardik Bati" <hardikb_removethis_@.microsoft.com> wrote in message
news:OLkzPow9GHA.4376@.TK2MSFTNGP03.phx.gbl...
Where is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>
|||Hello,
I have been doing some testing. I am filling a Dataset using a DataAdapter.
If I create a new connection to SQL Express without calling the
DataAdapter's Fill Method I can Drop the Database.
If I Fill the Dataset with the DataAdapter, dispose the connection and the
DataAdapter and create a new connection it still wont Drop the Database.
Even if the Dataset is empty it still does not work. It appears that
calling the DataAdapter before dropping the table keeps the database in use
weather it has finished it's job or not.
I can't even call a Stored Procedure to drop the Database if I call the
DataAdapter First. Even if I run the program and call the DataAdapter and
go into SQL Express Management Studio, I still get the same error. Only
when I shut down the program or drop the table without using the DataAdapter
does it work.
Is there a way around this?
Thanks
Chuck
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
I have no problems Dropping the Tables.
Thanks,
Chuck
|||The most likely cause is that the closed/disposed connection is pooled and
the pooled connection is preventing you from dropping the database. You can
specify Pooling=False in the connection string (or similar, depending on the
provider you are using) to disable connection pooling.
Another method is to execute "ALTER DATABASE MyDatabase SET SINGLE_USER WITH
ROLLBACK IMMEDIATE" to kill all connections to the database befor the drop.
Hope this helps.
Dan Guzman
SQL Server MVP
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:OgZmXqz9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I have been doing some testing. I am filling a Dataset using a
> DataAdapter.
> If I create a new connection to SQL Express without calling the
> DataAdapter's Fill Method I can Drop the Database.
> If I Fill the Dataset with the DataAdapter, dispose the connection and the
> DataAdapter and create a new connection it still wont Drop the Database.
> Even if the Dataset is empty it still does not work. It appears that
> calling the DataAdapter before dropping the table keeps the database in
> use
> weather it has finished it's job or not.
> I can't even call a Stored Procedure to drop the Database if I call the
> DataAdapter First. Even if I run the program and call the DataAdapter and
> go into SQL Express Management Studio, I still get the same error. Only
> when I shut down the program or drop the table without using the
> DataAdapter
> does it work.
> Is there a way around this?
> Thanks
> Chuck
>
> "Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
> news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuer y()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>

Open Connections - Can't Drop

Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
I have no problems Dropping the Tables.
Thanks,
ChuckWhere is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>|||Hello Thank You for you help.
I have the Stored Procedure inside the Master Table.
I am immediately running the query given after connecting. I also cannot
remove it from SQL Express Management Studio. - That is if I copy the SQL
into a query window and run it. I get the exact same error.
Chuck
"Hardik Bati" <hardikb_removethis_@.microsoft.com> wrote in message
news:OLkzPow9GHA.4376@.TK2MSFTNGP03.phx.gbl...
Where is this stored procedure. If it's in the database then you won't be
able to use it to drop the database while you are in the same database.
Are you trying to run the query directly after connecting useing the
connection string just given. Or is there any "use Customer" before execute
ExecuteNonQuery().
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>|||Hello,
I have been doing some testing. I am filling a Dataset using a DataAdapter.
If I create a new connection to SQL Express without calling the
DataAdapter's Fill Method I can Drop the Database.
If I Fill the Dataset with the DataAdapter, dispose the connection and the
DataAdapter and create a new connection it still wont Drop the Database.
Even if the Dataset is empty it still does not work. It appears that
calling the DataAdapter before dropping the table keeps the database in use
weather it has finished it's job or not.
I can't even call a Stored Procedure to drop the Database if I call the
DataAdapter First. Even if I run the program and call the DataAdapter and
go into SQL Express Management Studio, I still get the same error. Only
when I shut down the program or drop the table without using the DataAdapter
does it work.
Is there a way around this?
Thanks
Chuck
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
Hello,
I am using SQL Express and Visual Studion 2003. I am trying to DROP
DATABASE Customers using a Stored Procedure and also using ADO.NET.
Query:
IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
DATABASE [Customers]
ConnectionString:
RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
Password=MyPassword;Initial Catalog=master"
Everytime I call the procedure or ExecuteNonQuery I get:
Cannot Drop Database 'Customers' because database is currently in use. by
sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
I have no problems Dropping the Tables.
Thanks,
Chuck|||The most likely cause is that the closed/disposed connection is pooled and
the pooled connection is preventing you from dropping the database. You can
specify Pooling=False in the connection string (or similar, depending on the
provider you are using) to disable connection pooling.
Another method is to execute "ALTER DATABASE MyDatabase SET SINGLE_USER WITH
ROLLBACK IMMEDIATE" to kill all connections to the database befor the drop.
Hope this helps.
Dan Guzman
SQL Server MVP
"Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
news:OgZmXqz9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I have been doing some testing. I am filling a Dataset using a
> DataAdapter.
> If I create a new connection to SQL Express without calling the
> DataAdapter's Fill Method I can Drop the Database.
> If I Fill the Dataset with the DataAdapter, dispose the connection and the
> DataAdapter and create a new connection it still wont Drop the Database.
> Even if the Dataset is empty it still does not work. It appears that
> calling the DataAdapter before dropping the table keeps the database in
> use
> weather it has finished it's job or not.
> I can't even call a Stored Procedure to drop the Database if I call the
> DataAdapter First. Even if I run the program and call the DataAdapter and
> go into SQL Express Management Studio, I still get the same error. Only
> when I shut down the program or drop the table without using the
> DataAdapter
> does it work.
> Is there a way around this?
> Thanks
> Chuck
>
> "Charles A. Lackman" <Charles@.CreateItSoftware.net> wrote in message
> news:epQ433v9GHA.1172@.TK2MSFTNGP03.phx.gbl...
> Hello,
> I am using SQL Express and Visual Studion 2003. I am trying to DROP
> DATABASE Customers using a Stored Procedure and also using ADO.NET.
> Query:
> IF EXISTS (SELECT name FROM sys.databases WHERE name = Customers) DROP
> DATABASE [Customers]
> ConnectionString:
> RemoveConnectionString = "Server = MyComputer\SQLExpress;UID=sa;
> Password=MyPassword;Initial Catalog=master"
>
> Everytime I call the procedure or ExecuteNonQuery I get:
> Cannot Drop Database 'Customers' because database is currently in use. by
> sqlclient.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> I have no problems Dropping the Tables.
> Thanks,
> Chuck
>
>

Friday, March 9, 2012

Open a new project using SQL Server management Studio Express

Dear Friends

I am unable to open e new project using SQL Server management Studio Express. On the File menu it displays only "Query with current connection" and "Data base Engine Query". Please help me on thi Do I have to Install SQL Server management Studio instead of using express version. Cant I use SQL Server and SQL server management studio for deploy to make a small database for my a wharehouse. Please help me

Amila

Management Studio Express does not include the Project functionality of the full version. You can still create queries and scripts in SSMSE which can be saved to a .sql file, moved to a different computer and run withing SSMSE on that computer.

Use either of the options you mention to create a new query window and create the script you wish to use to build your database. Once you've got the script working, use Save from the File menu and give the file a name. You can send this file around like any text file and it can be loaded into any copy of Management Studio or Management Studio Express and run.

Regards,

Mike Wachal
SQL Express team

Saturday, February 25, 2012

Only Configuration tool downloaded, why?

Hi,

First of all, I am very new on SQL server express.

Today I downloaded and installed the SQL server express (from www.microsoft.com/downloads), but what I got is only: Configuration tool, (I can see from: Start -> Programms -> Microsoft SQL server 2005->Configuration tool).

I didn't get SQL Server management Studio express, SAL Server Business Intelligence Development Studio, and Documentation and Tutorials.

I don't know where I did wrong, please help.

Thank you.

James

You need to download the version with 'Advanced Services' in order to get the client tools. And you should also download the Books Online reference materials.

SQL Server 2005 Express Edition (Advanced/SSMS)
http://msdn.microsoft.com/vstudio/express/sql/compare/default.aspx
http://msdn2.microsoft.com/en-us/library/ms365247.aspx
http://tinyurl.com/yelwr9

SQL Server 2005 Express Books Online Express Edition
http://msdn2.microsoft.com/en-us/library/ms165706.aspx

SQL Server 2005 SSMS Express Tutorial
http://tinyurl.com/nqsca