Sqlcmd Opens Blank And Then Just Closes.

Dec 4, 2006

Hey guys i have installed SQL Server Express and getting a problem. Every time I use the runcommand and enter sqlcmd. It opens the window but then I cannot enter any information into it. And after a while the window just closes.

Anyone know the reason for this?

Dallr

View 3 Replies


ADVERTISEMENT

Report Window Opens, Remains Blank

Aug 30, 2007



I am trying to open reports through an existing application. When I click the button to run the report, the new window opens, appears to be trying to load (the windows logo in the top corner is flowing, the hourglass is present), and then stops. I am left with a blank window, no report, and no error message.

I am able to view and run the reports through the Report Server. Other users are able to run the reports through the application.

Any ideas?

Thanks,
Michelle

View 1 Replies View Related

Connection Closes Often

Feb 24, 2006

Hi Team,

I get the below error very often.

java.sql.SQLException: I/O Error: Connection reset Caused by: java.net.SocketException: Connection reset

Followed by a number of "java.sql.SQLException: Invalid state, the Connection object is closed.".
Some time Invalid state, the Statement object is closed."

I have checked out the network problem and time out of queries. And both does not seems to be an issue for me. Because my application send queries continuously (Checked it with mssql profiler all queries executed in minimum interval) and MSSQL runs in the local machine. Meantime i do not see any wrong packet exception.

Is there any other thing i could check out. Any kind of Help is much appreciated.

Thanks for your help.

View 5 Replies View Related

SQL Enterprise Manager Closes

Aug 11, 2007

Sql Enterprise Manager closes after few seconds and can't be opened again. But if I'll restart the computer, it will be opened then close again after few seconds and can't be opened again. And it can't totally be opened eventhough I restarted the computer. What do you think is the problem?

View 1 Replies View Related

Connection Closes Abruptly

Jul 4, 2006

My application consists of two modules, one in VB6, which performs Inserts and Updates on an SQL Express Server, and the other in VB.NET which performs Select operations on the same server.

From last two days the .NET module (which performs heavy select queries), randomly gives an error : "Connection closed for this operation", and rarely gives an error : "SqlException: A severe error occurred on the current command".

I don't know whether these two errors are linked to each other. But the former error is a very high priority for me, as it is application wide.

This problem is occuring only in the .NET module. The VB6 module which uses the same server is working fine.

Please help.

Girish

View 3 Replies View Related

The Connection Gets Closed Right After It Opens.

Jan 27, 2007

I have the Function, that fires from onLoad even of one of the asp:Label controls on my main page.
Here is it's code:
 SqlConnection conn = new SqlConnection();                conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkraineConnectionString"].ToString();                SqlCommand comm = new SqlCommand("SELECT [Greeting] FROM [Misc]", conn);
        try        {            conn.Open();        }        catch        {            Response.Write("Error opening connection in Page_Load of default.aspx to retrieve the greetings");        }
        string MyGreet = (string)comm.ExecuteScalar();
        Greetings.Text = MyGreet;
        try        {            conn.Close();        }        catch        {            Response.Write("Error closing connection in Page_Load of default.aspx after retrieving the greetings");        }        }
When it gests to conn.Open() in the debugging mode I see that the ServerVersion = 'conn.ServerVersion' threw an exception of type 'System.InvalidOperationException'.
The most interesting thing is that it used to work before.
Here is the connection string it retrieves fine.
"Data Source=MDM1;AttachDbFilename=|DataDirectory|Ukraine.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"
 As I said it used to work, but one day I tried to access the web site and it said this error that I get, that the connection is closed. Then I was using the SQL Server Express. When in the Visual studio if I would run this same site in debug, everything was working fine. I decided to uninstall the SQL Express and installed the SQL Server.
If I open the SQL Server Managment Studio in the Server name field I see MDM1(this is the name of the PC, but probably it is the same name for the Server. Well, in the MAnagment Studio it conects fine to the MDM1 so it is no probably the naming problem. Ithink it has something to do with permisssions.
If someon can - please help. Thanks.

View 3 Replies View Related

Recordset Opens As Read-only -- WHY??

Jul 20, 2005

Hello,I have a C++ / MFC app which uses CDatabase and CRecordset to connect to aODBC data source for a SQL Server 7 database. The application workedproperly with a MySQL database, but after swapping it for SQL Serverproblems emerged. In particular, any calls to CRecordset::AddNew() andCRecordset::Edit() cause an exception to be thrown with the error message"Recordset is read-only". Stepping through the code for CRecordset::Open(),I can see that it indeeds fail to open the recordset with SQL_CONCUR_ROWVERand SQL_CONCUR_LOCK, finally succeeding with SQL_CONCUR_READ_ONLY. I need tobe able to write to the db!! What is going on here??I call CRecordset::Open() with no SQL string and no options (which defaultsto full access and not read-only).I am not a SQL Server expert, but I tried playing with the config a littlebit:- The database is NOT set for read-only.- The database option "Restrict Access" is NOT selected.- I checkmarked all permissions (SELECT, INSERT, UPDATE, DELETE, DRI)for my app's user on all tables in the db.- My connection string uses the user 'sa', which is the login name forthe user 'dbo'.In the ODBC data source config, I set authentication to SQL Serverauthentication, and accepted the default for all the other options.I haven't tried using a different class (say, CDaoRecordset) nor do I planon doing that. I really need to get this to work with CRecordset. Any helpis appreciated.Thanks,SL

View 3 Replies View Related

Outlook 2003 Closes When You Press Print?

Oct 24, 2006

when you press print in outlook 2003, outlook closes.

Any Help?



View 4 Replies View Related

Option: A Link Opens A New Window.

Apr 13, 2007

Hello :


I have a report which calls another report, and I want that everything the links clickable on my reports open one new
window.

I know that there is a way of defining that C# but I managed to make it walked.

Is that you an idea to say that I want everything click on my report call another report but in a new window.





Thank's.

View 1 Replies View Related

Visual Studio Closes When Data Source Has Changed

Aug 22, 2007

I am trying to edit an SSIS package due to a change in the schema of one of the source tables. When I open the package in Visual Studio, I see the exclamation mark on the object but before I can make change or go to edit anything in the package, I hear the "dumphhh" sound that indicates an error. There is no dialogue box but the program is now locked up. Then after 10 - 20 seconds the program closes.

How am i supposed to add the new column to the data source metadata if I can't edit the package?

View 7 Replies View Related

Help Needed Convert A Blank In Char To Blank In Float

Apr 29, 2008

Hi,

I receive blanks for a column called value and i need to represent it as a blank or NA into a colum whose datatype is float in the datawarehouse.

how is this possible because in current schenario a blank is being converted to 0
which is not the right thing.

i would like to retain the blank in conversion from char to float ,

please explain me if it can be done or how to overcome this issue.

Thanks

View 1 Replies View Related

Report Builder Button Opens XML File?

Nov 26, 2013

several months ago I briefly set up a data source, tested it and created a very simple report.

I now have an chance to get back into it and when I am at the SSRS Home page and click the button to start "Report Builder I get the yellow bar at the bottom of the page like I'm trying to open a file. It says: "Do you Want to open or save ReportBuilder_3_0_0_0_0.appliation(15.2 KB) from caholoweckyw7" and then the Open, Save and Cancel buttons. If I click open, the actual XML code behind the page appears and the application does not start. ?

The data source has been created and the connection has been tested successfully. I am running SQL Server 2012 and Windows 7 and IE 9.

View 4 Replies View Related

ADS Opens Folder On Users PC When Active Sync Connects

May 12, 2008

Is there anyway to disable this functionality?

View 7 Replies View Related

Visual Studio Closes When Accessing The Columns Tab Of A Lookup Transformation Referencing SQL 7 Table

Jul 30, 2007

I'm creating a new Integration Services Project that copies data out of a SQL 7 server, transforms it, and places the data on a SQL 2005 (SP 2) Server. When defining a lookup transformation, if I specify an OLE DB Connection to my server running SQL 7 as the reference table, as soon as I click on the Colums tab, Visual Studio closes / crashes and dumps me to windows. I don't get an error message. If however I specify a connection to a server running SQL 8, or SQL 2005, no problems.

Is this supposed to happen?

My workstation is running Windows XP Pro SP2, Visual Studio 2005 Pro.

Microsoft SQL Server Integration Services Designer
Version 9.00.1399.00

The server that doesn't work for a reference table is running Windows 2000 Server SP4
SQL 7.00.623


Thanks for your help,
Kirk

View 6 Replies View Related

SQL Server 2012 :: Modify Stored Procedure Opens Does Not Open For Modifications As Earlier

Jan 5, 2015

when i click on the modify option on a stored procedure it is not opening for editing as earlier. it opens as if for scripting.for example i clicked modify procedure on stored proc. "text" and the result is as follows.

/****** Object: StoredProcedure [dbo].[test] Script Date: 05/01/2015 7:50:08 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[test]') AND type in (N'P', N'PC'))

[code]....

View 4 Replies View Related

SQLCMD

May 4, 2007

I cannot get SQLCMD to run. When I run it, it appears for a few seconds then dissappears. I tried running it in cmd and it says it cannot run because the default setting for SQL server does not allow remote connections. Please help.

View 11 Replies View Related

SQLCMD

May 2, 2008

When connecting to SQL using the SQLCMD
Is there a way to do a select and it output in DOS mode...

Even have the message return - completed just as if you were in sql query.

View 1 Replies View Related

SQLCMD

May 22, 2008



Hello,

Does anyone know how to execute a stored procedure in a SQLCMD script? Here is what I have so far and it doesn't seem to be working...

:r $(rootPath)"Script.sql"
GO
exec sp_Proc
GO


Also,

Is there a way that I can pass the $(rootpath) as a parameter in my stored proc?

Thanks!

View 3 Replies View Related

SQLCMD.exe

Feb 21, 2008



I am trying to backup/restore a sql db using sqlcmd. My question is, the box that I am trying to run sqlcmd on does not have SQL server 2005 installed, can I just copy SQLCMD.exe to the box instead of Installing it? if so, are there any other files that I need to copy as well?

I have another instance where I was trying to backup/restore a 2000 sql db and all I did was copy the osql.exe and resource files to the box and was able to run this command with out installing SQL server 2000. So, did something change with SQL serve 2005?

Thanks for any suggestions

View 6 Replies View Related

Need Example -- SQLCMD -y

Aug 23, 2006

Hi,

Please can any one let me know jhow to use -y option with SQLCMD.







View 11 Replies View Related

Sqlcmd Syntax

Jul 20, 2007

How can I use sqlcmd to execute a simple stored procedure, I dont need to pass parameters in or out, its just for backups.

Thanks

View 2 Replies View Related

Sqlcmd Question

Mar 3, 2008

Greetings all!

i am using the follownig sqlcmd command to output some data :

sqlcmd -E -S myServermyInstance -s "," -W -d myDB -Q " set nocount on select ltrim('""' + cast(PersonId as varchar) +
'-' + cast(DatabaseId as varchar) + '""') as 'URN-DBID','""' + EmailAddress + '""' as EmailAddress from myDB.dbo.myTable where
DTS > dateadd(dd, -7, getdate()) set nocount off " > "\tfsvrCompanyDatabase DevelopmentTestReports"myRecords-20080303.txt

The output looks something like this :

URN-DBID,EmailAddress
--------,------------
"5-1","blahblah@HOTMAIL.COM"
"264541-1","blahblah@HOTMAIL.COM"
"1107457-1","blahblah@HOTMAIL.COM"
"6133752-1","blahblah@HOTMAIL.COM"

Is it possible to keep the headnigs but remove the dashed line?

Your help would be much appreciated.

View 5 Replies View Related

Sqlcmd Question

Mar 3, 2008

Greetings all!

i am using the follownig sqlcmd command to output some data :


sqlcmd -E -S myServermyInstance -s "," -W -d myDB -Q " set nocount on select ltrim('""' + cast(PersonId as varchar) +
'-' + cast(DatabaseId as varchar) + '""') as 'URN-DBID','""' + EmailAddress + '""' as EmailAddress from myDB.dbo.myTable where
DTS > dateadd(dd, -7, getdate()) set nocount off " > "\mynetworkdrivemyCompanymyDatabase DevelopmentmyTestReports"myRecords-20080303.txt


The output looks something like this :

URN-DBID,EmailAddress
--------,------------
"5-1","blahblah@HOTMAIL.COM"
"264541-1","blahblah@HOTMAIL.COM"
"1107457-1","blahblah@HOTMAIL.COM"
"6133752-1","blahblah@HOTMAIL.COM"

Is it possible to keep the headnigs but remove the dashed line?


Your help would be much appreciated.

View 4 Replies View Related

Sqlcmd - View

Mar 21, 2006

how can i change the view in sqlcmd?

such as changing the font or the window size so that a command such as sp_tables will list on one row rather than several. Also I would only like to see 10 records or so at the same time. Currently in default setting, if i run sp_tables I can really only view the last few records.

thanks!

View 1 Replies View Related

What Is The Alternative To Go Under Sqlcmd?

Oct 8, 2006

Hi

I found it a bit annoying to type Go after some very simple query and I wonder is there a short cut to execute the query i type right after I press enter?

1> select * from Table
2> go <enter>

instead, how to you execute line 1 without entering go?

Thank you

View 7 Replies View Related

Backups From SQLcmd ??

Nov 9, 2006

I am working with SQL Express and found myself surprised when I tried to automate a backup... No Agent.

So I am trying to create a simple backup script to run from the command line and probably schedule through the scheduled task manager.

here is my problem. I get the following error :

Msg 2812, Level 16, State 62, Server FIREFLYSQLEXPRESS, Line 1
Could not find stored procedure 'B'.

Here is the batch file

sqlcmd -i c: emp estDBbackup.sql -o c: emp estoutput.txt -S FIREFLYSQLEXPRESS

And here is the sql input file :

BACKUP DATABASE [DNNDEV] TO DISK = 'C: emp estdnndev.bak' WITH NOFORMAT, NOINIT, NAME = 'dnndev-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10;

If I put a USE statement in front of my backup statement - the error message changes to

Could not find stored procedure 'U'.

So it would appear to list the first character encountered.

As a sanity check I created a similar process which does a select * from a table and I do not get an error saying :Could not find stored procedure 'S'. - instead all is well and I get my output and no error

If I try the backup command in SQLCMD interactively it works.

so what the heck am I missing ?

Thank you for any help...

View 4 Replies View Related

SQLCMD Error

Apr 14, 2008

Dear profetionlas:
I cannot run sqlcmd in my computer but i can connect to my SQL Server2005 through SSIS
This is the error I see .
Please give me some recommandation


C:Documents and Settings est>sqlcmd
HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.


I would like also metion that
1)windows firewall is off
2)All SQL server Services are running
3)This is my default instance also I have another named instance in the server

View 4 Replies View Related

Sqlcmd Not Recognized

Oct 9, 2006

Just installed SQL Server 2005 Express along with the Management Studio. The Management Studio, at least what I've seen so far, seems to work fine. But when I type "sqlcmd" at the command prompt, I get "sqlcmd is not a recognized internal or external command, operable program or batch file." What gives???

View 4 Replies View Related

SQLCMD Wont Start

Mar 1, 2008

 GreetingsI'm trying to follow the tutorial at http://www.asp.net/Guided%2DTour/s2.aspx  Part way through the demo it asks me to run the following command as part of building  a Demo web page access SQL  dataC:Program FilesMicrosoft SQL Server90ToolsinnSQLCMD"
-S "machine-nameSqlExpress"  I am then supposed to  paste  some script into  that window, but cant  get  that  far. The black Command window opens, but the SQL > prompt doesn't appear, and  the  window closes. I had previously installed a demo version of Web  Developer Express from my Action  Pack,  on a SBS Server  Premium 2003 R2, clean installation. When I got to the  above step  in the  demo there was no ...90Toolsinn folder so, I uninstalled the  Action  Pack version and the versions of  SQL server that  looked like they  did not belong to the  original  SBS Server installation.  I then downloaded the version from Microsofts website, and selected .Net SP1 and SQL Server  Express ( or lite or whatever it's called )  that were part of the  install dialog box. When checking  for  updates, the .NET  SP1 and  Visual Studio SP1 initial  failed. Rebooting  installed  .Net  SP1, but  I had  to do  a hard reboot as the  installation still wasn't  complete after 2 hours. I  assumed it was hung. After  restarting, I was  able  to go to  MSUpdates and  the  installation was successful.Currently the add remove programs shows  a ton of  SQL stuff, ..I'm guessing we  have  version conflicts or something  but I don't know.. Microsoft  SQL Server 2005Microsoft SQL Server Desktop engine  "                             Native Client  "                             Setup Support files  "                             VSS Writer Visual  Studio  seems to  run okay, but I  would  like to  be able to do SQL  database  part of the  tutorial, since I  don't know  much  about it as you can tell, and I would like to see it work with web sites. TimeTraveller    

View 1 Replies View Related

Fail To Connect Using Sqlcmd

May 15, 2008

Hi !
I try to connect to a database on my localhost using sqlcmd. For the records: Remote connections are allowed ! I don't have any issues to establish a connection using SSMS.

S:DBWorkFolder>sqlcmd -U razorblade -P xxxxx -S localhostzen_dev4

This is what I get:

HResult 0xFFFFFFFF, Level 16, State 1
SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

Any help appreciated !

Thanks: Peter

View 1 Replies View Related

Sqlcmd And Escape Characters

Nov 22, 2007

The command below runs fine from within Management Studioexec sp_MSforeachtable @command1="exec sp_spaceused '?' "However, I'd like to run it via sqlcmd. I've tried variouscombinations of escaping the doulbe and single quotes but withoutsuccess.sqlcmd -E -Q "sp_MSforeachtable @command1="exec sp_spaceused '?'""Sqlcmd: 'exec sp_spaceused '?'""': Unexpected argument. Enter '-?'for help.Any ideas?Thanks,M

View 2 Replies View Related

Problem In Mirroring When Using SQLCMD

May 4, 2007

Dear all,

I'm having a problem with configure Mirroring. When I use graphical inteface to config the Mirror, it is ok. But when using sql, there are an error that I can not understand.

Here is the code:

ETVAR PrincipalServer DEMOPARTNERA
ETVAR MirrorServer DEMOPARTNERB
ETVAR WitnessServer DEMOWITNESS
ETVAR Database2Mirror AdventureWorksDW
go

N ERROR EXIT
go

:CONNECT $(PrincipalServer)

-- Mirroring ONLY supports the FULL Recovery Model
ALTER DATABASE $(Database2Mirror)
SET RECOVERY FULL
go

USE $(Database2Mirror)
go

CREATE ENDPOINT Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5022)
FOR DATABASE_MIRRORING (ROLE=PARTNER)
GO

:CONNECT $(MirrorServer)

CREATE ENDPOINT Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5023)
FOR DATABASE_MIRRORING (ROLE=PARTNER)
GO

:CONNECT $(WitnessServer)

CREATE ENDPOINT Mirroring
STATE=STARTED
AS TCP (LISTENER_PORT=5024)
FOR DATABASE_MIRRORING (ROLE=WITNESS)
GO

:CONNECT $(PrincipalServer)

BACKUP DATABASE $(Database2Mirror)
TO DISK = 'C:TechReady$(Database2Mirror).bak'
WITH INIT
GO

:CONNECT $(MirrorServer)

DECLARE @InstanceName sql_variant,
@InstanceDir sql_variant,
@SQLDataRoot nvarchar(512),
@ExecStr nvarchar(max)

SELECT @InstanceName = ISNULL(SERVERPROPERTY('InstanceName'), 'MSSQLServer')

EXECUTE master.dbo.xp_regread 'HKEY_LOCAL_MACHINE',
'SOFTWAREMicrosoftMicrosoft SQL ServerInstance NamesSQL',
@InstanceName, @InstanceDir OUTPUT

SELECT @ExecStr = 'EXECUTE master.dbo.xp_regread '
+ '''HKEY_LOCAL_MACHINE'', '
+ '''SOFTWAREMicrosoftMicrosoft SQL Server'
+ convert(varchar, @InstanceDir)
+ 'Setup'', ''SQLDataRoot'', @SQLDataRoot OUTPUT'

EXEC master.dbo.sp_executesql @ExecStr
, N'@SQLDataRoot nvarchar(512) OUTPUT'
, @SQLDataRoot OUTPUT

IF @SQLDataRoot IS NULL
BEGIN
RAISERROR ('Did not find the correct SQL Data Root Directory. Cannot proceed. Databases backed up but not yet restored.', 16, -1)
END

CREATE TABLE #BackupFileList
( LogicalName sysname NULL
, PhysicalName sysname NULL
, [Type] char(1)
, FileGroupName sysname NULL
, Size bigint
, MaxSize bigint
, FileId smallint
, CreateLSN numeric(25,0)
, DropLSN numeric(25,0)
, UniqueId uniqueidentifier
, ReadOnlyLSN numeric(25,0)
, ReadWriteLSN numeric(25,0)
, BackupSizeInBytes bigint
, SourceBlockSize bigint
, FileGroupId smallint
, LogGroupGUID uniqueidentifier
, DifferentialBaseLSN numeric(25,0)
, DifferentialBaseGUID uniqueidentifier
, IsReadOnly bit
, IsPresent bit
)

INSERT #BackupFileList
EXEC('LOAD FILELISTONLY FROM DISK = ''C:TechReady$(Database2Mirror).bak''')

UPDATE #BackupFileList
SET PhysicalName
= @SQLDataRoot
+ N'Data'
+ REVERSE(SUBSTRING(REVERSE(PhysicalName)
, 1, PATINDEX('%\%', REVERSE(PhysicalName)) -1))

DECLARE @LogicalName sysname
, @PhysicalName sysname

DECLARE FileListCursor CURSOR FAST_FORWARD FOR
SELECT LogicalName, PhysicalName
FROM #BackupFileList

OPEN FileListCursor

FETCH NEXT FROM FileListCursor INTO @LogicalName, @PhysicalName

SELECT @ExecStr = N'RESTORE DATABASE $(Database2Mirror)' +
N' FROM DISK = ''c:TechReady$(Database2Mirror).bak''' +
N' WITH MOVE ''' + @LogicalName + N''' TO ''' + @PhysicalName + N''''

FETCH NEXT FROM FileListCursor INTO @LogicalName, @PhysicalName

WHILE @@FETCH_STATUS <> -1
BEGIN
SELECT @ExecStr = @ExecStr + N', MOVE ''' + @LogicalName
+ ''' TO ''' + @PhysicalName + ''''
FETCH NEXT FROM FileListCursor INTO @LogicalName, @PhysicalName
END

-- NORECOVERY is required for Database Mirroring, replace is not.
-- Replace is used here solely to allow repetitive use of this script.
SELECT @ExecStr = @ExecStr + N' , NORECOVERY, REPLACE'

-- Useful for testing
-- Only return the string and then comment out the EXEC line below.
-- SELECT @ExecStr

EXEC (@ExecStr)

DEALLOCATE FileListCursor
GO

:CONNECT $(PrincipalServer)
SELECT DATABASEPROPERTYEX(N'$(Database2Mirror)', N'Status') -- Returns ONLINE
SELECT db_name(sd.[database_id]) AS [Database Name],
sd.mirroring_guid,
sd.mirroring_state,
sd.mirroring_state_desc,
sd.mirroring_partner_name,
sd.mirroring_witness_name,
sd.mirroring_witness_state,
sd.mirroring_witness_state_desc,
sd.mirroring_role,
sd.mirroring_role_desc,
sd.mirroring_role_sequence,
sd.mirroring_safety_level,
sd.mirroring_safety_level_desc,
sd.mirroring_safety_sequence,
sd.mirroring_failover_lsn
FROM sys.database_mirroring AS sd
WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')
go

:CONNECT $(MirrorServer)
SELECT DATABASEPROPERTYEX(N'$(Database2Mirror)', N'Status') -- Returns RESTORING
SELECT db_name(sd.[database_id]) AS [Database Name],
sd.mirroring_guid,
sd.mirroring_state,
sd.mirroring_state_desc,
sd.mirroring_partner_name,
sd.mirroring_witness_name,
sd.mirroring_witness_state,
sd.mirroring_witness_state_desc,
sd.mirroring_role,
sd.mirroring_role_desc,
sd.mirroring_role_sequence,
sd.mirroring_safety_level,
sd.mirroring_safety_level_desc,
sd.mirroring_safety_sequence,
sd.mirroring_failover_lsn
FROM sys.database_mirroring AS sd
WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')
go

:CONNECT $(MirrorServer)

ALTER DATABASE $(Database2Mirror)
SET PARTNER = 'TCP://DEMO:5023'
-- SET PARTNER = 'TCP://Server.fully.qualified.dns.name:5091'
-- SET PARTNER = 'TCP://SQLIDW15HA.redmond.corp.microsoft.com:5091'
GO

:CONNECT $(PrincipalServer)

ALTER DATABASE $(Database2Mirror)
SET PARTNER = 'TCP://DEMO:5022'
-- SET PARTNER = 'TCP://Server.fully.qualified.dns.name:5092'
-- SET PARTNER = 'TCP://SQLIDW15HA.redmond.corp.microsoft.com:5092'
GO

ALTER DATABASE $(Database2Mirror)
SET WITNESS = 'TCP://DEMO:5024'
-- SET WITNESS = 'TCP://Server.fully.qualified.dns.name:5090'
-- SET WITNESS = 'TCP://SQLIDW15HA.redmond.corp.microsoft.com:5090'
GO

SELECT db_name(sd.[database_id]) AS [Database Name],
sd.mirroring_guid,
sd.mirroring_state,
sd.mirroring_state_desc,
sd.mirroring_partner_name,
sd.mirroring_witness_name,
sd.mirroring_witness_state,
sd.mirroring_witness_state_desc,
sd.mirroring_role,
sd.mirroring_role_desc,
sd.mirroring_role_sequence,
sd.mirroring_safety_level,
sd.mirroring_safety_level_desc,
sd.mirroring_safety_sequence,
sd.mirroring_failover_lsn
FROM sys.database_mirroring AS sd
WHERE sd.[database_id] = db_id(N'$(Database2Mirror)')

and the log is:

Msg 1452, Level 16, State 6, Line 3
The partner server instance name must be distinct from the server instance that manages the database. The ALTER DATABASE SET PARTNER command failed.
** An error was encountered during execution of batch. Exiting.

I Think the error is begin at:

ALTER DATABASE $(Database2Mirror)
SET PARTNER = 'TCP://DEMO:5023'
-- SET PARTNER = 'TCP://Server.fully.qualified.dns.name:5091'
-- SET PARTNER = 'TCP://SQLIDW15HA.redmond.corp.microsoft.com:5091'
GO

:CONNECT $(PrincipalServer)

ALTER DATABASE $(Database2Mirror)
SET PARTNER = 'TCP://DEMO:5022'
-- SET PARTNER = 'TCP://Server.fully.qualified.dns.name:5092'
-- SET PARTNER = 'TCP://SQLIDW15HA.redmond.corp.microsoft.com:5092'
GO

ALTER DATABASE $(Database2Mirror)
SET WITNESS = 'TCP://DEMO:5024'
-- SET WITNESS = 'TCP://Server.fully.qualified.dns.name:5090'
-- SET WITNESS = 'TCP://SQLIDW15HA.redmond.corp.microsoft.com:5090'
GO

but I can not find out the solution. Turn back to grafical interface, everything is done

Please help!

View 6 Replies View Related

Sqlcmd.exe Login Problem

Jun 19, 2007

I can Add a connection to the database in VisualStudio 2005 in the Solution Explorer and access the database. Connection string copied from VS "Data Source=.SQLEXPRESS;AttachDbFilename=C:TempMyDB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True".



If i start the command prompt and type:

sqlcmd -SlocalhostSQLEXPRESS -E -d c: empMyDB.mdf



I get the error "Login failed for user 'MyDomainPer'"



As I see it integrated authentication with the same user is used in both cases so they should give the same result. What am I doing wrong?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved