Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Monday, March 26, 2012

OUTER JOIN table limit?

I came across this statement from ASP.NET forum : "..There is a limit to the level for OUTER JOIN ANSI SQL limit is four after that you may get strange results. ..." . I did a little research but without getting clear answer from the SQL92 standard itself. I am wondering whether I can get help about this in SQL Server 2005 implementation here.

I put this question in another way, How many tables can we use in OUTER JOIN(or INNER JOIN) in SQL Server 2005?

Thanks.

There is no limit in the ANSI SQL standard or SQL Server. In fact, the ANSI SQL standard doesn't talk about such limits anywhere. They provide specifications on the syntax and how it should work etc. Note that a particular database implementation can have limits imposed. SQL Server 2005 for example has a maximum limit of 256 table references in a SELECT statement. So you can end up in some situation where the query optimizer cannot produce a plan due to insufficient resources in the system if the query is too complex and contains large number of table references. See below example for SQL Server 2005 which allows more than 4 outer joins:

with t(i)
as (
select 1
)
select *
from t as t1
left join t as t2
left join t as t3
left join t as t4
left join t as t5
left join t as t6
left join t as t7
left join t as t8
left join t as t9
left join t as t10
on t10.i = t9.i
on t9.i = t8.i
on t8.i = t7.i
on t7.i = t6.i
on t6.i = t5.i
on t5.i = t4.i
on t4.i = t3.i
on t3.i = t2.i
on t2.i = t1.i

|||

as far as sql server is concerned there is no limitation.

it could have been a limitation from data access tier

e.g. dataset

|||

Hello:

I was pointed to this "Three-Way Joins and Beyond" in SQL Pperformance Tuning by Peter Gulutzan and Trudy Pelzer.

Can I get some explaination for this statement: "You can expect the DBMS optimizer to start going wrong if five or more joins are in the query (until recently Microsoft's admitted limit was four). "

Is there anything I miss here?

This book was published on September 10, 2002.

Thank you.

|||

That article makes several incorrect assumptions and looks like the authors are not well informed about SQL Server. For example, the support for recognizing transitive predicates has been in the product since SQL Server 7.0. See link below:

http://www.microsoft.com/technet/prodtechnol/sql/70/reskit/part9/sqc13.mspx?mfr=true

I didn't go through all the chapters but the first page itself has several errors and doesn't apply to SQL Server. Performance of joins involving large number of tables can be a problem depending on the resources and the query plan. This has also been improved considerably in the product for every release starting from SQL 6x. If you are looking for querying tips for SQL Server, you may want to look at some of the new Inside SQL Server 2005 series for example.

|||

Hi Umachandar:

Thank you for answering this question. I used multiple outer joins to extract a dataset from my database. That table limit statement could pose a serious problem to my query if it were true for SQL Server 2000 or 2005.

Wednesday, March 21, 2012

Out Of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me the Out of Memory Error.


Content of the .bat file is
@.cd
@.osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@.pause


Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @.del_error int
DECLARE @.description VARCHAR(1000)

SELECT @.del_error= @.@.ERROR
SELECT @.description= description FROM MASTER..SYSMESSAGES WHERE error = @.del_error

IF @.del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @.description+' ARC_TABLENAME'
GO


Content of the .asp file is

<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>



Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this error Out of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh

I can't tell exactly what is going on here, but it seems to be limited to the web access method, since it works correctly from the batch file. So I would limit my search to that area - you might want to try turning on garbage collection:

http://support.microsoft.com/kb/911716

Buck Woody

Out of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me the Out of Memory Error.


Content of the .bat file is
@.cd
@.osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@.pause

Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @.del_error int
DECLARE @.description VARCHAR(1000)

SELECT @.del_error= @.@.ERROR
SELECT @.description= description FROM MASTER..SYSMESSAGES WHERE error = @.del_error

IF @.del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @.description+' ARC_TABLENAME'
GO


Content of the .asp file is
<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>

Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this error Out of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh
You need to troubleshoot from ASP side. It is unlikely this has anything to do with SQL or the batch file itself.

Out Of Memory

Hi Guys,
What i'm trying here is to run a .bat file containing Osql Command's on the server using asp. Which is Generating Out Of Memory Error.

In Detail.

This .bat file is having a Osql command to connect to a database with a parameter to run a .sql file and output parameter to give to output in .txt file. This is working fine if I simply run the .bat file on the server. its working fine no probes, but when I try the same from a .asp file running this .asp file from the same machine its giving me the Out of Memory Error.


Content of the .bat file is
@.cd
@.osql -U user -P Password -i c:\BatchUpdateTest\test.sql -o c:\BatchUpdateTest\test.txt
@.pause


Content of the .sql file is
SELECT * INTO ARC_TABLENAME TABLENAME
GO

DECLARE @.del_error int
DECLARE @.description VARCHAR(1000)

SELECT @.del_error= @.@.ERROR
SELECT @.description= description FROM MASTER..SYSMESSAGES WHERE error = @.del_error

IF @.del_error = 0
SELECT * FROM ARC_TABLENAME
ELSE
PRINT @.description+' ARC_TABLENAME'
GO


Content of the .asp file is

<%
var server_shell = Server.CreateObject("wscript.shell")
try{
server_shell.Run("c:\BatchUpdateTest\test.bat",1)
}catch(e){
Response.Write(e.description)
}
%>



Actualy when i run this code in the .bat file from .asp it did not give any error. So what i did is put a try catch block to trap the error which gives me this error Out of memory.

What should i do to solve this problem
Plz Help me out in this

Thanks in advance
Dinesh

I can't tell exactly what is going on here, but it seems to be limited to the web access method, since it works correctly from the batch file. So I would limit my search to that area - you might want to try turning on garbage collection:

http://support.microsoft.com/kb/911716

Buck Woody

Tuesday, March 20, 2012

OT: What news reader do you use

I have been out of the Usenet groups for some time. I have been hiding
on the DotNetNuke forum on ASP.Net.
I am impressed with the google web based reader but was wondering what
others are using these days.
BertOutlook Express
--
Keith
"bert" <bertcord@.gmail.com> wrote in message
news:1107354025.448962.275710@.z14g2000cwz.googlegroups.com...
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||I use Mozilla Thunderbird 1.0.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
bert wrote:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||Outlook Express.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"bert" <bertcord@.gmail.com> wrote in message
news:1107354025.448962.275710@.z14g2000cwz.googlegroups.com...
>I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||Outlook Express and Google
"bert" <bertcord@.gmail.com> wrote in message
news:1107354025.448962.275710@.z14g2000cwz.googlegroups.com...
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||"bert" <bertcord@.gmail.com> wrote in news:1107354025.448962.275710
@.z14g2000cwz.googlegroups.com:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>
Xnews.|||Hi Bert,
I use Agent. (Version 1.91, to be specific)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||If you like the Google Web interface than you may want to try
www.sqlmonster.com. In my opinion it is more convenient than Google.
--
Message posted via http://www.sqlmonster.com|||I am probably one of the few users that uses Netscape 4.79.
Gert-Jan
Hugo Kornelis wrote:
> Hi Bert,
> I use Agent. (Version 1.91, to be specific)
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||bert,
Why not look through the headers of all the posts in this group? You
will then get a pretty good idea what people use. What you will notice
is that quite a few people post through the microsoft website.
For example on my postings, you will usually see something like this in
the headers:
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
For Tibor you will see this:
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
For Celko you will see he uses Google:
User-Agent: G2/0.2
For website users you will see this:
X-Newsreader: Microsoft CDO for Windows 2000
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
bert wrote:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||Gnus.
--
Galen Boyer

OT: What news reader do you use

I have been out of the Usenet groups for some time. I have been hiding
on the DotNetNuke forum on ASP.Net.
I am impressed with the google web based reader but was wondering what
others are using these days.
Bert
I use Mozilla Thunderbird 1.0.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
bert wrote:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>
|||"bert" <bertcord@.gmail.com> wrote in news:1107354025.448962.275710
@.z14g2000cwz.googlegroups.com:

> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>
Xnews.
|||Hi Bert,
I use Agent. (Version 1.91, to be specific)
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||If you like the Google Web interface than you may want to try
www.sqlmonster.com. In my opinion it is more convenient than Google.
Message posted via http://www.sqlmonster.com
|||I am probably one of the few users that uses Netscape 4.79.
Gert-Jan
Hugo Kornelis wrote:
> Hi Bert,
> I use Agent. (Version 1.91, to be specific)
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
|||bert,
Why not look through the headers of all the posts in this group? You
will then get a pretty good idea what people use. What you will notice
is that quite a few people post through the microsoft website.
For example on my postings, you will usually see something like this in
the headers:
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
For Tibor you will see this:
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
For Celko you will see he uses Google:
User-Agent: G2/0.2
For website users you will see this:
X-Newsreader: Microsoft CDO for Windows 2000
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
bert wrote:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>
|||Gnus.
Galen Boyer

OT: What news reader do you use

I have been out of the Usenet groups for some time. I have been hiding
on the DotNetNuke forum on ASP.Net.
I am impressed with the google web based reader but was wondering what
others are using these days.
BertI use Mozilla Thunderbird 1.0.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
bert wrote:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||"bert" <bertcord@.gmail.com> wrote in news:1107354025.448962.275710
@.z14g2000cwz.googlegroups.com:

> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>
Xnews.|||Hi Bert,
I use Agent. (Version 1.91, to be specific)
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||If you like the Google Web interface than you may want to try
www.droptable.com. In my opinion it is more convenient than Google.
Message posted via http://www.droptable.com|||I am probably one of the few users that uses netscape 4.79.
Gert-Jan
Hugo Kornelis wrote:
> Hi Bert,
> I use Agent. (Version 1.91, to be specific)
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||bert,
Why not look through the headers of all the posts in this group? You
will then get a pretty good idea what people use. What you will notice
is that quite a few people post through the microsoft website.
For example on my postings, you will usually see something like this in
the headers:
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
For Tibor you will see this:
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
For Celko you will see he uses Google:
User-Agent: G2/0.2
For website users you will see this:
X-Newsreader: Microsoft CDO for Windows 2000
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
bert wrote:
> I have been out of the Usenet groups for some time. I have been hiding
> on the DotNetNuke forum on ASP.Net.
> I am impressed with the google web based reader but was wondering what
> others are using these days.
> Bert
>|||Gnus.
--
Galen Boyer

Saturday, February 25, 2012

osql

i'm trying to execute some scripts created by the express studio script wizard. i can connect with the studio, the website (asp worker) but i can't create the right cmdline for osql ..... this is my osql line ......

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>osql -S (local)\\SQLEXPRESS -U sa -P sablah -i run.sql.......

this is the error i'm getting in my logs

Error: 18456, Severity: 14, State: 16.
2006-12-22 15:30:45.11 Logon Login failed for user 'sa'. [CLIENT: <local machine>]

"Server=(local)\\SQLEXPRESS;Database=ggmi;User Id=sa;Password=cr79cr02;Trusted_connection=false;";

the following is the working connection string for my aspworker.

"Server=(local)\\SQLEXPRESS;Database=ggmi;User Id=sa;Password=cr79cr02;Trusted_connection=false;";

when i try to put in the trust conenction parameter is says that it conflicts with the user flag ,. probably because its a differant type of login process. any ideas?

First, you only use EITHER username/password OR Trusted_Connection -NOT both. So the second connection string should fail.

Second, in the connection string, the server 'should' have only one [\] between the machinename and the instancename.

|||Yah, i believe i posted that. for asp.net the string actually works. i know why its not supposed to be there. and thats obivously why i can't add that argument to the osql statement. but i'm still left with the original posting of my error. i'm not missing anything in my osql statement?|||

Reading your post again, it seems that you indicated that your ASP connection string failed.

is98 wrote:

the following is the working connection string for my aspworker.

"Server=(local)\\SQLEXPRESS;Database=ggmi;User Id=sa;Password=cr79cr02;Trusted_connection=false;";

when i try to put in the trust conenction parameter is says that it conflicts with the user flag ,. probably because its a differant type of login process. any ideas?

ASP may be able to handle the two backslashes in the servername, but OSQL cannot. And if I recall, doesn't ASP use (localhost) instead of (local)?

Try: "server=(local)\SQLExpress" INSTEAD OF "Server=(local)\\SQLEXPRESS"

|||who the man? you the man. the localhost part works still ok. i just took out the extra slash which obiviously now explains why it couldn't find the server. thanks muchly.|||

The double back-slash is an escape character for C based languages, such as C#. When ever you want to pass a backslash in a C based language, you either need to use the "\\" escape sequence or use the @. to indicate a litteral string. You are passing literal strings to oSQL, not C#, so the "\\" is not needed, as you've found.

Just thought you'd be interested in understanding that this wasn't just random behaivor.

Mike