Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts

Tuesday, March 27, 2012

Error processing Cube - The syntax for ',' is incorrect.

Hi guys! Could you help me with the next problem:

Failed to build the OLAP cubes. Error: Analysis Services session failed with the following error: Query (1, 10) Parser: The syntax for ',' is incorrect.

I have installed sql2005 sp2, but didn't get much

Pls. help

If you have a new issue, please create a new thread rather than just replying to an old one. You are more likely to get an answer.

It sounds like there might possibly be an extra comma in your MDX script. It looks like it is at character 10 on the first line (that's what the 1,10 means)

Monday, March 26, 2012

error please help

any Idea why i am getting this error?

Server Error in '/endorse' Application.

Incorrect syntax near 'nvarchar'.

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: Incorrect syntax near 'nvarchar'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Incorrect syntax near 'nvarchar'.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +890426 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +767130 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +903 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135 System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +404 System.Web.UI.WebControls.SqlDataSourceView.ExecuteInsert(IDictionary values) +447 System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +72 System.Web.UI.WebControls.DetailsView.HandleInsert(String commandArg, Boolean causesValidation) +390 System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +623 System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source, EventArgs e) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e) +109 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5104



Version Information: Microsoft .NET Framework Version:2.0.50727.1318; ASP.NET Version:2.0.50727.1318

My code is like........

<%@.PageLanguage="VB" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<asp:LoginViewID="LoginView1"runat="server">

<LoggedInTemplate>

<asp:DetailsViewID="DetailsView1"runat="server"AllowPaging="True"AutoGenerateRows="False"

DataKeyNames="id"DataSourceID="SqlDataSource1"Height="50px"Width="125px">

<Fields>

<asp:BoundFieldDataField="RoomNo"HeaderText="RoomNo"SortExpression="RoomNo"/>

<asp:BoundFieldDataField="Name MR"HeaderText="Name MR"SortExpression="Name MR"/>

<asp:BoundFieldDataField="Att Resi"HeaderText="Att Resi"SortExpression="Att Resi"/>

<asp:BoundFieldDataField="Age Sex"HeaderText="Age Sex"SortExpression="Age Sex"/>

<asp:BoundFieldDataField="Adm Date"HeaderText="Adm Date"SortExpression="Adm Date"/>

<asp:BoundFieldDataField="Diagnosis"HeaderText="Diagnosis"SortExpression="Diagnosis"/>

<asp:BoundFieldDataField="Diet IVF"HeaderText="Diet IVF"SortExpression="Diet IVF"/>

<asp:BoundFieldDataField="Medications"HeaderText="Medications"SortExpression="Medications"/>

<asp:BoundFieldDataField="Consults"HeaderText="Consults"SortExpression="Consults"/>

<asp:BoundFieldDataField="Followup"HeaderText="Followup"SortExpression="Followup"/>

<asp:CommandFieldShowDeleteButton="True"ShowEditButton="True"ShowInsertButton="True"/>

</Fields>

</asp:DetailsView>

<asp:SqlDataSourceID="SqlDataSource1"runat="server"ConflictDetection="CompareAllValues"

ConnectionString="<%$ ConnectionStrings:endorseConnectionString1 %>"DeleteCommand="DELETE FROM [endorse] WHERE [id] = @.original_id AND [RoomNo] = @.original_RoomNo AND [Name MR] = @.original_Name_MR AND [Att Resi] = @.original_Att_Resi AND [Age Sex] = @.original_Age_Sex AND [Adm Date] = @.original_Adm_Date AND [Diagnosis] = @.original_Diagnosis AND [Diet IVF] = @.original_Diet_IVF AND [Medications] = @.original_Medications AND [Consults] = @.original_Consults AND [Followup] = @.original_Followup"

InsertCommand="INSERT INTO [endorse] ([RoomNo], [Name MR], [Att Resi], [Age Sex], [Adm Date], [Diagnosis], [Diet IVF], [Medications], [Consults], [Followup]) VALUES (@.RoomNo, @.Name_MR, @.Att_Resi, @.Age_Sex, @.Adm_Date, @.Diagnosis, @.Diet_IVF, @.Medications, @.Consults, @.Followup)"

OldValuesParameterFormatString="original_{0}"SelectCommand="SELECT * FROM [endorse] WHERE ([id] = @.id)"

UpdateCommand="UPDATE [endorse] SET [RoomNo] = @.RoomNo, [Name MR] = @.Name_MR, [Att Resi] = @.Att_Resi, [Age Sex] = @.Age_Sex, [Adm Date] = @.Adm_Date, [Diagnosis] = @.Diagnosis, [Diet IVF] = @.Diet_IVF, [Medications] = @.Medications, [Consults] = @.Consults, [Followup] = @.Followup WHERE [id] = @.original_id AND [RoomNo] = @.original_RoomNo AND [Name MR] = @.original_Name_MR AND [Att Resi] = @.original_Att_Resi AND [Age Sex] = @.original_Age_Sex AND [Adm Date] = @.original_Adm_Date AND [Diagnosis] = @.original_Diagnosis AND [Diet IVF] = @.original_Diet_IVF AND [Medications] = @.original_Medications AND [Consults] = @.original_Consults AND [Followup] = @.original_Followup">

<SelectParameters>

<asp:QueryStringParameterDefaultValue="0"Name="id"QueryStringField="id"Type="Int32"/>

</SelectParameters>

<DeleteParameters>

<asp:ParameterName="original_id"Type="Int32"/>

<asp:ParameterName="original_RoomNo"Type="Int32"/>

<asp:ParameterName="original_Name_MR"Type="String"/>

<asp:ParameterName="original_Att_Resi"Type="String"/>

<asp:ParameterName="original_Age_Sex"Type="String"/>

<asp:ParameterName="original_Adm_Date"Type="DateTime"/>

<asp:ParameterName="original_Diagnosis"Type="String"/>

<asp:ParameterName="original_Diet_IVF"Type="String"/>

<asp:ParameterName="original_Medications"Type="String"/>

<asp:ParameterName="original_Consults"Type="String"/>

<asp:ParameterName="original_Followup"Type="String"/>

</DeleteParameters>

<UpdateParameters>

<asp:ParameterName="RoomNo"Type="Int32"/>

<asp:ParameterName="Name_MR"Type="String"/>

<asp:ParameterName="Att_Resi"Type="String"/>

<asp:ParameterName="Age_Sex"Type="String"/>

<asp:ParameterName="Adm_Date"Type="DateTime"/>

<asp:ParameterName="Diagnosis"Type="String"/>

<asp:ParameterName="Diet_IVF"Type="String"/>

<asp:ParameterName="Medications"Type="String"/>

<asp:ParameterName="Consults"Type="String"/>

<asp:ParameterName="Followup"Type="String"/>

<asp:ParameterName="original_id"Type="Int32"/>

<asp:ParameterName="original_RoomNo"Type="Int32"/>

<asp:ParameterName="original_Name_MR"Type="String"/>

<asp:ParameterName="original_Att_Resi"Type="String"/>

<asp:ParameterName="original_Age_Sex"Type="String"/>

<asp:ParameterName="original_Adm_Date"Type="DateTime"/>

<asp:ParameterName="original_Diagnosis"Type="String"/>

<asp:ParameterName="original_Diet_IVF"Type="String"/>

<asp:ParameterName="original_Medications"Type="String"/>

<asp:ParameterName="original_Consults"Type="String"/>

<asp:ParameterName="original_Followup"Type="String"/>

</UpdateParameters>

<InsertParameters>

<asp:ParameterName="RoomNo"Type="Int32"/>

<asp:ParameterName="Name_MR"Type="String"/>

<asp:ParameterName="Att_Resi"Type="String"/>

<asp:ParameterName="Age_Sex"Type="String"/>

<asp:ParameterName="Adm_Date"Type="DateTime"/>

<asp:ParameterName="Diagnosis"Type="String"/>

<asp:ParameterName="Diet_IVF"Type="String"/>

<asp:ParameterName="Medications"Type="String"/>

<asp:ParameterName="Consults"Type="String"/>

<asp:ParameterName="Followup"Type="String"/>

</InsertParameters>

</asp:SqlDataSource>

</LoggedInTemplate>

<AnonymousTemplate>

you are not logged in.

</AnonymousTemplate>

</asp:LoginView>

</div>

</form>

</body>

</html>

Here is a wild shot in the dark...

I notice there is a field called Age_Sex. Is it possible the data being inserted has a comma between the two data items?

Even if it isn't causing the problem, having two data items in one field certainly will raise some eyebrows, if not some havoc.

|||

Thanks for your reply steve,

I tried to remove the comma from the data fields and still the same error. I don't want to many columns in the table thats why i am combining the fields, I know database design is not efficient in that way but it is surving the purpose for me.

If you could help further I will appriciate it.

Thanks again.

Error opening datafile: The filename, directory name, or volume labe syntax inco

I receive this error message when I try and run my DTS package:

"Error opening datafile: The filename, directory name, or volume labe syntax is incorrect."

I set the file name property of the Text File (Source) to a valid file, but when I run the package and it returns the above error message, it sets the file name property to <not displayable>.

Does anyone have any experience with such a problem? If so please help!!! ThanksRunning scheduled or manual?|||it's run manually triggerred from an ASP page.|||bump|||Well...

It's running under the context of the login that calls it...but how are you executing from an asp page?

From a job or sproc?

Usually when it runs under the contect of the server the file paths and names have to exists ON the server, not the client.

Is that your understanding?|||It throws the afforementioned error when I call it from ASP or from the Enterprise Manager.

I'm executing it from asp like:
Set oPkg = Server.CreateObject("DTS.Package")
oPkg.Execute

But the fact that it throws the error from EM on the server is most alarming. I just returned from vacation and I have no idea what could be causing this.

The file names do exist on the local server, but when the package is run it sets the file name property to "<not displayable>"sql

Error opening datafile: filename, directory, volume syntax incorrect

I receive this error message when I try and run my DTS
package:

"Error opening datafile: The filename, directory name, or
volume label syntax is incorrect."

I set the file name property of the Text File (Source) to
a valid file, but when I run the package and it returns
the above error message, it sets the file name property
to <not displayable>.

Does anyone have any experience with such a problem? If
so please help!!! ThanksIt throws the afforementioned error when I call it from ASP or from the Enterprise Manager.

I'm executing it from asp like:
Set oPkg = Server.CreateObject("DTS.Package")
oPkg.Execute

But the fact that it throws the error from EM on the server is most alarming. I just returned from vacation and I have no idea what could be causing this.

The file names do exist on the local server, but when the package is run it sets the file name property to "<not displayable>"

Wednesday, March 21, 2012

Error on Mirroring job

When I use database mirroring, I get the following error when the mirroring monitor runs.

Incorrect syntax near '-'. [SQLSTATE 42000] (Error 102) Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. [SQLSTATE 42000] (Error 319). The step failed.

This is the stored procedure that mirroring creates automatically. It isn't a user sproc. Several other people have posted this error and it seems to be a Microsoft bug.

Any ideas.
Jeff

Search the MSDN Product Feedback Forum. If it is posted out there as a bug, it is being worked on. Posting it again out here won't get anything done.

Sunday, February 19, 2012

Error message in wrong language?

I want to give users access to full-text searching and presume that I can
let SQL-server do all the dirty work. If I pass in a syntax error, things
fail as expected and I get an appropriate error message in the exception.
If I pass in a query with only "a" (for example) with only ignored words,
the exception is thrown with an error message in Spanish!
"Una proposizione della query conteneva solo parole ignorate."
Since syntax errors on the same stored procedure come back in English, I
assume my culture is correct (and I set it explicitly). If call the stored
procedure from DevStudio with the same params, the error message is in
English.
Any ideas?
thanks
charles
DETAILS:
The stored procedure:
ALTER PROCEDURE dbo.GetMessageList
(
@.ForumID int,
@.FullTextSearch nvarchar(200)='',
@.BeginDate DateTime=NULL,
@.EndDate DateTime=NULL,
@.IsModerator bit=0
)
AS
SELECT
ForumMessages.ID,Title,MessageBody,Format,Locked,I mportance,Hidden,PostTime,
UpdateTime,EventDate,Alias,Views,
(SELECT COUNT(ID) FROM ForumMessages AS F1 WHERE
ForumMessages.ID=F1.RootParentID) AS Replies
FROM ForumMessages, ForumUsers
WHERE
ParentID IS NULL AND
ForumID=@.ForumID AND
(@.IsModerator=0 OR Hidden=0) AND
(@.BeginDate IS NULL OR EventDate>=@.BeginDate) AND
(@.EndDate IS NULL OR EventDate<=@.EndDate) AND
ForumUsers.ID=UserID AND
(@.FullTextSearch='' OR ForumMessages.ID IN
(SELECT RootParentID FROM ForumMessages WHERE
CONTAINS(Title,@.FullTextSearch) OR CONTAINS(MessageBody,@.FullTextSearch)
)
OR ForumMessages.ID IN
(SELECT ID FROM ForumMessages WHERE CONTAINS(Title,@.FullTextSearch) OR
CONTAINS(MessageBody,@.FullTextSearch)
)
)
ORDER BY Importance DESC,UpdateTime DESC
RETURN
are you getting this message in Query Analyzer? If so which language is it
being returned in?
Are you getting it in ADO? If so, what is your localeID, and what are your
regional settings (check control panel for this).
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"charles" <spam@.synthigence.com> wrote in message
news:O$WT0wvhEHA.3200@.TK2MSFTNGP10.phx.gbl...
> I want to give users access to full-text searching and presume that I can
> let SQL-server do all the dirty work. If I pass in a syntax error, things
> fail as expected and I get an appropriate error message in the exception.
> If I pass in a query with only "a" (for example) with only ignored words,
> the exception is thrown with an error message in Spanish!
> "Una proposizione della query conteneva solo parole ignorate."
> Since syntax errors on the same stored procedure come back in English, I
> assume my culture is correct (and I set it explicitly). If call the
stored
> procedure from DevStudio with the same params, the error message is in
> English.
> Any ideas?
> thanks
> charles
> DETAILS:
> The stored procedure:
> ALTER PROCEDURE dbo.GetMessageList
> (
> @.ForumID int,
> @.FullTextSearch nvarchar(200)='',
> @.BeginDate DateTime=NULL,
> @.EndDate DateTime=NULL,
> @.IsModerator bit=0
> )
> AS
> SELECT
>
ForumMessages.ID,Title,MessageBody,Format,Locked,I mportance,Hidden,PostTime,
> UpdateTime,EventDate,Alias,Views,
> (SELECT COUNT(ID) FROM ForumMessages AS F1 WHERE
> ForumMessages.ID=F1.RootParentID) AS Replies
> FROM ForumMessages, ForumUsers
> WHERE
> ParentID IS NULL AND
> ForumID=@.ForumID AND
> (@.IsModerator=0 OR Hidden=0) AND
> (@.BeginDate IS NULL OR EventDate>=@.BeginDate) AND
> (@.EndDate IS NULL OR EventDate<=@.EndDate) AND
> ForumUsers.ID=UserID AND
> (@.FullTextSearch='' OR ForumMessages.ID IN
> (SELECT RootParentID FROM ForumMessages WHERE
> CONTAINS(Title,@.FullTextSearch) OR CONTAINS(MessageBody,@.FullTextSearch)
> )
> OR ForumMessages.ID IN
> (SELECT ID FROM ForumMessages WHERE CONTAINS(Title,@.FullTextSearch) OR
> CONTAINS(MessageBody,@.FullTextSearch)
> )
> )
> ORDER BY Importance DESC,UpdateTime DESC
> RETURN
>
|||With Query analyser the error comes back in English. Don't know about ADO,
my app is in C# and uses the SqlClient calls. But I've only found this one
message in Spanish. Does the Full-text system have a separate language
configuration entry? Also, my App is multilingual, when a user selects a
different language, how will I tell SQL-Server what language should be used
for error messages?
thanks
charles
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:eImiwiyhEHA.712@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> are you getting this message in Query Analyzer? If so which language is it
> being returned in?
> Are you getting it in ADO? If so, what is your localeID, and what are your
> regional settings (check control panel for this).
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "charles" <spam@.synthigence.com> wrote in message
> news:O$WT0wvhEHA.3200@.TK2MSFTNGP10.phx.gbl...
can[vbcol=seagreen]
things[vbcol=seagreen]
exception.[vbcol=seagreen]
words,
> stored
>
ForumMessages.ID,Title,MessageBody,Format,Locked,I mportance,Hidden,PostTime,
>
|||I added an explicit SET LANGUAGE to my sp and the problem is corrected.
charles
"charles" <spam@.synthigence.com> wrote in message
news:uMSxblSiEHA.3548@.TK2MSFTNGP09.phx.gbl...
> With Query analyser the error comes back in English. Don't know about
ADO,
> my app is in C# and uses the SqlClient calls. But I've only found this
one
> message in Spanish. Does the Full-text system have a separate language
> configuration entry? Also, my App is multilingual, when a user selects a
> different language, how will I tell SQL-Server what language should be
used[vbcol=seagreen]
> for error messages?
> thanks
> charles
>
> "Hilary Cotter" <hilaryk@.att.net> wrote in message
> news:eImiwiyhEHA.712@.TK2MSFTNGP09.phx.gbl...
it[vbcol=seagreen]
your[vbcol=seagreen]
> can
> things
> exception.
> words,
I
>
ForumMessages.ID,Title,MessageBody,Format,Locked,I mportance,Hidden,PostTime,[vbcol=seagreen]
CONTAINS(MessageBody,@.FullTextSearch)
>