Sunday, March 25, 2012
Create table eror
IIS. However I get an error message when I try to create a table. I am
running from php.
I am sure I am doing something stupid but I can't see it or could it
be a permissions issue?
Error -
Connection to Database members Successful.
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax
near
the keyword 'IF'.
Code -
//create a table in that dbase
$sql ="CREATE TABLE IF NOT EXISTS $_SESSION[table_name]
(
firstname VARCHAR(20),
lastname VARCHAR(20),
username VARCHAR(20),
password VARCHAR(50),
group1 VARCHAR(20),
group2 VARCHAR(20),
group3 VARCHAR(20),
pchange VARCHAR(1),
email VARCHAR(100),
redirect VARCHAR(100),
verified VARCHAR(1),
last_login DATE
)";
$result = odbc_exec($connection,$sql) or die(odbc_errormsg());
Any ideas or places to look gratefully received.
JohnThere is no CREATE TABLE IF NOT EXISTS statement in T-SQL.
You would need to use something along the lines of:
IF NOT EXISTS (select * from dbo.sysobjects
WHERE id = object_id('dbo.TableName')
AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
CREATE TABLE dbo.TableName
(ColumnName varchar(50) not null,
etc.....)
-Sue
On Thu, 10 Aug 2006 19:45:59 +0100, John
<yjdyhugo@.d8hujsrfu> wrote:
>I am able to connect to a database set up on SQL windows 2003 under
>IIS. However I get an error message when I try to create a table. I am
>running from php.
>I am sure I am doing something stupid but I can't see it or could it
>be a permissions issue?
>Error -
>Connection to Database members Successful.
>[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax
near
>the keyword 'IF'.
>Code -
>//create a table in that dbase
>$sql ="CREATE TABLE IF NOT EXISTS $_SESSION[table_name]
>(
> firstname VARCHAR(20),
> lastname VARCHAR(20),
> username VARCHAR(20),
> password VARCHAR(50),
> group1 VARCHAR(20),
> group2 VARCHAR(20),
> group3 VARCHAR(20),
> pchange VARCHAR(1),
> email VARCHAR(100),
> redirect VARCHAR(100),
> verified VARCHAR(1),
> last_login DATE
> )";
>$result = odbc_exec($connection,$sql) or die(odbc_errormsg());
>Any ideas or places to look gratefully received.
>John|||On Thu, 10 Aug 2006 13:09:11 -0600, Sue Hoegemeier
<Sue_H@.nomail.please> wrote:
>There is no CREATE TABLE IF NOT EXISTS statement in T-SQL.
>You would need to use something along the lines of:
>IF NOT EXISTS (select * from dbo.sysobjects
> WHERE id = object_id('dbo.TableName')
> AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
> CREATE TABLE dbo.TableName
> (ColumnName varchar(50) not null,
> etc.....)
>-Sue
Thanks Sue
Would I be using T-SQL?
How can I find out?
I have never heard of that.
John
[vbcol=seagreen]
>On Thu, 10 Aug 2006 19:45:59 +0100, John
><yjdyhugo@.d8hujsrfu> wrote:
>|||Yes that's T-SQL. T-SQL (Transact SQL) is SQL Server's
implementation or "flavor" of SQL.
-Sue
On Thu, 10 Aug 2006 21:04:35 +0100, John
<yjdyhugo@.d8hujsrfu> wrote:
>On Thu, 10 Aug 2006 13:09:11 -0600, Sue Hoegemeier
><Sue_H@.nomail.please> wrote:
>
>Thanks Sue
>Would I be using T-SQL?
>How can I find out?
>I have never heard of that.|||On Thu, 10 Aug 2006 19:17:41 -0600, Sue Hoegemeier
<Sue_H@.nomail.please> wrote:
>Yes that's T-SQL. T-SQL (Transact SQL) is SQL Server's
>implementation or "flavor" of SQL. Thanks again Sue
Having had a quick look round TSQL seems to be an extension of SQL.
Are you saying that the code I used would not work on a server/SQL
implementation.
John|||On Fri, 11 Aug 2006 09:31:28 +0100, John <yjdyhugo@.d8hujsrfu> wrote:
>On Thu, 10 Aug 2006 19:17:41 -0600, Sue Hoegemeier
><Sue_H@.nomail.please> wrote:
>
>Having had a quick look round TSQL seems to be an extension of SQL.
>Are you saying that the code I used would not work on a server/SQL
>implementation.
Further info
SQL seems to be objecting to
IF NOT EXISTS
&
last_login DATE
If I remove these then it runs through OK
Any ideas whu this is the case much appreciated.
John|||On Fri, 11 Aug 2006 13:07:27 +0100, John <yjdyhugo@.d8hujsrfu> wrote:
>On Fri, 11 Aug 2006 09:31:28 +0100, John <yjdyhugo@.d8hujsrfu> wrote:
>
>Further info
>SQL seems to be objecting to
>IF NOT EXISTS
>&
>last_login DATE
>If I remove these then it runs through OK
>Any ideas whu this is the case much appreciated.
>John
Sue already gave you the answer. In SQL Server's implementation of
SQL, "CREATE TABLE IF NOT EXISTS" is not legal syntax. Neither is
"DATE" a valid data type.
T-SQL (Transact SQL) defines what is legal syntax for SQL Server.|||On Fri, 11 Aug 2006 07:01:18 -0700, Jack Jackson
<jacknospam@.pebbleridge.com> wrote:
>On Fri, 11 Aug 2006 13:07:27 +0100, John <yjdyhugo@.d8hujsrfu> wrote:
>
>Sue already gave you the answer. In SQL Server's implementation of
>SQL, "CREATE TABLE IF NOT EXISTS" is not legal syntax. Neither is
>"DATE" a valid data type.
>T-SQL (Transact SQL) defines what is legal syntax for SQL Server.
Sorry you are quite correct.
I thought T-SQL was an extension to SQL but it appears some things
have been taken out as well.
Is that the case?
Thanks for your help Sue and Jack, I think I am beginning to get the
picture now.
John|||It is an extension but it is also the "flavor" used by SQL
Server and impacts how some of the SQL and related standards
are implemented. So it's not just a matter of "additional
functionality" type of thing. Not all database vendors
implement all of the same ANSI SQL.And not everything
implemented by a database vendor is a SQL standard. You will
find plenty of variation in syntax, functionality among the
different database platforms.
-Sue
On Sat, 12 Aug 2006 10:26:30 +0100, John
<yjdyhugo@.d8hujsrfu> wrote:
>Sorry you are quite correct.
>I thought T-SQL was an extension to SQL but it appears some things
>have been taken out as well.
>Is that the case?
>Thanks for your help Sue and Jack, I think I am beginning to get the
>picture now.
>John|||On Sun, 13 Aug 2006 15:26:03 -0600, Sue Hoegemeier
<Sue_H@.nomail.please> wrote:
>It is an extension but it is also the "flavor" used by SQL
>Server and impacts how some of the SQL and related standards
>are implemented. So it's not just a matter of "additional
>functionality" type of thing. Not all database vendors
>implement all of the same ANSI SQL.And not everything
>implemented by a database vendor is a SQL standard. You will
>find plenty of variation in syntax, functionality among the
>different database platforms.
Looks like I am going to have to wade through the mysql and spot the
differences as I go.
Thanks again for your help on this, I appreciate it.
John
Wednesday, March 7, 2012
Create local cube from remote AS server
Hello
I try the following:
I
1) connect to a remote server and browse its AS databases and cubes
2) display one cube in a OWC 10/11 pivottable (by setting .connectionstring and .datamember
3) try to create a local cube from this server database/cube using "CREATE GLOBAL CUBE...") giving a unc path as target
Steps 1 and 2 are successful (I use a named user in the format domain\username).
Step 3 gives an error: either a connection cannot be made to server ... or AS is not running on this computer
When I try this with my local AS, 1 to 3 works fine (assumed I use localhost and integrated security)
Questions:
1) Is there any rule for user accounts to be able to create local cubes?
2) I get an error (no. -1056899072) in the sql profiler when I try step 3, but do not know how to go any further. Is there any description for this error?
Regards
Klaus Wiesel
Try to make sure the path you specify in your command is valid path for remote Analysis Server.
Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Sunday, February 19, 2012
Create device in emulator from Management Studio
i know i have the chance to access my mobile device (physical or emulator) from Management Studio.
I went to Connect Object Explorer, server type Sql Server Mobile but i can′t connect to my emulator and i can′t see any way to connect to a physical device either. How can i do this?
The only thing i can do is create a sql server mobile database (.sdf).
Thanks
SP
Moving to Sql Server Compact Edition forum where it has got better chance of being answered.
-Thanks,
Mohit
|||You can do this only if your device (or emulator) is connected through active sync.
Object Explorer:
Connect->
Database file-> Select 'Browse for more' and then select 'Mobile Device' from the file browser.
If you want to create a new database on the device, then just select 'New database' instead of 'Browse'
Thanks
Pragya
Friday, February 17, 2012
Create Db
how could I connect to MSDE like MSSQL using SQL anlayizer? are there
any other tools?
Thx.
hi,
"Rena" <Rena@.mail.hongkong.com> ha scritto nel messaggio
news:%23lMsMxydEHA.2520@.TK2MSFTNGP12.phx.gbl...
> Hi all,
> how could I connect to MSDE like MSSQL using SQL anlayizer? are there
> any other tools?
> Thx.
>
technically there's no difference connecting ot MSDE or SQL Server...
for third parties tools, both free and commercial, please have a look at
http://www.microsoft.com/sql/msde/partners/default.asp and/or
http://www.aspfaq.com/show.asp?id=2442
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply