Showing posts with label incorrect. Show all posts
Showing posts with label incorrect. Show all posts

Thursday, March 22, 2012

Error 156 Creating View

I tried writing the following statement in a stored procedure, and I get an
Error message: "Error 156: Incorrect syntax near the keyword 'VIEW'."
CREATE VIEW VW_TotalAccepted
AS
SELECT [CustID], [ReqNo], Sum([AcceptedQty]) AS [Total]
FROM [DelDetail]
GROUP BY [DelDetail].[CustID], [DelDetail].[ReqNo]
What's wrong with the syntax? Isn't it the way to create a View?You cannot create a VIEW inside a SP
"wrytat" wrote:

> I tried writing the following statement in a stored procedure, and I get a
n
> Error message: "Error 156: Incorrect syntax near the keyword 'VIEW'."
> CREATE VIEW VW_TotalAccepted
> AS
> SELECT [CustID], [ReqNo], Sum([AcceptedQty]) AS [Total]
> FROM [DelDetail]
> GROUP BY [DelDetail].[CustID], [DelDetail].[ReqNo]
> What's wrong with the syntax? Isn't it the way to create a View?|||Then... Just ask a stupid question regarding View. If I add a new row or
change some values of some columns in a table that is included in a View
after creating the View, will the change be reflected in the View?
"Chandra" wrote:
> You cannot create a VIEW inside a SP
> "wrytat" wrote:
>|||Yes. A view doesn't store any data, it is only a "view" into the data stored
in your tables.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"wrytat" <wrytat@.discussions.microsoft.com> wrote in message
news:B14BFAD9-CF63-4645-A61C-86AA8854F4D1@.microsoft.com...
> Then... Just ask a stupid question regarding View. If I add a new row or
> change some values of some columns in a table that is included in a View
> after creating the View, will the change be reflected in the View?
> "Chandra" wrote:
>|||Yes. View doesnt store any data. Selecting rows from a view is as good as
executing the query that created it.
We go for views because, it improves the performance of a query.
thanks and regards
Chandra
"wrytat" wrote:
> Then... Just ask a stupid question regarding View. If I add a new row or
> change some values of some columns in a table that is included in a View
> after creating the View, will the change be reflected in the View?
> "Chandra" wrote:
>

Friday, March 9, 2012

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect. If the ImpersonateAccount value is used for ImpersonationInfo, then the Account property cannot be empty. 0 0

I am getting the above error when I am trying to deploy my objects.

I am trying to deploy this on a named sql 2005 server. The host also have named sql 2000 instance.Search "Impersonation Information" in the Help.
I suggest use "Defualt" for quick fix.

Quoted from the help:

Use the Impersonation Information dialog box to provide information about the security credentials used by the Analysis Services object. You can display the Impersonation Information dialog box by:

Clicking the ellipsis (...) of the Data Source Impersonation Info property in the Database Properties dialog box of SQL Server Management Studio.

Clicking the ellipsis (...) of the Impersonation Info property in the Assembly Properties dialog box of SQL Server Management Studio.|||Hi,

In your project when you double click the Data Source object, you will see Data Source Designer screen.

Open Impersonation tab and check the user name and the password fields.

After corrections on this screen, you will probably deploy your project successfully.

Eralper
http://www.kodyaz.com|||

Hi,

thanks a lot for the suggession. This is working perfectly.

good show.

Swami.

|||

Thanks a lot, your help is very usefull.

I want to add that in the spanish version of sql server anylisis services the translation for Impersonation is "Suplantacion", what is not very proper. Anyway for spanish version of sql you have to look for "Informacion de Suplantacion" in "Origenes de Datos" properties.

Espero que ayude.

Saludos

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect. If the ImpersonateAccount value is used for ImpersonationInfo, then the Account property cannot be empty. 0 0

I am getting the above error when I am trying to deploy my objects.

I am trying to deploy this on a named sql 2005 server. The host also have named sql 2000 instance.Search "Impersonation Information" in the Help.
I suggest use "Defualt" for quick fix.

Quoted from the help:

Use the Impersonation Information dialog box to provide information about the security credentials used by the Analysis Services object. You can display the Impersonation Information dialog box by:

Clicking the ellipsis (...) of the Data Source Impersonation Info property in the Database Properties dialog box of SQL Server Management Studio.

Clicking the ellipsis (...) of the Impersonation Info property in the Assembly Properties dialog box of SQL Server Management Studio.|||Hi,

In your project when you double click the Data Source object, you will see Data Source Designer screen.

Open Impersonation tab and check the user name and the password fields.

After corrections on this screen, you will probably deploy your project successfully.

Eralper
http://www.kodyaz.com|||

Hi,

thanks a lot for the suggession. This is working perfectly.

good show.

Swami.

|||

Thanks a lot, your help is very usefull.

I want to add that in the spanish version of sql server anylisis services the translation for Impersonation is "Suplantacion", what is not very proper. Anyway for spanish version of sql you have to look for "Informacion de Suplantacion" in "Origenes de Datos" properties.

Espero que ayude.

Saludos

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect. If the ImpersonateAccount value is used for ImpersonationInfo, then the Account property cannot be empty. 0 0

I am getting the above error when I am trying to deploy my objects.

I am trying to deploy this on a named sql 2005 server. The host also have named sql 2000 instance.

Search "Impersonation Information" in the Help.
I suggest use "Defualt" for quick fix.

Quoted from the help:

Use the Impersonation Information dialog box to provide information about the security credentials used by the Analysis Services object. You can display the Impersonation Information dialog box by:

Clicking the ellipsis (...) of the Data Source Impersonation Info property in the Database Properties dialog box of SQL Server Management Studio.

Clicking the ellipsis (...) of the Impersonation Info property in the Assembly Properties dialog box of SQL Server Management Studio.|||Hi,

In your project when you double click the Data Source object, you will see Data Source Designer screen.

Open Impersonation tab and check the user name and the password fields.

After corrections on this screen, you will probably deploy your project successfully.

Eralper
http://www.kodyaz.com|||

Hi,

thanks a lot for the suggession. This is working perfectly.

good show.

Swami.

|||

Thanks a lot, your help is very usefull.

I want to add that in the spanish version of sql server anylisis services the translation for Impersonation is "Suplantacion", what is not very proper. Anyway for spanish version of sql you have to look for "Informacion de Suplantacion" in "Origenes de Datos" properties.

Espero que ayude.

Saludos

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect

Error 1 Parser: The syntax for the ImpersonationInfo object is incorrect. If the ImpersonateAccount value is used for ImpersonationInfo, then the Account property cannot be empty. 0 0

I am getting the above error when I am trying to deploy my objects.

I am trying to deploy this on a named sql 2005 server. The host also have named sql 2000 instance.

Search "Impersonation Information" in the Help.
I suggest use "Defualt" for quick fix.

Quoted from the help:

Use the Impersonation Information dialog box to provide information about the security credentials used by the Analysis Services object. You can display the Impersonation Information dialog box by:

Clicking the ellipsis (...) of the Data Source Impersonation Info property in the Database Properties dialog box of SQL Server Management Studio.

Clicking the ellipsis (...) of the Impersonation Info property in the Assembly Properties dialog box of SQL Server Management Studio.|||Hi,

In your project when you double click the Data Source object, you will see Data Source Designer screen.

Open Impersonation tab and check the user name and the password fields.

After corrections on this screen, you will probably deploy your project successfully.

Eralper
http://www.kodyaz.com|||

Hi,

thanks a lot for the suggession. This is working perfectly.

good show.

Swami.

|||

Thanks a lot, your help is very usefull.

I want to add that in the spanish version of sql server anylisis services the translation for Impersonation is "Suplantacion", what is not very proper. Anyway for spanish version of sql you have to look for "Informacion de Suplantacion" in "Origenes de Datos" properties.

Espero que ayude.

Saludos

Friday, February 24, 2012

Error "Incorrect syntax near (." when doing Update() from code, VB

Hi all

My error is as follows:

Incorrect syntax near '('.
Line 27: acceptOrDeclineFriendship.UpdateParameters.Add("Response", answer)
Line 28: acceptOrDeclineFriendship.UpdateParameters.Add("FriendID", friend_id)
Line 29: acceptOrDeclineFriendship.Update()
Line 30:
Line 31: End Sub

Bear with me... I have a page where i use a repeater control to list users who have requested to be friends with the currently online user. The 'getFriendRequests' query looks like this:

SelectCommand="SELECT * FROM Friends, UserDetails WHERE (Friends.UserID = UserDetails.UserID) AND (FriendID = @.UserID) AND (ApprovedByFriend = 'False') ORDER BY Friends.Requested DESC"
This works.

Within each repeater template, there are 2 buttons, 'Accept' or 'Decline', like this:

 <asp:Repeater ID="Repeater1" runat="server" DataSourceID="getFriendRequests"> <ItemTemplate> (other stuff like avatar and username etc) <asp:Button ID="accept" runat="server" Text="Accept" commandName="Accept" commandArgument='<%#Eval("UserID")%>' onCommand="Accept_Decline_Friends"/> <asp:Button ID="decline" runat="server" Text="Decline" commandName="Decline" commandArgument='<%#Eval("UserID")%>' onCommand="Accept_Decline_Friends"/> </ItemTemplate> </asp:Repeater>

The code-behind (VB) which deals with this is as follows:

Protected Sub Accept_Decline_Friends(ByVal senderAs Object,ByVal eAs CommandEventArgs)'retrieve id of requestee and the answer accept/declineDim friend_idAs String = e.CommandArgument.ToStringDim answerAs String = e.CommandName.ToString'add the parameters acceptOrDeclineFriendship.UpdateParameters.Add("Response", answer) acceptOrDeclineFriendship.UpdateParameters.Add("FriendID", friend_id) acceptOrDeclineFriendship.Update()End Sub

Since the buttons are being created dynamically, this is how i track 1. the response from the currently logged in user 'Accept/Decline' and 2. who they are responding to (by their uniqueid)

This relates to a sqlDataSource on my .aspx page like this:

<!-- update query when user has accepted the friendship --> <asp:SqlDataSource ID="acceptOrDeclineFriendship" runat="server" ConnectionString="<%$ xxx%>" UpdateCommand="UPDATE Friends SET (ApprovedByFriend = @.Response) WHERE (FriendID = @.UserID) AND (UserID = @.FriendID)"> <UpdateParameters> <asp:ControlParameter Name="UserID" ControlID="userIdValue" /> </UpdateParameters> </asp:SqlDataSource>

Which is meant to update my 'Friends' table to show that 'ApprovedByFriend' (the logged in user) is either 'Accept' or 'Decline', and record who's request was responded to.

I hope this is clear, just trying to suppy all of the information! The error appears to be saying that I have an issue with my code-behind, where i am telling the sqlDataSource above to UPDATE. What I can say is that for each button in the repeater, the 2 variables 'friend_id' and 'answer' are picking up the correct values.

Can anyone see any obvious problems here? Any help is very much appreciated as i am well and truley stuck!


Hi all

after all that I figured out it was a simple syntax issue.

UpdateCommand="UPDATE Friends SET ApprovedByFriend = @.Response WHERE (FriendID = @.UserID) AND (UserID = @.FriendID)">
I had some brackets around the SET conditionEmbarrassed

Error "...could not enumerate changes.." Incorrect syntax ... 'a

Error in replication Merge:
{call sp_MSenumchanges(?,?,?,?,?,?,?,?)}
The process could not enumerate changes at the 'Subscriber'.
(Source: Merge Replication Provider (Agent); Error number: -2147200999)
Incorrect syntax near the keyword 'and'.
(Source: SERVIDOR (Data source); Error number: 156)
I already altered the store procedure sp_MSenumchanges/sp_MSenumchanges_Pal
and sp_MSenumchanges_Direct var @.genlist
and the mistake continues.
Please help me
Hamilton
SP, Brazil
Try installing the service pack 2 or above.
this usually happens when a column contains images.
"Hamilton" <Hamilton@.discussions.microsoft.com> wrote in message
news:CC77034E-D903-4552-8501-910B96E6D519@.microsoft.com...
> Error in replication Merge:
> {call sp_MSenumchanges(?,?,?,?,?,?,?,?)}
> The process could not enumerate changes at the 'Subscriber'.
> (Source: Merge Replication Provider (Agent); Error number: -2147200999)
> Incorrect syntax near the keyword 'and'.
> (Source: SERVIDOR (Data source); Error number: 156)
> I already altered the store procedure
> sp_MSenumchanges/sp_MSenumchanges_Pal
> and sp_MSenumchanges_Direct var @.genlist
> and the mistake continues.
> Please help me
> Hamilton
> SP, Brazil
|||Try using Profiler to capture which exactly SQL statement in which procedure
is failing. That should give a hint what could be wrong.

> I already altered the store procedure
sp_MSenumchanges/sp_MSenumchanges_Pal
> and sp_MSenumchanges_Direct var @.genlist
> and the mistake continues.
What have you changed in those procedures ? For what reason ?
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Hamilton" <Hamilton@.discussions.microsoft.com> wrote in message
news:CC77034E-D903-4552-8501-910B96E6D519@.microsoft.com...
> Error in replication Merge:
> {call sp_MSenumchanges(?,?,?,?,?,?,?,?)}
> The process could not enumerate changes at the 'Subscriber'.
> (Source: Merge Replication Provider (Agent); Error number: -2147200999)
> Incorrect syntax near the keyword 'and'.
> (Source: SERVIDOR (Data source); Error number: 156)
> I already altered the store procedure
sp_MSenumchanges/sp_MSenumchanges_Pal
> and sp_MSenumchanges_Direct var @.genlist
> and the mistake continues.
> Please help me
> Hamilton
> SP, Brazil