0

I'm currently running SQL Server 2014 and we have some tables that have been partitioned and I'm trying to use the ManagePartition application here (http://sqlpartitionmgmt.codeplex.com/)

I've typed into the command line:

C:\>ManagePartition.exe /C:CreateStagingFull /d:<Databasename> /s:<schema> 
                        /t:<TableName> /p:5 /A:<NewTablename> /f:C:/scripts.sql 
                        /O:i /U:<My Login> /P:/<My Password>

And I'm getting the following error:

ConnectionFailureException: Failed to connect to server (local). ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I've doubled checked all the spellings (dbname, schema, table, etc...) and the switches.

What are some things I can do to trouble shoot this (I'm kind of new to table partitioning)?

Or are there other strategies to easily manage/move data from partitioned table to a staging table?

Edit(I missed to the /S: switch)

I'm now getting this error:

System.NullReferenceException: Object reference not set to an instance of an object.
at PartitionManagement.PartitionManager.createStgIndex(Index i, TableViewBase parent)
at PartitionManagement.PartitionManager.createStgNonclusteredIndexes()
at PartitionManagement.PartitionManager.CreateStgIndexes(Boolean createNonClusteredIndexes)
at PartitionManagement.App.Run(AppArgs& parsedArgs)
Object reference not set to an instance of an object.

It did create the new table, with the indexes, constraints(including the partition constraint), but no data.

  • 1
    Where have you specified the server name? Seems like perhaps you have a named instance but this is trying to connect to the default instance (which may not exist or may not be running). – Aaron Bertrand Aug 28 '14 at 14:36
  • @Aaron Bertrand You're correct I missed it. – Chris L Aug 28 '14 at 15:20
2

You are not using the

 /Server:<string>                   /S Server name, default = (local)

Failed to connect to server (local). ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

From the readme page :

ManagePartition
    /Command:<string>       short form /C command, default = CreateStagingFull
    /Server:<string>                   /S Server name, default = (local)
    /User:<string>                     /U User name, default = null
    /Password:<string>                 /P Password, default = null
    /Integrated[+|-]                   /E Integrated Security, default +
    /Database:<string>                 /d Database name
    /Schema:<string>                   /s Schema name – use quotes as delimiter if needed
    /PartitionTable:<string>           /t Partition table name - use quotes as delimiter if needed
    /PartitionNumber:<int>             /p Partition Number
    /PartitionRangeValue:<string>      /v Value string to input to partition function to specify partition number
    /StagingTable:<string>             /A Staging Table Name, default = null
          /ScriptOption:<char>               /O Scripting Option -- i à Include Script, o à Script Only (no execute)
          /ScriptFile:<string>               /f path and name of file for generated TSQL -- if excluded, script any output to stdout
    /Keep[+|-]                         /K Keep Staging Table if ClearPartition, default +

<Command> = ClearPartition | CreateStagingFull | CreateStagingNoindex | CreateStagingClusteredIndex | IndexStaging
  • You're right I missed the server name. I ran into another problem(I edited the question). – Chris L Aug 28 '14 at 15:20
0

Looks like a connectivity issue, nothing to do with portioning per se.

It's saying it can't find the server, is the SQL Service running, is it running on a default port, is the browser service running etc?

It appears to be trying to connect to the default instance on the local machine, is that correct?

If so can you try connecting with sqlcmd.exe to test?

Cheers Mat

  • I missed the server name. Once added I was able to connect and get farther along. – Chris L Aug 28 '14 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.