Wednesday, March 28, 2012
Need Help : Connecting Locally
A humble hello to all,
I have spent days trying to simply connect to an instance of SQL Server
2000 SP4 from a program written in C++/CLI using VS C++ 2005 Express. I
originally had SQL server 2000 Dev Ed and SQL Server 2005 Express installed
side by side. I could not connect to either server. I uninstalled both SQL
2005 Express and SQL 2000 Dev Ed, then re-installed SQL SVR 2000 Dev Ed and
applied Service Pack 4. Both the SQL Server 2000 instance and my application
are on the same machine (local). The Server Instance is running and I've
enabled the SQL Server Agent, DTC, and OLAP just for good measure. yes, I'm
very new to SQL server and it's various services, etc. and I'm totally lost
and loosing hair. I've included my code and the settings in SQL Enterprise
Manager and Client Network Utility below. If more information is needed, I'l
l
post it. Any help will be greatly appreciated.
TIA,
M
***Code***
(System, System.data, System.XML referenced}
using namespace System;
using namespace System::Data;
using namespace System::Data::SqlClient;
int main(array<System::String ^> ^args)
{
SqlConnection ^ connection = gcnew SqlConnection();
//Windows Integrated Security
connection->ConnectionString =
"Persist Security Info=False;Integrated Security=SSPI;"
"Server= COMP\DEV_SQL;Data Source=(local);"
"Initial Catalog=My_DB;";
{note: tried with and w/o Server clause}
try {
connection->Open();
Console::WriteLine(L"Connected!");
}
catch (SqlException ^ e) {
Console::WriteLine(L"Not Connected : {0}", e->Message);
}
finally {
connection->Close();
Console::WriteLine(L"Connection Closed");
}
return 0;
}
***OUTPUT *** (both Debug and Release Compile)
Not Connected : 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. (provider: Named Pipes Provider, error: 40 - Could not open a
connection to SQL Server)
Connection Closed
{note: error always says SQL server 2005, not SQL Server 2000}
***SQL Server Enterprise Manager Settings***
General Tab -
ServerName : COMP\DEV_SQL
Prod: SQL Developer Edition
OS : Windows NT - 5.1 (2600) {WinXP Pro running}
Prod Ver: 8.00.2039 (SP4)
Autostart policies when OS starts: SQL Server checked
Startup Parameters:
-e C:\.MSSQL$DEV_SQL\data\master.mdf
-d C:\.MSSQL$DEV_SQL\log\ERRORLOG
-I C:\.MSSQL$DEV_SQL\data\mastlog.ldf
Network Configuration:
Protocols: Named Pipes and TCP/IP enabled
Network Libraries: Named Pipes, TCP/IP, NWLink, VIA(Giganet, Qlogic,
Server Net II)
{all Network Libraries are version 8.00.2039}
Memory Tab -
Dynamically configure SQL memory selected : min 0, max 503MB
Reserve physical memory for SQL Server: Not Checked
Minimum query memory: 1024 KB
{Configured values selected}
Processor Tab -
Processor Control:
Maximum number of worker threads :255
Boost SQL Server priority: Not Checked
Use WinNT Fibers: Not Checked
Parallelism:
Use all available processors: Selected
Minimum query plan threshold : 5
{Configured values selected}
Security Tab -
Authentication: Windows Only
Audit Level: None
Cross-database Ownership Chaining: Not Checked
Startup Service Account : System Account
Connections Tab -
Maximum concurrent user connections: 0 (unlimited)
Default connection options: No Options Checked
Remote Server Connections:
Allow remote servers to connect using RPC: Not Checked
Query time-out: 600 seconds
Enforce distributed transactions (MTS): Not Checked
{Configured values selected}
Server Settings Tab -
Default language: English
Server Behavior :
Allow modifications directly to catalog: Not Checked
Nested Triggers: Checked
Use query governor: Not Checked
SQL Mail Profile: Blank (not setup yet)
2 digit year support: 1950-2049
{Configured values selected}
Database Settings Tab -
Default index fill factor -
Fixed: Not Checked
Backup and Restore -
Timeout period: Wait Indefinitely selected
Default backup media retention: 0 days
Recovery -
Recovery Interval: 0 min
New Database Default Location
Data Directory: Blank (not filled in)
Log Directory: Blank (not filled in)
{Configured values selected}
Replication Tab -
Publishing and distribution : COMP\DEV_SQL is not configured for either
***SQL Server Client Network Utility***
General Tab -
Enabled Protocols: Named Pipes. TCP/IP
Force Protocol Encryption: Not Checked
Enable Shared Memory Protocol: Checked!
Alias Tab -
No Aliases are configured
DB-Library Options Tab -
DB-Library Information: Windows\System32\NTWDBLIB.DLL, version 8.00.2039
Automatic ANSI to OEM conversion: Checked
Use International Settings: Checked
Network Libraries Tab -
Named Pipes, TCP/IP, Multiprotocol, NWLink, VIA (Giganet, Qlogic)
{Note: these libraries are located in System32 directory and are versio
n
8.0.341 while the Enterprise Manager Network Libraries are located in
MSSQL$Dev_2000\binn directory and are version 8.0.2039}
***SQL Server Enterprise Manager Settings***
General Tab -
ServerName : COMP\DEV_SQL
Prod: SQL Developer Edition
OS : Windows NT - 5.1 (2600) {WinXP Pro running}
Prod Ver: 8.00.2039 (SP4)
Autostart policies when OS starts: SQL Server checked
Startup Parameters:
-e C:\.MSSQL$DEV_SQL\data\master.mdf
-d C:\.MSSQL$DEV_SQL\log\ERRORLOG
-I C:\.MSSQL$DEV_SQL\data\mastlog.ldf
Network Configuration:
Protocols: Named Pipes and TCP/IP enabled
Network Libraries: Named Pipes, TCP/IP, NWLink, VIA(Giganet, Qlogic,
Server Net II)
{all Network Libraries are version 8.00.2039}
Memory Tab -
Dynamically configure SQL memory selected : min 0, max 503MB
Reserve physical memory for SQL Server: Not Checked
Minimum query memory: 1024 KB
{Configured values selected}
Processor Tab -
Processor Control:
Maximum number of worker threads :255
Boost SQL Server priority: Not Checked
Use WinNT Fibers: Not Checked
Parallelism:
Use all available processors: Selected
Minimum query plan threshold : 5
{Configured values selected}
Security Tab -
Authentication: Windows Only
Audit Level: None
Cross-database Ownership Chaining: Not Checked
Startup Service Account : System Account
Connections Tab -
Maximum concurrent user connections: 0 (unlimited)
Default connection options: No Options Checked
Remote Server Connections:
Allow remote servers to connect using RPC: Not Checked
Query time-out: 600 seconds
Enforce distributed transactions (MTS): Not Checked
{Configured values selected}
Server Settings Tab -
Default language: English
Server Behavior :
Allow modifications directly to catalog: Not Checked
Nested Triggers: Checked
Use query governor: Not Checked
SQL Mail Profile: Blank (not setup yet)
2 digit year support: 1950-2049
{Configured values selected}
Database Settings Tab -
Default index fill factor -
Fixed: Not Checked
Backup and Restore -
Timeout period: Wait Indefinitely selected
Default backup media retention: 0 days
Recovery -
Recovery Interval: 0 min
New Database Default Location
Data Directory: Blank (not filled in)
Log Directory: Blank (not filled in)
{Configured values selected}
Replication Tab -
Publishing and distribution : COMP\DEV_SQL is not configured for either
***SQL Server Client Network Utility***
General Tab -
Enabled Protocols: Named Pipes. TCP/IP
Force Protocol Encryption: Not Checked
Enable Shared Memory Protocol: Checked!
Alias Tab -
No Aliases are configured
DB-Library Options Tab -
DB-Library Information: Windows\System32\NTWDBLIB.DLL, version 8.00.2039
Automatic ANSI to OEM conversion: Checked
Use International Settings: Checked
Network Libraries Tab -
Named Pipes, TCP/IP, Multiprotocol, NWLink, VIA (Giganet, Qlogic)
{Note: these libraries are located in System32 directory and are versio
n
8.0.341 while the Enterprise Manager Network Libraries are located in
MSSQL$Dev_2000\binn directory and are version 8.0.2039}Micus (NoEmail@.Nowhere.org) writes:
> "Persist Security Info=False;Integrated Security=SSPI;"
> "Server= COMP\DEV_SQL;Data Source=(local);"
> "Initial Catalog=My_DB;";
> {note: tried with and w/o Server clause}
Try removing the Data Source bit. Data Source and Server are the same
thing. But Data Source points to a default instance, and apparently
you SQL 2000 instance is a named instance.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns9802EF6B6F50DYazorman@.127.0.0.1...
> Micus (NoEmail@.Nowhere.org) writes:
> Try removing the Data Source bit. Data Source and Server are the same
> thing. But Data Source points to a default instance, and apparently
> you SQL 2000 instance is a named instance.
Erland,
I removed the Data Source clause and received the same error message.
Anything else you can think of to try, I'll plug it in and run it.
Thank you,
- M
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Micus (no@.way) writes:
> "Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
> news:Xns9802EF6B6F50DYazorman@.127.0.0.1...
> Erland,
> I removed the Data Source clause and received the same error message.
> Anything else you can think of to try, I'll plug it in and run it.
When I think of it, don't you need to double the \ in the string? It also
looks funny that there are no concatenation operators, but it may be this
CLI thing you mentioned, that I don't know what it is.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns98036703E5193Yazorman@.127.0.0.1...
> Micus (no@.way) writes:
[vbcol=seagreen]
> When I think of it, don't you need to double the \ in the string? It also
> looks funny that there are no concatenation operators, but it may be this
> CLI thing you mentioned, that I don't know what it is.
>
I'm embarrassed... I got so wound up in installing SQL Server(both 2005
Express and 2000) and playing with the Server Explorer (VS.NET 2003), that I
didn't even notice a very basic string rule had been violated. You are
correct that the '' character is \\ in a string. No concatenation operators
are necessary. After playing around a little, the following connection
string worked.
"Persist Security Info=False;Integrated Security=SSPI;"
"Data Source=COMP\\DEV_SQL;" //or "Server=COMP\\DEV_SQL;" also worked
"Initial Catalog=My_DB;
Once again, sleep deprivation has given me a swift kick in the pants!
Thanks for your help,
M
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/pr...oads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hello,
I too am having a problem connecting to a Remote SQL Server 2000 database
from the SQL Server Express Edition Management Studio. The connection fails
with the following error:
TITLE: Connect to Database Engine
--
Cannot connect to INLD50045677A.
ADDITIONAL INFORMATION:
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.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to
SQL Server) (Microsoft SQL Server, Error: 1326)
For help, click:
http://go.microsoft.com/fwlink?Prod...26&LinkId=20476
BUTTONS:
OK
--
Do I need to make any additional settings. AFAIR, there was no such setting
required in 2000. Am I missing anything here?
Regards,
Niranjan|||On Wed, 30 Aug 2006 02:25:01 -0700, Niranjan wrote:
>Hello,
>I too am having a problem connecting to a Remote SQL Server 2000 database
>from the SQL Server Express Edition Management Studio. The connection fails
>with the following error:
(snip)
>Do I need to make any additional settings. AFAIR, there was no such setting
>required in 2000. Am I missing anything here?
Hi Niranjan,
Indeed. Fr security reasons, SQL Server 2005 is configured to not allow
outside connections by default.
To enable outside connections, start the Surface Area Configuration tool
(Start / All Programs / Microsoft SQL Server 2005 / Configuration Tools
/ SQL Server Surface Area Coonfiguration), click Service Area
Configuration for Services and Connections, select the {instancename} /
Database Engine / Remote Connections entry and change the setting from
"Local connections only" to "Local and remote connections". Then, check
if you want to allow TCP/IP only, named pipes only, or both. Click OK,
close the Surfacce Area Configuration tool and restart the instance.
Hugo Kornelis, SQL Server MVP
Saturday, February 25, 2012
Need a good insert statement
to crack this nut, and I guess I am finally stuck.
I have a table with financial data like invoices. The tables are huge.
Hundreds of millions of rows per year.
I want to store some additional information related to gambling in one of
these tables.
I want to put this new data way off in the corner of the table temporarily
until I am able to come back to work.
For reasons that are private, I do not want to create a new table.
So if I could stick this information out starting at say row 104,000 and
column 333,000 that would be great. No one's going to look there. And if
they do it will look like some kind of mistake. I can't figure out how to
get the data there.
Any good Ideas would naturally be of great help. Also, since I am in sort of
a hurry (tax day is april 15) I would really appreciate it if I could just
get some of those "only the quality answers." I know a lot of people like to
yik yak, but I just need da facts. Thanks a lot!Hi
I'm not sure I understand you. Do you want to add additional column? If you
do , use ALTER TABLE TableName ADD Column.....
If you want to do paging I'd recomend you vist Aaron's web site
www.aspfaq.com .
"TargetBleigh" <ddsd*
news:2c6dnRzmUNP2ec3fRVn-1g@.comcast.com...
> Hi, I need some help. I've spent nearly a w
trying
> to crack this nut, and I guess I am finally stuck.
> I have a table with financial data like invoices. The tables are huge.
> Hundreds of millions of rows per year.
> I want to store some additional information related to gambling in one of
> these tables.
> I want to put this new data way off in the corner of the table temporarily
> until I am able to come back to work.
> For reasons that are private, I do not want to create a new table.
> So if I could stick this information out starting at say row 104,000 and
> column 333,000 that would be great. No one's going to look there. And if
> they do it will look like some kind of mistake. I can't figure out how to
> get the data there.
> Any good Ideas would naturally be of great help. Also, since I am in sort
of
> a hurry (tax day is april 15) I would really appreciate it if I could just
> get some of those "only the quality answers." I know a lot of people like
to
> yik yak, but I just need da facts. Thanks a lot!
>
Monday, February 20, 2012
Navigation buttons Dimmed
Anyone know why my navigation buttons on my reports is always dimmed so that I can only see the very first page of every report? I even spent some time with a Microsoft SQL Server engineer trying to figure this one out and he wasn't able to figure out why?
I tried to attach a picture but I guess pictures aren't allowed. The first page, previous page, next page and last page buttons displayed as arrows on the top left of the reports are always dimmed on every report even though they have multiple pages.
Has this happened to anyone and how did you get it fixed?
Thanks
Anybody?|||Hello,
Between the navigation buttons, does it show "1 of 1", or does it show the actual page count for the second number? Can you manually type in another page number and navigate that way?
Jarret
|||It's completely dimmed. In other words, I can't even type in a page number. It says "of 0". To make it even more interesting, if I go to the report from http://machineName/reportserver instead of http://machineName/reports; it works fine. There are 44 pages.
This has got me completely baffled.
|||Bump. I guess I'm going to have to use another of my MSDN phone incidences? I guess no one else has run into this problem?