Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Tuesday, March 27, 2012

Connecting to SQL Server

I installed MSDE today using the setup.exe file, so the syntax was

setup SAPWD=mypassword securitymode=SQL

it worked, I reboot and I see the SQL Server running...

I opened my web matrix, went into the data section and tried to make a new connection to then create databases etc, and it bombs...

I click on SQL Authentication
username sa
password mypassword
and I tried to create a new database

it says either SQL doesn't exsist, or access denied...

any idea's what I did wrong?

Thanks
CadenUPDATE:

I downloaded the new web matrix and everything works just peachy now

Sunday, March 25, 2012

Connecting to SQL Mobile within VS-2005

I am getting an error when I run my project within VS2005. I am trying to connect to a SQL Mobile (sdf) file thru code using a connection string. As soon as run my project within the VS2005 environment, I get the following error when the code tries to connect:
"The file is not a valid database file. An internal error has occurred. [,,,Databasename,,]"
The source of the error is: Microsoft SQL Server 2000 Windows CE Edition
Native Error of: 25011
I am am deploying to POcket PC 2003 SE Emulator.
This code worked fine in VS2003 with SQLCE 2.0. But I have now updated the projects to VS2005 and recreated the database sdf file within the VS2005 environment.
Could someone please help me ASAP?
Thanks.

There is no database compatibility between SQL CE 2.0 and SQL Mobile. Database created through one cannot be opened by other. In you case, since you have upgraded the project and re-created the database, you have SQL Mobile database. But your application still has references to SQL CE 2.0 provider. So now your application is trying to open a SQL CE 3.0 Database using SQL CE 2.0 provider; that’s the reason why in your error string you can see

The source of the error is: Microsoft SQL Server 2000 Windows CE Edition
Native Error of: 25011

In you application you need to remove the reference from 2.0 provider and add reference to 3.0 provider.

Thanks

-Mani

Connecting to SQL Issue

I have a mdf file and log file from msde. I have successfully connected to it in my Visual Studios ASP.net 2.0 Desktop. I am having a problem where it connects. fine but it does not list the tables , diagrams etc. I am trying to build the intake screen with this data but have no tables. Can some one give me a couple of suggestions of why? I am very new to ASP.net and would appreciate any help .How did you connect to the MSDE mdf file? Can you create a Data Connection to it in Server Explorer? Which SQL instance are you using (MSED,SQL Express, etc.)?|||

Hello,

I am using SQL Server Management Studio that came with my visual studios .net 2005.

I open my web application to the design desktop select the tab labeled Server Express the click on the data base to connect it tell me it is connected but no tables show. I was told today by some one I need to be running SQL Server Studio Express I dont understand is the one I have better? The also told me the mdf file was a backup file which they said I need to create a database and then import the mdf backup file into it . I can figure out how to do this I am very new to SQL Server. Help please

Thanks

|||Where does the mdf file come from? Anyways you should attach it to your current SQL instance before you can use it. To do this in Managment Studio, right click Databases in Object Explorer->choose Attach->locate the mdf file. If attach succeeds, you'll see the new attached database under the Databases tree.|||

Thank you,

I found the mdf file to be a bak file I created anew database and restored over the database I created. All tables showed up ok. I only have on question everything seem to work fine except I have no diagrams under the database is this normal not to have this information?

sqlsql

Connecting to SQL Express 2005 via Web.Config file in Visual Studio 2003

Hi

I am following a project to build a small E-Commerce site from a book I have purchased and I have having problems connecting to the SQL Database with the code supplied.

The book is Apress Beginning ASP.NET 1.1 E-Commerce

http://www.amazon.co.uk/Beginning-ASP-Net-1-1-E-Commerce-Professional/dp/1590592549/ref=sr_11_1/202-7684451-7995058?ie=UTF8&qid=1193780707&sr=11-1

The code added to the Web.Config file is :

<configuration>

<appSettings>

<addkey="ConnectionString"value="Server=(local)\NetSDK;Integrated Security=True;Initial Catalog=JokePoint"/>

</appSettings>

The connection details are in a class file called Catalog.vb and is as follows

Imports System.Data.SqlClient

PublicClass Catalog

PublicSharedFunction GetDepartments()As SqlDataReader

'Create the connection object

Dim connectionAsNew SqlConnection(connectionString)

'Create and initialize the command object

Dim commandAsNew SqlCommand("GetDepartments", connection)

command.CommandType = CommandType.StoredProcedure

'Open the connection

connection.Open()

'Return a SqlDataReader to the calling function

Return command.ExecuteReader(CommandBehavior.CloseConnection)

EndFunction

PrivateSharedReadOnlyProperty connectionString()AsString

Get

Return ConfigurationSettings.AppSettings("ConnectionString")

EndGet

EndProperty

EndClass

The error is....

Cannot open database "JokePoint" requested by the login. The login failed. Login failed for user 'MachineName\ASPNET'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Cannot open database "JokePoint" requested by the login. The login failed. Login failed for user 'MachineName\ASPNET'.

Source Error:

Line 15: 'Open the connectionLine 16:Line 17: connection.Open()Line 18: Line 19: 'Return a SqlDataReader to the calling function


Source File:C:\MyCommerceSite\JokePoint\BusinessObjects\Catalog.vb Line:17

Stack Trace:

[SqlException: Cannot open database "JokePoint" requested by the login. The login failed.Login failed for user 'MachineName\ASPNET'.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open() JokePoint.Catalog.GetDepartments() in C:\MyCommerceSite\JokePoint\BusinessObjects\Catalog.vb:17 JokePoint.DepartmentsList.Page_Load(Object sender, EventArgs e) in C:\MyCommerceSite\JokePoint\UserControls\DepartmentsList.ascx.vb:44 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Control.LoadRecursive() System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()

The connection tests ok in Visual Studio 2003. All permissions are set using SQL Management Studio Express 2005.

The book is using SQL 2000, I have been trying different connection syntax's in the Web.Config file all day and now I have a big headache. I know its something simple, can anyone please advise ?

Thanks in advance.

Mark

cracken:

<addkey="ConnectionString"value="Server=(local)\NetSDK;Integrated Security=True;Initial Catalog=JokePoint"/>

First, you are trying to connect using windows authentication and not with a SQL Server user credentials. I think the Integrated Security part is causing you the error. Have you tried to connect using SQL Server user credentials ( if any ), or you are using the windows authentication only.

Hope this will help.

|||

Try this...

web.config file:

<connectionStrings>

<addname="ConnectionString";Data Source=(local)\NetSDK;Integrated Security=True;Initial Catalog=JokePoint";

providerName="System.Data.SqlClient" />

</connectionStrings>

after that in the vb page:

Dim sepAsNew SqlConnection("connectionstring")

sep.Open()

Dim commandAsNew SqlCommand("GetDepartments", sep)

command.CommandType = CommandType.StoredProcedure

|||

Hi

Thanks for answering so quick, I am using Windows Integrated Secuity at the moment.

I have tried the suggestion above, but they were not sucessful. What I have done is changed the provier to OleDb and added a bit to the connection string.

I do not seen to get any code errors now, just login errors.

The VB file now looks like:

Imports System.Data

Imports System.Data.OleDb.OleDbConnection

Public Class Catalog

Public Shared Function GetDepartments() As OleDb.OleDbDataReader

'Create the connection object

Dim connection As New OleDb.OleDbConnection(connectionString)

'Create and initialize the command object

Dim command As New OleDb.OleDbCommand("GetDepartments", connection)

command.CommandType = CommandType.StoredProcedure

'Open the connection

connection.Open()

'Return a OleDbDataReader to the calling function

Return command.ExecuteReader(CommandBehavior.CloseConnection)

End Function

Private Shared ReadOnly Property connectionString() As String

Get

Return ConfigurationSettings.AppSettings("ConnectionString")

End Get

End Property

End Class

And the Web.Config connection string :

<configuration>

<appSettings>

<addkey="connectionString"value="Server=(local)\NetSDK; Provider=SQLOLEDB; Integrated Security=SSPI; Initial Catalog=JokePoint"/>

</appSettings>

And the error message :

Cannot open database "JokePoint" requested by the login. The login failed.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.OleDb.OleDbException: Cannot open database "JokePoint" requested by the login. The login failed.

Source Error:

Line 16: 'Open the connectionLine 17:Line 18: connection.Open()Line 19: Line 20: 'Return a OleDbDataReader to the calling function

All access accounts and read / write permission are correct.

Any more advise would be much app.

Regards

Mark

Tuesday, March 20, 2012

Connecting to Northwind on SQL Server 2000

I've just installed SQL Server 2000 on my local machine. I'm using the following element in my web.config file for my connection string.

<add key="SqlNWind512" value="server=(local)\141.705.84.745;database=Northwind;
user id=sa;pwd=h3fe8eq7;packet size=512;" /
Unfortunately, I'm getting the following error on my aspx page:

SQL Server does not exist or access denied.

I had no problem writing a connection string to connect to the MSDE installed on my computer, but making a connection to the Northwind database on my newly installed SQL Server 2000 Developer edition has been elusive to me.

I'm sure my IP address is correct. The authentication mode for logging into the database via Enterprise Manager is setup to require a password for sa. Therefore, I assume it's required in the connection string?

Maybe not so coincidentally, while I have been able to open this database through the Server Explorer in VS.NET, I'm not able to access it via Enterprise Mananger (no response, it just hangs) or my aspx pages.

I'm dying here!!! Is my connection string wrong? Any insights would be greatly appreciated!just server=<ip address
forget the (local) bit if it's not local.|||Thank you!|||word to the wise..
Don't put your password to your database online on forums.

h3fe8eq7 can be a very bad thing.

Monday, March 19, 2012

Connecting to MSDE w/read only file?

Hi,
Does anyone know how I can connect to an MSDE db using VB with a
read-only file? The file will be on a CD, and is actually just archived
data off a SQL server. I would like to package my app on a CD along
with the data file and allow users to pop in the CD and run the app,
assuming they already have MSDE running. Any help?

Thanks,
Jasonhi Jason,
"Jason" <jnorsworthy@.etrade.com> ha scritto nel messaggio
news:1104275382.477692.322310@.z14g2000cwz.googlegr oups.com
> Hi,
> Does anyone know how I can connect to an MSDE db using VB with a
> read-only file? The file will be on a CD, and is actually just
> archived data off a SQL server. I would like to package my app on a
> CD along with the data file and allow users to pop in the CD and run
> the app, assuming they already have MSDE running. Any help?
> Thanks,
> Jason

actually this is possible, providing you mark the database as available on
CD using system stored procedure sp_create_removable and
sp_certify_removable...
this method requires at least 3 physical files, 1 database system data file
that MUST reside on read/write device, 1 data file that will contain all
application's data and that will reside on the removable device, and 1
transaction log file...

please have a look at
http://msdn.microsoft.com/library/d...des_03_92hx.asp
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--- remove DMO to reply

Connecting to MS Access File

I need help setting up a Read connection to a MS Access table. The Access
file is not located on the same machine that many of the SQL servers reside.
Everything works great on the local machine using the ODBC Drivers Provider
as a one of the rds. The DSN file on the local development machine points to
the proper MS Access file. When the report is deployed to the reporting
server (not the local dev. box) a credentials error is encountered. Yes, I
have a DSN file on both different machines with the same name. Any help
would be much appreciated.Hello Corey,
I would not use a DSN; try a DSN-less connection string.
I think you can find one here: http://www.connectionstrings.com/
Francisco.
> I need help setting up a Read connection to a MS Access table. The
> Access file is not located on the same machine that many of the SQL
> servers reside.
> Everything works great on the local machine using the ODBC Drivers
> Provider as a one of the rds. The DSN file on the local development
> machine points to the proper MS Access file. When the report is
> deployed to the reporting server (not the local dev. box) a
> credentials error is encountered. Yes, I have a DSN file on both
> different machines with the same name. Any help would be much
> appreciated.
>

Connecting to MDF file over Workgroup

Hi

I've build a client management (Windows) application in VS2005 which works fine on the local development machine but falls over when trying to connect to the SQL Server Express file located on a second machine on the same Workgroup. Several of the apllications will connect to the database file from networked computers.

The error I get when testing the connection or trying to connect via the App is:

-------------------
The file "Z:\BushBreaks.MDF" is on a network path that is not supported for database files.
An attempt to attach and auto-named database for file z:\bushbreaks.mdf failed. A database with the same name exists, or specified file cannot be opened or it is on a UNC share.
-------------------

How can I configure this database and/or connection to be able to allow connections to the MDF file? Please note that security is not an issue if that is at all relevant.

Many Thanks
John

Current you can't use remote database file in your SQL connection. Here is a instruction about AttachDBFileName property in connection string from MSDN:

The name of the primary database file, including the full path name of an attachable database. The path may be absolute or relative by using the DataDirectory substitution string. If DataDirectory is used, the database file must exist within a subdirectory of the directory pointed to by the substitution string.

Note:

Remote server, HTTP, and UNC path names are not supported.

For more information, you can refer to:

http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

Connecting to mainframe from SQL Server 2000

Hi,
I'm taking data from mainframe and processing it using SQL Server
2000. Now I take data from mainframe as .txt file and loading it to
the sql server 2000. How can I connect SQL Server 2000 to mainframe to
get the data.
Thanks
ShafeekOne way is to ftp the file to the distributed environment such as a Windows
file server or on the SQL Server box and then use DTS or Bulk insert/bcp
utilities.
"Shafeek Khalidh" <itsprobablyme@.msn.com> wrote in message
news:f086c89e.0307110827.5936d7bb@.posting.google.com...
> Hi,
> I'm taking data from mainframe and processing it using SQL Server
> 2000. Now I take data from mainframe as .txt file and loading it to
> the sql server 2000. How can I connect SQL Server 2000 to mainframe to
> get the data.
> Thanks
> Shafeek|||Why don't you try Extended Stored Procedure.
Because you can use C to write DLL, you can do almost anything in it.
Include connect to mainframe, and get some data, certianly you can put it
into server if you want.
cheers
"Shafeek Khalidh" <itsprobablyme@.msn.com> wrote in message
news:f086c89e.0307110827.5936d7bb@.posting.google.com...
> Hi,
> I'm taking data from mainframe and processing it using SQL Server
> 2000. Now I take data from mainframe as .txt file and loading it to
> the sql server 2000. How can I connect SQL Server 2000 to mainframe to
> get the data.
> Thanks
> Shafeek

Sunday, March 11, 2012

connecting to dbf

Hi,

I am having trouble connecting to a dbf file inside an SSIS package. How do I connect to a dbf file in SSIS.

Thanks

Brian

Check out the discussion @. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=228933&SiteID=1

Thanks,
Loonysan

Thursday, March 8, 2012

Connecting to AdventureWorks2000_Data.mdf

When I try to connect to this AdventureWorks2000_Data.mdf, I get the following message:

The file "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks2000_Data.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.

Could not open new database 'AdventureWorks2000'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 5118)

Any ideas on how to get the local version installed of SQL Server to open this db? I'm trying to follow along with the examples in the book "Beginning Transact-SQL with SQL Server 2000 and 2005".

Thanks,

Vanzant

Run a sp_helpdb to check all the databases in your server just to make sure you do have the AdventureWorks2000 database. If not, you can download it from

http://www.microsoft.com/downloads/details.aspx?FamilyID=487C9C23-2356-436E-94A8-2BFB66F0ABDC&displaylang=en

|||

Is C: a compressed volume? If so, SQL Server does not support compressed volumes.

Read SQL Server databases are not supported on compressed volumes

|||http://blogs.msdn.com/sanchan/archive/2006/06/04/617585.aspx FYI.|||

I don't think C: is a compressed volume. The only thing I know to check is the disk properties when right click on C:. It isn't selected on the "compress drive to save disk space". If there is another place to check/correct, please let me know.

I can open the AdventureWorks_Data.mdf. I don't know if this matters but I have SQL Server 2005 and SQL Server Express installed on my local PC. This is where I'm trying to look at the files. I'm not sure the differences between the AdventureWorks_Data and AdventureWorks2000_Data, but I don't understand why I can't open the '2000' version.

Any ideas/help would be greatly appreciated.

Thanks,

Vanzant

|||

I think I've figured it out. There are two folders (MSSQL and MSSQL.1) under the Microsoft SQL Server folder. I attached the 2000 db in the MSSQL folder and it worked. I guess it is a newbie issue.

Thanks for inputs!

Connecting to Access

Hello,
I am trying to connect to an Access database though Query Analyzer. The
help file is minimally helpful on this. This is what I have so far:
-- add the database as a linked server
execute sp_addlinkedserver Library,
'Access 2002',
'Microsoft.Jet.OLEDB.4.0',
'D:\today\Andrew\Library.mdb'
-- add a login to that server
execute sp_addlinkedsrvlogin Library,
false,
'EBSHQ\Andrew',
'Admin',
NULL
-- show servers
execute sp_linkedservers
-- do something
execute sp_tables_ex 'Library'
Here's where I get an error:
Bah, the server's out for a bit. I'll post the error when it comes back.
Without the error message, does anything above look wrong or out of
place?
Thanks,
AndrewHi
If you get something like:
Server: Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 20
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: Disk or network error.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
IDBInitialize::Initialize returned 0x80004005: ].
0x80004005 indicates a permissions issue. You could have specified the wrong
file name as the linked server or the permission are such that you can not
see/open it.
John
"Andrew Clark" <lark047@.hotmail.com> wrote in message
news:1108168266. 8c16687f2eb892e2e3e7ff72d9cb5c72@.teranew
s...
> Hello,
> I am trying to connect to an Access database though Query Analyzer. The
> help file is minimally helpful on this. This is what I have so far:
> -- add the database as a linked server
> execute sp_addlinkedserver Library,
> 'Access 2002',
> 'Microsoft.Jet.OLEDB.4.0',
> 'D:\today\Andrew\Library.mdb'
> -- add a login to that server
> execute sp_addlinkedsrvlogin Library,
> false,
> 'EBSHQ\Andrew',
> 'Admin',
> NULL
> -- show servers
> execute sp_linkedservers
> -- do something
> execute sp_tables_ex 'Library'
> Here's where I get an error:
> Bah, the server's out for a bit. I'll post the error when it comes back.
> Without the error message, does anything above look wrong or out of
> place?
> Thanks,
> Andrew
>|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in
news:eURHWJREFHA.1012@.TK2MSFTNGP14.phx.gbl:

> Hi
> If you get something like:
> Server: Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 20
> OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
> [OLE/DB provider returned message: Disk or network error.]
> OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'
> IDBInitialize::Initialize returned 0x80004005: ].
> 0x80004005 indicates a permissions issue. You could have specified the
> wrong file name as the linked server or the permission are such that
> you can not see/open it.
> John
>
>
>
I think that might have been it, but I will have to check on monday
Andrew

Saturday, February 25, 2012

Connecting SQL Server with Delphi 7

Hi,
How can i connect to an sql server db file. I have the server's ip number.
I'm using Delphi 7.
Thanks...
:)Can't you use BDE configuration tool in Control Panel?|||There are three easy methods in delphi7 u can choose:
1 BDE
2 ADO
3 DBExpress

Sunday, February 19, 2012

connecting DB on a pendrive in MSSQL 7.0

I am developing an application in VB. I want to know whether we can keep the database file (.mdf) on the pendrive in MS SQL 7.0. If this can be done HOW CAN THIS BE DONE Please guide me. It should be that when i connect my pendrive to the machine / server then i should be able to acess the database. This is a chellenging job which i have taken. Please guide me if this is possible.
Hoping for you HELP
THank YOu
Vikram JainCheck out sp_attach_db and sp_detach_db in the MS-SQL 7.0 Books Online.

-PatP|||SP_Attach_DB ?? How can this procedure be made run through VB Code.
If you can send me a sample code it would be highly appreciated..
Thanks Regards Vikram Jain

Connecting Database Engine (SQl server 2005 file .*mdf) from Win CE 5.0 platform

Is this possible to connect do the Database Engine (on sql server 2005 on XP platorm - file *.mdf (not mobile *.sdf)) from win CE 5.0?

I tried to do this :

ConnectionStringSQLServerCE = "Data Source=WORK_STATION\\SQLEXPRESS;Initial Catalog=dbMachines;Integrated Security=False;Password=Panel;User ID=Panel";

SqlCeConnectionCE = new SqlConnection(ConnectionStringSQLServerCE);

SqlCeConnectionCE.Open();

but I catch error:

catch (PlatformNotSupportedException ex)

?PlatformNotSupportedException”

I noticed that I see server because when I use:

ConnectionStringSQLServerCE = "Data Source=WORK_STATION\\SQLEXPRESS";

zwraca b??d typu

catch (SqlException ex)

“Login failed for user ''. The user is not associated with a trusted SQL Server connection.”

I used

using System.Data.SqlClient;

from Compact Framework 2.0 under Visual Studio 2005 Device Application Windows CE 5.0

can anyone help me?

Yes, it is possible to connect to SQL Server 2000/2005, SQL Express and MSDE from NETCF application using SQL Client.

PlatformNotSupportedException usually happens if particular device does not support locale database it in. For example, if your database uses Polish collation, you'd need device localized in Polish in order to use it. Alternatively you could change database collation to one available on device.

As to connection issue, your server need to be properly configured and you should have functional network connectivity. Please see this for general troubleshooting:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=335660&SiteID=1

Friday, February 17, 2012

Connecting a user from a backup database to a new login

All,
In SQL Server 2000, I loaded a backup file into a new local database.
The database has an existing user which owns several stored procedures,
tables, etc.
Using SQL Server authentication, I want to create a login of the same
name as the user, so that when I login, I have access to the objects
owned by that user without having to prefix the objects with the owner
name.
For instance exec sp_mystoredproc instead of exec
ownername.sp_mystoredproc. (In fact, several of the stored procedures
exec other procedures without the owner name prefix and to go add the
owner will be a tedious process)
When I try to add login and grant the login name to the existing user
it tells me it already exists.
I cannot drop the existing user because it owns a whole bunch of
objects.
What can I do to work around this? How do I connect a login to an
existing database user? Is there a system table where I can just map
the two?
Brad> What can I do to work around this? How do I connect a login to an
> existing database user? Is there a system table where I can just map
> the two?
See the sp_change_users_login stored procedure in the Books Online. Also,
the Best Practice is to always schema-qualify objects.
Hope this helps.
Dan Guzman
SQL Server MVP
"brad" <brad.eckrose@.gmail.com> wrote in message
news:1168719405.103237.233140@.38g2000cwa.googlegroups.com...
> All,
> In SQL Server 2000, I loaded a backup file into a new local database.
> The database has an existing user which owns several stored procedures,
> tables, etc.
> Using SQL Server authentication, I want to create a login of the same
> name as the user, so that when I login, I have access to the objects
> owned by that user without having to prefix the objects with the owner
> name.
> For instance exec sp_mystoredproc instead of exec
> ownername.sp_mystoredproc. (In fact, several of the stored procedures
> exec other procedures without the owner name prefix and to go add the
> owner will be a tedious process)
> When I try to add login and grant the login name to the existing user
> it tells me it already exists.
> I cannot drop the existing user because it owns a whole bunch of
> objects.
> What can I do to work around this? How do I connect a login to an
> existing database user? Is there a system table where I can just map
> the two?
> Brad
>

Sunday, February 12, 2012

Connect to SQL Server dialog

Hi,
Is it possible to avoid the last used server being in Query Analyzer
'Connect to SQL Server' dialog by default(when I click on File/Connect
in Query Analyzer) - I don't want to apply 'truncate table' scripts to
a production server by mistake!
Thanks<polinaskulski@.aol.com> wrote in message
news:1120572207.464620.272820@.g49g2000cwa.googlegr oups.com...
> Hi,
> Is it possible to avoid the last used server being in Query Analyzer
> 'Connect to SQL Server' dialog by default(when I click on File/Connect
> in Query Analyzer) - I don't want to apply 'truncate table' scripts to
> a production server by mistake!
> Thanks

I don't think that's possible - if you're concerned about running scripts in
the wrong place, then you can reference @.@.SERVERNAME in your scripts, or
always begin a transaction and require a manual COMMIT or ROLLBACK. Another
option is to use a dedicated administrator account for deployments to
production servers.

But all those approaches have drawbacks as well, and in the end there's no
catch-all substitute for being careful about what you're doing.

Simon