Showing posts with label quot. Show all posts
Showing posts with label quot. Show all posts

Friday, March 30, 2012

I get "Line 1: Incorrect syntax near ')'." when using SqlClient ExecuteScalar

Hi Marc,

I have a similar problem as mentioned in the first mail of this chain. I am getting Line 202:Incorrect syntax near 'end'" while I try to execute the procedure from my VC++ code using

ExecuteNonQuery method.

can you guide me about solving this issue?

Regards,

Anni

Anni wrote:

Hi Marc,

I have a similar problem as mentioned in the first mail of this chain. I am getting Line 202:Incorrect syntax near 'end'" while I try to execute the procedure from my VC++ code using

ExecuteNonQuery method.

can you guide me about solving this issue?

Regards,

Anni

Hi Anni,

There must be sth wrong in your procedure. Pls paste the whole procedure here and you'll get your answer.

|||Yes, this is just a sql syntax error. Usually it is best to get the sql and try to run it from query analyzer (or SQL Server Management Studio) until you get the syntax correct.

I fixed this problem!

In my SSAS SP1, I received an error msg in Aggregation design wizard "A connection cannot be made. Ensure that the server is running ..." while I was tryng to start "Performance gain reaches%" box. I verified that the local source SQL 2005 sample "AdventureWorksDW" is running without a problem.

Make sure your Analysis Server is running.

Aggregation Design Wizard sends commands to Analysis Server that is running aggregation desing algorithm.

Try and open SQL Management Studio and make sure you can connect to Analysis Server.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

While I tried to connect to Analysis Server in SQL Management Studio, I got an error as following -
* I am sure the service of "SQL Server Analysis Services (MSSQLSERVER)" is started on port 2383.


Quotes:

TITLE: Connect to Server

Cannot connect to localhost.


ADDITIONAL INFORMATION:

A connection cannot be made. Ensure that the server is running. (Microsoft.AnalysisServices.AdomdClient)

DIME protocol error: The required bytes cannot be read from the stream. (Microsoft.AnalysisServices.AdomdClient)


BUTTONS:

OK

|||

Open Service control manager and make sure you've started "SQL Server Analysis Services( MSSQLSERVER)" service. That is in case you installed default instance.

If you installed named instance the service name will contain the instance name.

For troubleshooting connectivity issues you can look at some tips on http://www.sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks a lot.
I had carefully read your posted URL, but I had NOT found a way to solve the problem yet.
(1) In Service control manager, SQL Server Analysis Services (MSSQLSERVER) is started.
(2) In DOS command console, C:/>telnet localhost 2383 , output a blank screen, means that - port 2383 is on listening on localhost.
so that, I am SURE that
- SQL Server Analysis Services (MSSQLSERVER)" is started and listening on port 2383 -
but when I try to connect to Analysis Services in Microsoft SQL Server Management Studio , the error popup:

Frank X. Huang wrote:

TITLE: Connect to Server

Cannot connect to localhost.


ADDITIONAL INFORMATION:

A connection cannot be made. Ensure that the server is running. (Microsoft.AnalysisServices.AdomdClient)

DIME protocol error: The required bytes cannot be read from the stream. (Microsoft.AnalysisServices.AdomdClient)


BUTTONS:

OK

|||

Let's try another thing.

On your server machine:

Create a new text file in one of your folders.

Change the extension of the file from .txt to .udl. Doble click on the file and you'd see data link dialog open up.

Switch to the Provider tab and select "Microsoft OLEDB provider for Analysis Services 90"

Go to the Connection tab and type in the server name for the Data Source. Choose Windows auth.

At this moment you should be able to see list of databases on the server.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

I do like this -

(1) on my server machine(localhost): create a new text file and rename to x.udl;
(2) Double click on the file, and In the popup window which titled "Data Link Properties",
(2.1) In "Provider" tab, I select "Microsoft OLE DB Provider for Analysis Services 9.0",
(2.2) In "Connection" tab, I select "Use Windows NT Integrated security"; Fill "Data Source:" textbox with "localhost"; let "Location:" textbox empty; and then
(2.2.1) if I drop down the list of "Enter the initial catalog to use:", there is an error "An error was encountered in the transport layer." with title "Microsoft Data Link Error".

(2.2.1.1) I have no choice but to click "OK" on the error window, and then another window shows "Login failed. Catalog information cannot be retrieved."
(2.2.2) or, if I click "Test Connection" button, an error show "Test connection failed because of an error in initializing provider. An error was encountered in the transport layer."

Further more, I try some other things -
(1) create a data source with "SQL Native Client"(version 2005.90.2047.00), and then retry all steps.
(2) at step 2.1, I select another Provider "SQL Native Client"(version 2005.90.2047.00); at step 2.2 fill the data source with "localhost"; and then "Test Connection"......It's OK!......or, drop down the database name list, It's OK!.......no error!

By the way, "Database Engine", "Integration Services", and "Reporting Services" are ALL can be connected, ONLY "Analysis Services" CANNOT be connected in the "Microsoft SQL Server Management Studio".

|||(1) I removed and re-installed Microsoft SQL Server 2005 Developer Edition on my Windows XP Professional, yet the error remains.
(2) I, then, downloaded and installed Microsoft SQL Server 2005 SP1, and try again, the error remains.
(3) I also remove and reinstall my Network Interface Card on my IBM ThinkPad, and start all services who can be started on my Operating System, the error remains.
Who can help me, God?|||

Another idea.

This could be a network related. Instead of localhost try to use machine name or IP of your server.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Thanks God! I fixed this problem, but I really do not know how and why?

I will do some experiment and try to find it out (this may take me several hours or days or never), but now, I only list what I did -

(1) There is an error "Could not add the requested component.
The error is: ...."(sorry for lost details) when I try to install Microsoft TCP/IP version 6 on my Network Adapter;

(2) There is an error "Unable to start the MSMQ service. Error Code: 0x433
Error description: The dependency service does not exist or has been marked for deletion. "
and/or "Setup could not copy one or more files. The specific error code is 0x4b8..."
and/or "The MSMQTriggers service cannot be started. Error Code: 0x42C Error Description: The dependency service or group failed to start."
When I removed and try to re-install Message Queuing;

(3.1) To resolve 0x4b8, I running this command:
esentutl /p c:\WINDOWS\security\Database\secedit.sdb

(3.2) To resolve 0x42C, I found a very useful message on Etc. Windows.
http://www.google.com/notebook/public/04097591150171922613/BDT6NIgoQlMDj180h
and running these commands:

net stop msdtc

msdtc -uninstall

go into regedit and delete the key HKLM\Software\Microsoft\MSDTC

msdtc -install

net start msdtc

(3.3) Now, I can continue to re-install Message Queuing.

(4) Check and install Microsoft TCP/IP version 6.

(5) Connect to localhost (Analysis Server) in Microsoft SQL Server Management Studio. It is OK now!

I really don't know how to fixed but I finally fiexed it anyhow! If you doubt whether it meets your case or not, please just take a trial; If you want to contact me, please email to huangxiangyao@.hotmail.com.

|||

Thanks God! I fixed this problem, but I really do not know how and why.

I will do some experiment and try to find it out (this may take me several hours or days or never), but now, I only list what I did -

(1) There is an error "Could not add the requested component.
The error is: ...."(sorry for lost details) when I try to install Microsoft TCP/IP version 6 on my Network Adapter;

(2) There is an error "Unable to start the MSMQ service. Error Code: 0x433
Error description: The dependency service does not exist or has been marked for deletion. "
and/or "Setup could not copy one or more files. The specific error code is 0x4b8..."
and/or "The MSMQTriggers service cannot be started. Error Code: 0x42C Error Description: The dependency service or group failed to start."
When I removed and try to re-install Message Queuing;

(3.1) To resolve 0x4b8, I running this command:
esentutl /p c:\WINDOWS\security\Database\secedit.sdb

(3.2) To resolve 0x42C, I found a very useful message on Etc. Windows.
http://www.google.com/notebook/public/04097591150171922613/BDT6NIgoQlMDj180h
and running these commands:

net stop msdtc

msdtc -uninstall

go into regedit and delete the key HKLM\Software\Microsoft\MSDTC

msdtc -install

net start msdtc

(3.3) Now, I can continue to re-install Message Queuing.

(4) Check and install Microsoft TCP/IP version 6.

(5) Connect to localhost (Analysis Server) in Microsoft SQL Server Management Studio. It is OK now!

I really don't know how to fixed but I finally fiexed it anyhow! If you doubt whether it meets your case or not, please just take a trial; If you want to contact me, please email to huangxiangyao@.hotmail.com. (From 1:00 to 17:00 UTC)

Friday, March 9, 2012

I am not able to connect to SqlServer 2005

Hi All,

I am trying to connect to SqlServer 2005 whihc is running on another machine. But it is giving error. ie.

"

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)

"

this si my connection string information

//SqlConnection cn = new SqlConnection("Server=id03;uid=sa;pwd=infokall;database=TestDB");

SqlConnection cn = new SqlConnection(conn);

SqlCommand cmd = new SqlCommand();

string Value;

string query = sqlInfo.SQL;

cmd.CommandType = CommandType.Text;

cmd.Connection = cn;

cmd.CommandText = query;

if (Convert.ToInt32(cn.State) == 0)

cn.Open();

Value = cmd.ExecuteNonQuery().ToString();

// return Value;

Response.Write(Value);

plz help me out.

Regards

Raju

Have a look at the Screencast "Enable Remote Connections" on my site under the section Screencast > Enable Remote Connections

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

(Great screencast Jens)

Raju,

Another things to keep in mind that this error may also be the result of a firewall blocking traffic. Please see the BOL for instructions on configuring the Windows firewall (http://msdn2.microsoft.com/en-us/library/ms175043.aspx).

Il-Sung.

I am getting Line 202:Incorrect syntax near 'end'"

Hi Marc,

I have a similar problem as mentioned in the first mail of this chain. I am getting Line 202:Incorrect syntax near 'end'" while I try to execute the procedure from my VC++ code using

ExecuteNonQuery method.

can you guide me about solving this issue?

Regards,

Anni

Anni wrote:

Hi Marc,

I have a similar problem as mentioned in the first mail of this chain. I am getting Line 202:Incorrect syntax near 'end'" while I try to execute the procedure from my VC++ code using

ExecuteNonQuery method.

can you guide me about solving this issue?

Regards,

Anni

Hi Anni,

There must be sth wrong in your procedure. Pls paste the whole procedure here and you'll get your answer.

|||Yes, this is just a sql syntax error. Usually it is best to get the sql and try to run it from query analyzer (or SQL Server Management Studio) until you get the syntax correct.

I am getting an error message when I try to print using reporting services: "an error occur

I am getting an error message when I try to print using reporting services: "an error occurred during printing (0x80004005)"

What version are you using.

Under Tools - Options - Programs - Manage Addons do you see RSClient Print Class?

Check if you running the latest service packs.

See this article.

http://support.microsoft.com/default.aspx/kb/907010

cheers,

Andrew

|||We are using SQL Server 2005 Reporting Services. Do we need a hot fix for the 2005 version? If so, do the fix need to be installed on each single workstation using Reporting services; or do Microsoft has a fix at the server level?