Thursday, March 29, 2012
Desc as column name
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
Monday, March 19, 2012
deploying SQL server applications to another machine
Let me start off by saying that I am a complete SQL server newbie.
I work with a system that uses SQL Server 2005 as it's backbone DB
running on W2K3 server. This system is going to be installed onto
customer servers, also running W2K3 server. Question is; is there a
way to deploy all aspects of JUST THE DB (tables, stored procedures,
security, users, etc...) to the customers servers without having to do
a full up install of SQL Server 2005 on every server that will host a
database?
ThanksYou need some process to read and interact with the database files. The only such process I know of
is ... SQL Server. Now, that can be Express edition, but it need to be some version of SQL Server...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<ecfiedler@.impactsci.com> wrote in message
news:1179865512.394536.163730@.q69g2000hsb.googlegroups.com...
> Hi -
> Let me start off by saying that I am a complete SQL server newbie.
> I work with a system that uses SQL Server 2005 as it's backbone DB
> running on W2K3 server. This system is going to be installed onto
> customer servers, also running W2K3 server. Question is; is there a
> way to deploy all aspects of JUST THE DB (tables, stored procedures,
> security, users, etc...) to the customers servers without having to do
> a full up install of SQL Server 2005 on every server that will host a
> database?
> Thanks
>
deploying SQL server applications to another machine
Let me start off by saying that I am a complete SQL server newbie.
I work with a system that uses SQL Server 2005 as it's backbone DB
running on W2K3 server. This system is going to be installed onto
customer servers, also running W2K3 server. Question is; is there a
way to deploy all aspects of JUST THE DB (tables, stored procedures,
security, users, etc...) to the customers servers without having to do
a full up install of SQL Server 2005 on every server that will host a
database?
Thanks
You need some process to read and interact with the database files. The only such process I know of
is ... SQL Server. Now, that can be Express edition, but it need to be some version of SQL Server...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<ecfiedler@.impactsci.com> wrote in message
news:1179865512.394536.163730@.q69g2000hsb.googlegr oups.com...
> Hi -
> Let me start off by saying that I am a complete SQL server newbie.
> I work with a system that uses SQL Server 2005 as it's backbone DB
> running on W2K3 server. This system is going to be installed onto
> customer servers, also running W2K3 server. Question is; is there a
> way to deploy all aspects of JUST THE DB (tables, stored procedures,
> security, users, etc...) to the customers servers without having to do
> a full up install of SQL Server 2005 on every server that will host a
> database?
> Thanks
>
deploying SQL server applications to another machine
Let me start off by saying that I am a complete SQL server newbie.
I work with a system that uses SQL Server 2005 as it's backbone DB
running on W2K3 server. This system is going to be installed onto
customer servers, also running W2K3 server. Question is; is there a
way to deploy all aspects of JUST THE DB (tables, stored procedures,
security, users, etc...) to the customers servers without having to do
a full up install of SQL Server 2005 on every server that will host a
database?
ThanksYou need some process to read and interact with the database files. The only
such process I know of
is ... SQL Server. Now, that can be Express edition, but it need to be some
version of SQL Server...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
<ecfiedler@.impactsci.com> wrote in message
news:1179865512.394536.163730@.q69g2000hsb.googlegroups.com...
> Hi -
> Let me start off by saying that I am a complete SQL server newbie.
> I work with a system that uses SQL Server 2005 as it's backbone DB
> running on W2K3 server. This system is going to be installed onto
> customer servers, also running W2K3 server. Question is; is there a
> way to deploy all aspects of JUST THE DB (tables, stored procedures,
> security, users, etc...) to the customers servers without having to do
> a full up install of SQL Server 2005 on every server that will host a
> database?
> Thanks
>
Friday, February 24, 2012
Deploy Package Problem
I have a package that runs fine on my dev box. I deploy it to another server and run it by right-clicking and choosing run. I get an error saying it was unable to log in to the server.(Log in failed for user 'myuser') I am using sql authenication and the connection string says persist security info = true. So where is that password stored? Did I miss something when I deployed?
(I have other connections in the package that are windows auth and they work fine)
Data Source=myserver;User ID=myuser;Initial Catalog=Staging;Provider=SQLNCLI.1;Persist Security Info=True;Auto Translate=False;
(I am just trying to get it to run on the other server, I know I may have other issues when I try to run it under sql agent)
Thx
Who is it package running as on the second server and what is the Package's protection level?|||Thanks for the reply jaegd.
It is running under my id but I am using sql authentication to connect to a remote server and that is where my problem is not with the local server. The part of the package that connects locally under my id works fine, it's only when trying to connect to the remote sever that the password is not being used, I think it is trying to log in with a blank pwd.
Package protection is : EncryptSensitiveWithUserKey
|||I had the same issue. Even on my own machine, no matter how many times I checked "[ ] Save my Password" it would continue to forget it and fail the connections (all 100+).
I finally have resorted to Windows Authentication which I've heard now from several sources is the preferred / encouraged method. Once I switched all my OLE DB connections over to it, it worked fine. Problem is, you have to have permission on the remote server.
I call BUG.
|||Found this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=193221&SiteID=1
Which basically says to set your package protection level to DontSaveSensitive and use package configurations for storing passwords, server names, etc.
Simple works for me, only small concern is the passwords are not encrypted (maybe they can be somehow through SSIS) but I can live with it..