dbTalk Databases Forums  

Incorrect syntax near 'ANSI_PADDING'.

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Incorrect syntax near 'ANSI_PADDING'. in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Incorrect syntax near 'ANSI_PADDING'. - 06-27-2008 , 07:00 AM






I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas. These
schemas come delivered as 4 or 5 SQL files. Let us call this "Membership
Schema". These are files delivered by Microsoft as part of the ASP.NET
membership system. Both projects are based on Microsoft SQL Server 2005
(standard edition, not the express version). In both database projects the
ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without any
problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:

/************************************************** ********************/
/* InstallCommon.SQL */
/* */
/* Installs the tables, triggers and stored procedures necessary for */
/* supporting some features of ASP.Net */
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/
/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named script
among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor window
("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project as
well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio




Reply With Quote
  #2  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM






I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #3  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #4  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #5  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #6  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #7  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #8  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #9  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
  #10  
Old   
....DotNet4Ever....
 
Posts: n/a

Default Re: Incorrect syntax near 'ANSI_PADDING'. - 06-30-2008 , 02:19 AM



I can't believe nobody has seen this error happening...

"....DotNet4Ever...." <hate.spam (AT) nowhere (DOT) com> wrote

Quote:
I have scripted my whole database and one of the parts that is installed in
two different database applications is the ASP.NET Membership schemas.
These schemas come delivered as 4 or 5 SQL files. Let us call this
"Membership Schema". These are files delivered by Microsoft as part of the
ASP.NET membership system. Both projects are based on Microsoft SQL Server
2005 (standard edition, not the express version). In both database projects
the ANSI_PADDING option is disabled.

Both of my projects use SQLCMD to run a "master script" that sequences all
the other 'child' SQL scripts including the 4-5 files mentioned above. In
project A the Membership Schema passes through the installation without
any problems.

I copied the same 4-5 files into Project B but when I run the script then
the very first SQL file of the Membership Schema using the standard
Microsoft SQL Server SQLCMD tool I get:

--> Starting execution of InstallCommon.SQL
Msg 102, Level 15, State 4, Server TLXDEV011, Line 1
Incorrect syntax near 'ANSI_PADDING'.

The only place in the InstallCommon.SQL (the first of the 4-5) where
ANSI_PADDING is mentioned is at the beginning:


/************************************************** ********************/
/* InstallCommon.SQL
*/
/*
*/
/* Installs the tables, triggers and stored procedures necessary for
*/
/* supporting some features of ASP.Net
*/
/*
** Copyright Microsoft, Inc. 2003
** All Rights Reserved.
*/

/************************************************** ********************/
PRINT '--> Starting execution of InstallCommon.SQL'
GO
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON -- We don't want (NULL = NULL) == TRUE
GO
SET ANSI_PADDING ON
GO
SET ANSI_NULL_DFLT_ON ON
GO
DECLARE @dbname nvarchar(128)
DECLARE @dboptions nvarchar(1024)

The strange facts are these:

1) The same file without modification executes flawlessley in the other
project
2) It only fails when run from SQLCMD.EXE (actually PowerShell invoking
SQLCMD which runs a master SQL script that "sources" the above named
script among many others.
3) When the same script is run within a Visual Studio 2005 SQL editor
window ("Run") it reports no problems and the schema is processed
4) When the same script is run within Microsoft SQL Server 2005 Management
Studio the schema is processed without problems.

So, why is this happening? I don't see anything wrong with the above "SET
ANSI_NULLS ON" and as I said, it works fine in another in another project
as well as in the same project but with different (Microsoft) tool.

Any input would be appreciated.

Regards,
Emilio





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.