Showing posts with label statement. Show all posts
Showing posts with label statement. Show all posts

Tuesday, March 20, 2012

3 table join

Does anyone know how to construct a select statement for a
3 table join ?. I want a left join with the table1 and
table2, then I want an inner join with table2 and table3.
Can this be done ? If so how can a Select statement would
be?
Thanks for any help.
Mike.
There is a 3 table join example in BOL [Index: SELECT, examples (example
B)]. There are also a number of outer join examples [Index: outer joins,
using outer joins]. Why not take a chance and try it yourself?
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.
|||When joining two tables you will have one JOIN and (at least) one ON.
When joining three tables you will have two JOINs and (at least) two ONs.
You will want to join on your primary/foreign key(s).
Give it a shot. post back to the newsgroups if you get stuck.
Keith
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.

3 table join

Does anyone know how to construct a select statement for a
3 table join ?. I want a left join with the table1 and
table2, then I want an inner join with table2 and table3.
Can this be done ? If so how can a Select statement would
be?
Thanks for any help.
Mike.There is a 3 table join example in BOL [Index: SELECT, examples (exampl
e
B)]. There are also a number of outer join examples [Index: outer join
s,
using outer joins]. Why not take a chance and try it yourself?
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.|||When joining two tables you will have one JOIN and (at least) one ON.
When joining three tables you will have two JOINs and (at least) two ONs.
You will want to join on your primary/foreign key(s).
Give it a shot. post back to the newsgroups if you get stuck.
Keith
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.sql

3 table join

Does anyone know how to construct a select statement for a
3 table join ?. I want a left join with the table1 and
table2, then I want an inner join with table2 and table3.
Can this be done ? If so how can a Select statement would
be?
Thanks for any help.
Mike.There is a 3 table join example in BOL [Index: SELECT, examples (example
B)]. There are also a number of outer join examples [Index: outer joins,
using outer joins]. Why not take a chance and try it yourself?
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.|||When joining two tables you will have one JOIN and (at least) one ON.
When joining three tables you will have two JOINs and (at least) two ONs.
You will want to join on your primary/foreign key(s).
Give it a shot. post back to the newsgroups if you get stuck.
--
Keith
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:1f8701c50885$7d35d640$a501280a@.phx.gbl...
> Does anyone know how to construct a select statement for a
> 3 table join ?. I want a left join with the table1 and
> table2, then I want an inner join with table2 and table3.
> Can this be done ? If so how can a Select statement would
> be?
> Thanks for any help.
> Mike.

Sunday, March 11, 2012

2nd INSERT INTO statement in a Button click event

Hi everyone.
I am trying to write 2 INSERT INTO statements into a Button click event. Both statements go to the same database but differnet tables. The first statement works fine but the 2nd causes an error with the Try, Catch, Finally statement. When I remove the ExecuteNonQuery from the 2nd statement, the 2nd INSERT INTO statement fails to work. Any help would be brilliant. Thanks!

Private Sub btnInsertChange_Click(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles btnInsertChange.Command

'Insert Guide changes into ChangesReport table in sql server
Me.SqlCommandThemeTest.Connection = Me.SqlConnection1

Dim Name As String
Dim values As String
Dim sSQL As String
Name = "Theme, Guide, GuidePage, PageType, ChangeCategory, ChangeFrom, ChangeFromText, ChangeTo, ChangeToText ContentManager"
values = "lstTheme, lstGuideName, lstGuidePage, lstPageType, lstChangeCategory, lstChangeFrom, txtChangeFrom, lstChangeTo, txtChangeTo, Label1"
SqlCommandThemeTest.CommandText = "INSERT INTO dbo.ChangesReport (Theme, Guide, GuidePage, PageType, ChangeCategory, ChangeFrom, ChangeFromText, ChangeTo, ChangeToText, ContentManager) VALUES (@.themeValue, @.guideValue, @.guidepageValue, @.pagetypeValue, @.changecategoryValue, @.changefromValue, @.changefromtextValue, @.changetoValue, @.changetotextValue, @.contentmanagerValue)"

SqlCommandThemeTest.Parameters.Add("@.themeValue", lstTheme.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.guideValue", lstGuideName.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.guidepageValue", lstGuidePage.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.pagetypeValue", lstPageType.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.changecategoryValue", lstChangeCategory.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.changefromValue", lstChangeFrom.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.changefromtextValue", txtChangeFrom.Text)
SqlCommandThemeTest.Parameters.Add("@.changetoValue", lstChangeTo.SelectedItem.Text)
SqlCommandThemeTest.Parameters.Add("@.changetotextValue", txtChangeTo.Text)
SqlCommandThemeTest.Parameters.Add("@.contentmanagerValue", Label1.Text)

Try
Me.SqlConnection1.Open()
Me.SqlCommandThemeTest.ExecuteNonQuery()
Catch ex As Exception
Response.Write(ex.ToString)
Finally
Me.SqlConnection1.Close()
End Try


'Insert textbox to ChangeLogFrom ddl
Me.CmdDDLFromUpdate.Connection = Me.SqlConnection1

Name = "ChangeFromText"
values = "txtChangeFrom"
sSQL = "INSERT INTO dbo.Change Log From (ChangeLogFrom) VALUES (@.changelogfromValue)"
Me.CmdDDLFromUpdate.Parameters.Add("@.changelogfromValue", txtChangeFrom.Text)

Try
Me.SqlConnection1.Open()
Me.CmdDDLFromUpdate.ExecuteNonQuery()
Catch ex As Exception
Response.Write(ex.ToString)
Finally
Me.SqlConnection1.Close()
End Try

I have tried various different things with these 2 statements but can still only get the first to insert.

Any advice would be great. Thanks

|||

It's hard to tell since you've only cut and pasted certain parts of the code. For example, I don't see where you've set the commandtext of the second sqlcommand. I see the sSQL string being set, but that isn't the same thing.

You might also want the keep the sqlconnection open for both updates, no use in closing it then reopening it.

|||Why dont you pass all the parameters to a stored proc and do both the inserts there. That will save you a round trip and your code will be at one place.

260 Table Limit

A Select statement is limited to 260 tables. Tables included in nested view
s
and UDF's are included in the table total. Is there an easy way to determin
e
how many tables a Select statement is currently using? For example, I'd lik
e
to know if sproc X is currently at 259 tables.Wow,Dave do you reall deal with 260tables within a single SP?

> and UDF's are included in the table total. Is there an easy way to
> determine
> how many tables a Select statement is currently using?
No , that I'm aware
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:93191E1B-B7F6-4B85-9930-233CE6345555@.microsoft.com...
>A Select statement is limited to 260 tables. Tables included in nested
>views
> and UDF's are included in the table total. Is there an easy way to
> determine
> how many tables a Select statement is currently using? For example, I'd
> like
> to know if sproc X is currently at 259 tables.|||Hi Dave
There is no easy way of doing this, even if sysdepends was reliable, you
could not differentiate between different statements in your
procedure/function.
The question you would have to ask is why does your design reach this limit?
John
"Dave" wrote:

> A Select statement is limited to 260 tables. Tables included in nested vi
ews
> and UDF's are included in the table total. Is there an easy way to determ
ine
> how many tables a Select statement is currently using? For example, I'd l
ike
> to know if sproc X is currently at 259 tables.|||I've seen partitioned views that unionize more than 100 tables, but never a
single select with that many joins. This imposed 260 table limit is
basically a sanity constraint and there for the safety of yourself and
others.
"Dave" <Dave@.discussions.microsoft.com> wrote in message
news:93191E1B-B7F6-4B85-9930-233CE6345555@.microsoft.com...
>A Select statement is limited to 260 tables. Tables included in nested
>views
> and UDF's are included in the table total. Is there an easy way to
> determine
> how many tables a Select statement is currently using? For example, I'd
> like
> to know if sproc X is currently at 259 tables.|||> Is there an easy way to determine
> how many tables a Select statement is currently using?
Being someone who has reached this limit once or twice, I understand
your concern. If this limit is a "sanity constraint", it would be good
to know how "sane" are we, regarding a particular statement.
I found a method to aproximate the number (the real number may be a bit
higher): issue a SET SHOWPLAN_ALL ON before executing the SELECT (in
Query Analyzer / Management Studio), then count the number of rows
where the Argument column begins with "OBJECT:" (you can do this by
copying the result to Excel, for example). This number can be smaller
than the real number of tables, because the query plan is already
optimized (so it doesn't show the tables that are present in the
statement or the views, but are unnecessary for returning the specified
columns).
Razvan

Thursday, March 8, 2012

24000 Invalid cursor state. Prepared Statement

I have written a routine to search a unique record using prepared statement. Its my first sql coding with c++.

I am not using / importing any dlls.

I connect+allocs handels , then use SQLPrepare(StmtHandle, SQLStmt,SQL_NTS); to generate a guery.

I have written bind parameters and sqlexecute +sqlFetch in a loop and loop gets executed till ESC key is pressed.

First time when I bind paramaters using SQLBindParameter it works perfect.

When loop gets executed secondtime onwards, it gives an error.
SQLState: 24000 [ODBC Client Interface]Invalid cursor state.

If I open connection, handles, and prepared starement in same loop, THEN it gives correct record without 24000 error.

I want the advantage of prepared staement. So I do not want to close and open connection and prepare statement every time.

Have I missed any step?
Where & when I should code the cursor type? Any specific libraries I need to link?

Thanksyes you missed something. see brett's sticky at the top of the page.|||I traced the solution.

I thought that the mistake is in declaring scrollable cursors.

So I explained precisouly the problem in 7-8 lines.
Reading 50-60 lines with altogether different coding standards is difficult.

Its not coding problem but associated with scrollable cursor options.
So I did not include the code.

MSDN examples does not show such required step as the scope of example code gets over before such situation is reached!!.

Saturday, February 25, 2012

2005 transactional replication statement delivery

Hi There

WHen creating publciations under 2005 i saw a very interesting option under stament delivery, for inserts , updates , deletes there is an option that simply says insert/update/delete statement.

I could find very little in BOL about this under "Article Properties", is this what it soudns like ? FOr example if you say :

update Table set Cloumn = 'whatever', this will not trigger the update sp for each row at the subscriber , will it actually deliver the update statements and literally do the update/insert/delete statement at the subscriber?

Thanx

Yes. It is equivalent to supply value 'SQL' for parameter @.ins_cmd/@.upd_cmd/@.del_cmd in sp_addarticle. For more information, please take a look at the document for sp_addarticle http://msdn2.microsoft.com/en-us/library/ms173857.aspx.

Peng

|||just an FYI, using SQL instead of the custom stored procedures has a negative perf impact, it's primarily used for non-SQL server subscribers. Stick with the custom stored procs if you can.|||

HI Greg

That is a very interresting point you bring up.

I was thinking of it exactly for performance, often in replication we perfom an update statement on the publisher that may take 10 minutes to execute and update say 2 millions rows. However this causes replication latency of up to half an hour at the subscriber at the execution of the MSupd_repl proc 2 million times is slow sometimes each execution of the proc can take a tenth of a second which is alot when you have millions of rows to update, performing the same update at the subscriber would take 10 minutes.

So i actually thought this option could help but apparantly not ?

|||

Hi Dietz,

Change delivery method to "SQL" won't help the performance as replication will still deliver the changes row by row. It means that, in your example, we still call update 2 million times. To solve this problem, you can utilize the SQL 2005 functionality "Publishing Stored procedure Execution in Transactional Replication". More info can be found here (http://msdn2.microsoft.com/en-us/library/ms152754.aspx). It will require you to use stored procedures for your update though.

Peng

|||

The performance you're seeing has nothing to do with SQL vs custom stored procs. In fact, if you used SQL, I bet it owuld be much slower since with SQL, multiple commands are batched then sent via one parameterized statement. With custom stored procs, the proc is compiled once, with SQL, you're pretty much guaranteed that no two batches will be the same, thus you'll have a ton of compilations.

What you're experiencing can be worked around by replicating the execuction of a stored procedure. http://msdn2.microsoft.com/en-us/library/ms152754.aspx.

|||

Thanx Pend and Greg for the feedback, but how is this different from the usual method if it will still call update 2 millios times. DO you mean that instead of calling the MSupd sp on the sunscriber it delivers and update statement for each row?

I am aware of the sp publication method which was available in 2000 i thought this was somehow a similar concept. Thanx

|||If you issue a single update statement at the publisher that affects 2 million rows, you will get 2 million update statements, one for each row, replicated to the subscriber regardless whether you use SQL or custom stored procedures. If you do these batches often, not only can you experience long latency but your distribution database will fill up quickly. In these cases, it's recommended to replicate the execution of a stored procedure if latency and disk space is an issue. By putting your update statement in a proc, and replicating proc execution, rather than send 2 million deletes, it sends the proc call to the subscriber. Now you only have one command instead of 2 million.|||

Hi Greg

Yes that is wagt i thought, however we are getting rid of replication, but good to know.

Thanx

Monday, February 13, 2012

2005 Express Edition CREATE statement issues

Hello everyone,

i am using the Express Edition to build an application which requires rather large databases to store binary documents. I've been experiencing weird behaviour with the Express Edition on Vista and XP running the following CREATE statement:

Code Snippet

USE master;
GO
CREATE DATABASE [document_archive]
ON PRIMARY
( NAME='document_archive_Primary',
FILENAME='D:\Data\document_archive.mdf',
SIZE=32MB,
MAXSIZE=1536MB,
FILEGROWTH=10%)
LOG ON
( NAME='document_archive_Log',
FILENAME = 'D:\Data\document_archive.ldf',
SIZE=8MB,
MAXSIZE=64MB,
FILEGROWTH=10%);
GO

The server is telling me that everything went ok but the database doesent show up in the TreeView, nor it is accessible. Retrying to execute the script i cought an error telling me that the database couldnt be created because of existing files, which is the behaviour Id expect.

I dropped the database and went testing the script on a SQL 2000 Server Enterprise Edition which worked as expected, immediately showing up in the TreeView.

As far i remember the 2005 Express Edition can handle databases up to 2GB (or maybe 5GB? Dont remember exactly).

I am having a hard time to figure out what might cause the weird behaviour.

However, heres the system specs of the two 2005 Express installations:

Box#1: Vista RC1

Box#2: XP SP 2

Both running SQL Server 2005 Express Edition SP2, installed on 'C:\Program Files\Microsoft SQL Server', having tons of free disk space and spare resources to handle this CREATE statement and requests.

Any hint that might help solve my issue would be greatly appreciated Smile

Many thanks in advance,

Yours,

trahho.

How are running this script?

When you run the script above, can you immediately run a select * from sys.databases and see if your database is listed.

The DB limit for Express is 4gb so there is not a problem there.

Sunday, February 12, 2012

2005 drivers don't like my select statement

Hello,
When I used the MS Sqlserver 2000 jdbc drivers my java code that had the
following query worked fine...
the query looks like
IF EXISTS (SELECT * FROM sysobjects WHERE id =
object_id('db_hash_admin_advice_CoopSinkInterchang e')) SELECT 1 ELSE
SELECT 0
Now with the 2005 drivers..I get the following exception
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near
the keyword 'SELECT'.
at
com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(Unknown
Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPacke ts(Unknown Source)
at
com.microsoft.sqlserver.jdbc.SQLServerStatement.ge tNextResult(Unknown
Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.se ndExecute(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerStatement.do ExecuteQuery(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStat ement.executeQuery(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerCallableStat ement.executeQuery(Unknown
Source)
....
....
.....
I don't think the query has a problem as it executes fine in query analyser.
should this be logged as a bug?
I am currently usinf SQLServer 2000.
Regards
chhil
Mc,
It definitelly sounds like a bug, but I have not been able to reproduce your
problem, do you have a standalone repro for this?
Here is what I have tried:
import java.sql.*;
public class test{
public static void main(String[] args) {
try{
java.lang.Class.forName("com.microsoft.sqlserver.j dbc.SQLServerDriver");
Connection connection1 =
java.sql.DriverManager.getConnection(connectionStr ing);
System.out.println("Connected!");
Statement statement1 = connection1.createStatement();
try{
statement1.execute("IF EXISTS (SELECT * FROM sysobjects WHERE
id = object_id('db_hash_admin_advice_CoopSinkInterchang e')) SELECT 1 ELSE
SELECT 0");
}catch(Exception e){
e.printStackTrace();
}
System.out.println("done");
}catch(Exception ex){
ex.printStackTrace();
}
}
}
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"mc" <incorrect@.hotmail.com> wrote in message
news:%23DFK1S5jFHA.2852@.TK2MSFTNGP14.phx.gbl...
> Hello,
> When I used the MS Sqlserver 2000 jdbc drivers my java code that had the
> following query worked fine...
> the query looks like
> IF EXISTS (SELECT * FROM sysobjects WHERE id =
> object_id('db_hash_admin_advice_CoopSinkInterchang e')) SELECT 1 ELSE
> SELECT 0
> Now with the 2005 drivers..I get the following exception
> com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the
> keyword 'SELECT'.
> at
> com.microsoft.sqlserver.jdbc.SQLServerException.ma keFromDatabaseError(Unknown
> Source)
> at com.microsoft.sqlserver.jdbc.IOBuffer.processPacke ts(Unknown Source)
> at com.microsoft.sqlserver.jdbc.SQLServerStatement.ge tNextResult(Unknown
> Source)
> at com.microsoft.sqlserver.jdbc.SQLServerStatement.se ndExecute(Unknown
> Source)
> at com.microsoft.sqlserver.jdbc.SQLServerStatement.do ExecuteQuery(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStat ement.executeQuery(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerCallableStat ement.executeQuery(Unknown
> Source)
> ...
> ...
> ....
> I don't think the query has a problem as it executes fine in query
> analyser.
> should this be logged as a bug?
> I am currently usinf SQLServer 2000.
> Regards
> chhil
|||Hello Angel,
The difference is I use a CallableStatement to get a resultset back...
Snippet below...
CallableStatement stmt = null;
ResultSet rs = null;
try
{
stmt = con.prepareCall(
"IF EXISTS (SELECT * FROM sysobjects WHERE id =
object_id('"+table_name+"')) SELECT 1 ELSE SELECT 0 ");
rs = stmt.executeQuery();
if (rs.next())
{
if (rs.getInt(1) == 1)
return true;
}
return false;
}
finally
{
if (stmt != null)
stmt.close();
if (rs != null)
rs.close();
}
Angel Saenz-Badillos[MS] wrote:
> Mc,
> It definitelly sounds like a bug, but I have not been able to reproduce your
> problem, do you have a standalone repro for this?
> Here is what I have tried:
> import java.sql.*;
> public class test{
> public static void main(String[] args) {
> try{
> java.lang.Class.forName("com.microsoft.sqlserver.j dbc.SQLServerDriver");
> Connection connection1 =
> java.sql.DriverManager.getConnection(connectionStr ing);
> System.out.println("Connected!");
> Statement statement1 = connection1.createStatement();
> try{
> statement1.execute("IF EXISTS (SELECT * FROM sysobjects WHERE
> id = object_id('db_hash_admin_advice_CoopSinkInterchang e')) SELECT 1 ELSE
> SELECT 0");
> }catch(Exception e){
> e.printStackTrace();
> }
> System.out.println("done");
> }catch(Exception ex){
> ex.printStackTrace();
> }
> }
> }
>
|||Hello Angel,
The difference is I use a CallableStatement...
Snippet below...
CallableStatement stmt = null;
ResultSet rs = null;
try
{
stmt = con.prepareCall(
"IF EXISTS (SELECT * FROM sysobjects WHERE id =
object_id('"+table_name+"')) SELECT 1 ELSE SELECT 0 ");
rs = stmt.executeQuery();
if (rs.next())
{
if (rs.getInt(1) == 1)
return true;
}
return false;
}
finally
{
if (stmt != null)
stmt.close();
if (rs != null)
rs.close();
}
Angel Saenz-Badillos[MS] wrote:
> Mc,
> It definitelly sounds like a bug, but I have not been able to reproduce your
> problem, do you have a standalone repro for this?
> Here is what I have tried:
> import java.sql.*;
> public class test{
> public static void main(String[] args) {
> try{
> java.lang.Class.forName("com.microsoft.sqlserver.j dbc.SQLServerDriver");
> Connection connection1 =
> java.sql.DriverManager.getConnection(connectionStr ing);
> System.out.println("Connected!");
> Statement statement1 = connection1.createStatement();
> try{
> statement1.execute("IF EXISTS (SELECT * FROM sysobjects WHERE
> id = object_id('db_hash_admin_advice_CoopSinkInterchang e')) SELECT 1 ELSE
> SELECT 0");
> }catch(Exception e){
> e.printStackTrace();
> }
> System.out.println("done");
> }catch(Exception ex){
> ex.printStackTrace();
> }
> }
> }
>
|||I was able to repro the issue with the callable statement and have entered a
bug so that we can take a look at this asap. I would still recomend entering
a bug throught the feedback center so that you can track the bug going
forward.
Thank you for taking the time to report this issue.
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"mc" <incorrect@.hotmail.com> wrote in message
news:um$FXRekFHA.3300@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> Hello Angel,
> The difference is I use a CallableStatement to get a resultset back...
> Snippet below...
>
> CallableStatement stmt = null;
>
> ResultSet rs = null; try
> {
> stmt = con.prepareCall( "IF EXISTS (SELECT * FROM sysobjects WHERE id =
> object_id('"+table_name+"')) SELECT 1 ELSE SELECT 0 ");
> rs = stmt.executeQuery(); if (rs.next())
> {
> if (rs.getInt(1) == 1)
> return true;
> } return false;
> }
> finally
> {
> if (stmt != null)
> stmt.close();
> if (rs != null)
> rs.close();
> }
>
> Angel Saenz-Badillos[MS] wrote:
|||Looked at MSDN product feedback and did not find anything JDBC releated,
should this be logged against sql server 2005?
Regards mc
Angel Saenz-Badillos[MS] wrote:
> I was able to repro the issue with the callable statement and have entered a
> bug so that we can take a look at this asap. I would still recomend entering
> a bug throught the feedback center so that you can track the bug going
> forward.
> Thank you for taking the time to report this issue.
|||Sorry, I should have been more explicit:
Entering a bug:
Go to http://lab.msdn.microsoft.com/produc...k/default.aspx
Product/Technology:
SQL Server 2005
Version:
SQL Server 2005 Community Technology Preview June 2005 - Developer
Edition
Product Language:
English
Category:
JDBC Driver
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"mc" <incorrect@.hotmail.com> wrote in message
news:%238UetJikFHA.1372@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Looked at MSDN product feedback and did not find anything JDBC releated,
> should this be logged against sql server 2005?
> Regards mc
> Angel Saenz-Badillos[MS] wrote:
|||To make sure it gets routed correctly it would also help if you placed "JDBC
2005" on the title
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"Angel Saenz-Badillos[MS]" <angelsa@.online.microsoft.com> wrote in message
news:evwIH5ikFHA.3148@.TK2MSFTNGP09.phx.gbl...
> Sorry, I should have been more explicit:
> Entering a bug:
> Go to http://lab.msdn.microsoft.com/produc...k/default.aspx
> Product/Technology:
> SQL Server 2005
> Version:
> SQL Server 2005 Community Technology Preview June 2005 -
> Developer Edition
> Product Language:
> English
> Category:
> JDBC Driver
>
> --
> Angel Saenz-Badillos [MS] DataWorks
> This posting is provided "AS IS", with no warranties, and confers no
> rights.Please do not send email directly to this alias.
> This alias is for newsgroup purposes only.
> I am now blogging: http://weblogs.asp.net/angelsb/
>
>
> "mc" <incorrect@.hotmail.com> wrote in message
> news:%238UetJikFHA.1372@.TK2MSFTNGP10.phx.gbl...
>
|||Hi,
I have created a bug report.
Regards MC
Angel Saenz-Badillos[MS] wrote:
> To make sure it gets routed correctly it would also help if you placed "JDBC
> 2005" on the title
>