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

Thursday, March 29, 2012

Desc as column name

Hi,
When I run the following sql statement
CREATE TABLE t1 (Desc varchar(50))
I get an error saying Incorrect syntax near keyword Desc.
However, I can run the same command on other database engines.
Where can I find situations like this where an sql statement will work
on other databases but not SqlServer?
The statement
CREATE TABLE t1 ([Desc] varchar(50))
works fine.
Do you suggest that I enclose column names in square brackets ([]) for
all sql statements (select, insert, update, create, delete etc)?
Regards,
PrakashSince you mention other database engines, you should get into the habit of using the ANSI SQL
compliant way to delimit identifiers: double-quotes and not square brackets.
There's a list in Books Online of all the reserved keywords.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<prakash_bande@.hotmail.com> wrote in message
news:1189098048.395246.253570@.w3g2000hsg.googlegroups.com...
> Hi,
> When I run the following sql statement
> CREATE TABLE t1 (Desc varchar(50))
> I get an error saying Incorrect syntax near keyword Desc.
> However, I can run the same command on other database engines.
> Where can I find situations like this where an sql statement will work
> on other databases but not SqlServer?
> The statement
> CREATE TABLE t1 ([Desc] varchar(50))
> works fine.
> Do you suggest that I enclose column names in square brackets ([]) for
> all sql statements (select, insert, update, create, delete etc)?
>
> Regards,
> Prakash
>|||Desc is a reserved keyword in SQL Server. It's short for 'descending' and is
used in syntax such as ORDER BY column_name DESC. If you want to use
reserved words as object or column names, you must delimit the name by
either using [ ] as you show below are by using double quotes " ". Keep in
mind that you will need to delimit this name in every statement in which you
reference the name. You might consider just choosing a longer (and more
descriptive) name such as "Description".
For a list of reserved keywords, see this Books Online topic:
http://msdn2.microsoft.com/en-us/library/ms189822.aspx
For more information about delimiting names see this Books Online topic
http://msdn2.microsoft.com/en-us/library/ms176027.aspx
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://technet.microsoft.com/en-us/sqlserver/bb428874.aspx
<prakash_bande@.hotmail.com> wrote in message
news:1189098048.395246.253570@.w3g2000hsg.googlegroups.com...
> Hi,
> When I run the following sql statement
> CREATE TABLE t1 (Desc varchar(50))
> I get an error saying Incorrect syntax near keyword Desc.
> However, I can run the same command on other database engines.
> Where can I find situations like this where an sql statement will work
> on other databases but not SqlServer?
> The statement
> CREATE TABLE t1 ([Desc] varchar(50))
> works fine.
> Do you suggest that I enclose column names in square brackets ([]) for
> all sql statements (select, insert, update, create, delete etc)?
>
> Regards,
> Prakash
>sql

Wednesday, March 21, 2012

Deployment error -- Incorrect ImpersonationInfo object

Hi,

I'm new to SSAS 2005 and I'm walking through the Analysis Services tutorial in the online documentation. So far so good until when I wanted to deploy the project. The error is

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 don't know why it asked for ImpersonationInfo. I'm a local administrator of the computer and I want to deploy to local server.

However, when I went through the Deployment Wizard in Analysis Services, it was deployed successfully. When I switched back to Visual Studio AS project and tried to browse the cube or dimension, it failed again saying that

Either the user, [UserID], does not have access to the Analysis Services Tutorial database, or the database does not exist.

What am I missing? :(

Thanks
JennyNevermind. I've figured it out myself. I forgot to deploy the Adventure Works DW analysis services project first. Also, when I set up the data source, for some reasons, impersonation was selected by mistake.

Thanks!|||Hi Jenny Tam.
I had the same error. here is how to correct it
1-right-click on data source in solution explorer
2-select View Designer
3-select Impersonation Information tab, then Default box
It's all.|||Thanks - I have the same problem and it is great solution.
|||thank you

Deployment error -- Incorrect ImpersonationInfo object

Hi,

I'm new to SSAS 2005 and I'm walking through the Analysis Services tutorial in the online documentation. So far so good until when I wanted to deploy the project. The error is

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 don't know why it asked for ImpersonationInfo. I'm a local administrator of the computer and I want to deploy to local server.

However, when I went through the Deployment Wizard in Analysis Services, it was deployed successfully. When I switched back to Visual Studio AS project and tried to browse the cube or dimension, it failed again saying that

Either the user, [UserID], does not have access to the Analysis Services Tutorial database, or the database does not exist.

What am I missing? :(

Thanks
JennyNevermind. I've figured it out myself. I forgot to deploy the Adventure Works DW analysis services project first. Also, when I set up the data source, for some reasons, impersonation was selected by mistake.

Thanks!|||Hi Jenny Tam.
I had the same error. here is how to correct it
1-right-click on data source in solution explorer
2-select View Designer
3-select Impersonation Information tab, then Default box
It's all.|||Thanks - I have the same problem and it is great solution.
|||thank you

Deployment error -- Incorrect ImpersonationInfo object

Hi,

I'm new to SSAS 2005 and I'm walking through the Analysis Services tutorial in the online documentation. So far so good until when I wanted to deploy the project. The error is

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 don't know why it asked for ImpersonationInfo. I'm a local administrator of the computer and I want to deploy to local server.

However, when I went through the Deployment Wizard in Analysis Services, it was deployed successfully. When I switched back to Visual Studio AS project and tried to browse the cube or dimension, it failed again saying that

Either the user, [UserID], does not have access to the Analysis Services Tutorial database, or the database does not exist.

What am I missing? :(

Thanks
JennyNevermind. I've figured it out myself. I forgot to deploy the Adventure Works DW analysis services project first. Also, when I set up the data source, for some reasons, impersonation was selected by mistake.

Thanks!|||Hi Jenny Tam.
I had the same error. here is how to correct it
1-right-click on data source in solution explorer
2-select View Designer
3-select Impersonation Information tab, then Default box
It's all.|||Thanks - I have the same problem and it is great solution.
|||thank you