Tuesday, March 27, 2012
Ability to import Data into SQL Server Express Edition
Express. I can connect to the server and create databases/tables just fine
but I can't seem to fine a way to import data into the table. The Data
Transformation wizard does not seem to be in the Management studio. Can
anybody give me some help in how to import data into express edition? Thanks,
Using the SQL 2000 version I use bcp (bulk copy) command line tool.
Don't know if the command is included in the 2005 version.
Ability to import Data into SQL Server Express Edition
Express. I can connect to the server and create databases/tables just fine
but I can't seem to fine a way to import data into the table. The Data
Transformation wizard does not seem to be in the Management studio. Can
anybody give me some help in how to import data into express edition? Thank
s,Using the SQL 2000 version I use bcp (bulk copy) command line tool.
Don't know if the command is included in the 2005 version.
Ability to import Data into SQL Server Express Edition
Express. I can connect to the server and create databases/tables just fine
but I can't seem to fine a way to import data into the table. The Data
Transformation wizard does not seem to be in the Management studio. Can
anybody give me some help in how to import data into express edition? Thanks,Using the SQL 2000 version I use bcp (bulk copy) command line tool.
Don't know if the command is included in the 2005 version.
Thursday, March 22, 2012
A war between me and the network admin over the SQL EXPRESS
The network admin is saying that if I run my SQL Express in the office , it will intefere with his SQL Server 2000 connection and its services.
He asked me to disconnect myself from the network and do the work locally, what the!?
I had my SQL express remote connection set to Local and remote connections (using TCP/IP connection )
However , I really dont believe a SQL express running on my laptop would in anyway steal incoming connection to the SQL server 2000 running on the company server.
I now have my SQL express set to Local connections only, I would like to ask you guys does SQL express actually conflict with ANY services running on the same network ?
Thanks a million
No actually not. The service is a server based network service, in the meaning that you wil lhave to adress the server or any virtual device in a cluster environment to establish a connection to the service. SQL Server does not "steal" anything.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de|||
Here is more detail:
The company runs a Window Server 2003 and SQL Server 2000 and exchange server. The SQL server has reporting service and some other "advanced features" available to other interstate's branch network.
My laptop has a SQL Express installed, and the SQL express is set to Local and TCP/IP connection. My laptop has ethernet connection to the company network for internet access. The domain of my laptop is "AAA" and it is used by the software division only (no one else within the same domain is running SQL express).
The admin is complaining about the MSSQLEXPRESS from my SQL Express is somehow affecting the server. How this could affect the win server 2003 in anyway? As Jens say the SQL Express is a server based network service, what I think is, unless you attempt to set your win server to bypass incoming SQL request to my laptop IP address which has a SQL Express running, otherwise my SQL express should not be able to steal or disturb other services running on different IP.
I would like to see anyone who has this problem before?
Thanks
|||Hi again,
to clarify: Compared to a telephone net, your telephone is called on a specific number. There is no chance that another telephone will ring and will be ansered if the caller dialed the right number. The telephone won′t force to aquire the incoming call. This is just a point2point connection.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Thanks Jens, me and my supervisor also think the SQL server express is a server and the nature of a server is to sit there listenining for incoming connection and serve data on request. Yeah, there is no point the server application is playing up because someone runs a SQL express on different IP address on different domain, different IP.
We don't know what got into the network admin but what is certain is we will try to avoid this guy as much as possible.
A vexing issue
Express for development. All of these databases except the one I've been
using most recently "cannot be opened due to inaccessible files or
insufficient memory'.
All of the databases show "recovery_pending" for status.
I tried to set them online with alter database, but get the message:
"File activation failure. The physical file name "...\mydb_log.ldf" may be
incorrect."
Looking at all of the "recovery_pending" databases, I see that all of the
log files are showing as "may be incorrect."
sp_helpdb gives me the message: "No permission to access database <mydb>"
DBCC CheckDB gives me the same message.
Thinking back through what has occured in the last few months (since these
were last used), I've done some minor system maintenance such as defrag and
Windows Updates, but nothing else has been changed. And the files still
reside in the directory where the log file is pointed to.
I'm baffled as to how to get these out of recovery, so any advice is
appreciated.Recovery Pending means that SQL Server need to do recovery for the database to bring it to a
consistent state. Recovery consists of REDO and UNDO, both parts are based on the entries in the
transaction log (ldf file). SQL Server feel that the ldf files are fishy or something similar, and
hence it cannot do recovery.
In most cases when I see something similar, it was somebody who deleted the log file or used some
other tool to reduce file size. If you are 100% certain that something like this didn't happen, then
you should carefully investigate the SQL Server errorlog file for all related error messages. Also
investigate the Windows eventlog for clues to what has happened to these files. Int he end, if you
cannot get these files back to healthy state, you are in for RESTORE DATABASE.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Earl" <earl@.nospam.com> wrote in message news:uiesseQjIHA.5160@.TK2MSFTNGP05.phx.gbl...
> Strange problem that I just noticed. I use a handful of databases in SQL2005 Express for
> development. All of these databases except the one I've been using most recently "cannot be opened
> due to inaccessible files or insufficient memory'.
> All of the databases show "recovery_pending" for status.
> I tried to set them online with alter database, but get the message:
> "File activation failure. The physical file name "...\mydb_log.ldf" may be incorrect."
> Looking at all of the "recovery_pending" databases, I see that all of the log files are showing as
> "may be incorrect."
> sp_helpdb gives me the message: "No permission to access database <mydb>"
> DBCC CheckDB gives me the same message.
> Thinking back through what has occured in the last few months (since these were last used), I've
> done some minor system maintenance such as defrag and Windows Updates, but nothing else has been
> changed. And the files still reside in the directory where the log file is pointed to.
> I'm baffled as to how to get these out of recovery, so any advice is appreciated.
>
>|||Thanks for the ideas Tibor. Nothing I could do would get those DBs out of
"recovery pending". But tonight, on the off-chance that it might work, I
went ahead and tried to detach. It gave me an error message that it could
not close the files, but in fact, once I refreshed, it HAD detached the
files! Just to confirm that they were actually detached, I created a new
directory and moved the .mdf and .ldf files in there with no problem. I then
re-attached and the previously in-recovery databases are functioning
normally.
It certainly seems strange that Microsoft did not provide an escape hatch
for this "Recovery Pending", i.e., in limbo, scenario.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:6B5D9B92-E6AC-485B-9053-E9BF2B109A94@.microsoft.com...
> Recovery Pending means that SQL Server need to do recovery for the
> database to bring it to a consistent state. Recovery consists of REDO and
> UNDO, both parts are based on the entries in the transaction log (ldf
> file). SQL Server feel that the ldf files are fishy or something similar,
> and hence it cannot do recovery.
> In most cases when I see something similar, it was somebody who deleted
> the log file or used some other tool to reduce file size. If you are 100%
> certain that something like this didn't happen, then you should carefully
> investigate the SQL Server errorlog file for all related error messages.
> Also investigate the Windows eventlog for clues to what has happened to
> these files. Int he end, if you cannot get these files back to healthy
> state, you are in for RESTORE DATABASE.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Earl" <earl@.nospam.com> wrote in message
> news:uiesseQjIHA.5160@.TK2MSFTNGP05.phx.gbl...
>> Strange problem that I just noticed. I use a handful of databases in
>> SQL2005 Express for development. All of these databases except the one
>> I've been using most recently "cannot be opened due to inaccessible files
>> or insufficient memory'.
>> All of the databases show "recovery_pending" for status.
>> I tried to set them online with alter database, but get the message:
>> "File activation failure. The physical file name "...\mydb_log.ldf" may
>> be incorrect."
>> Looking at all of the "recovery_pending" databases, I see that all of the
>> log files are showing as "may be incorrect."
>> sp_helpdb gives me the message: "No permission to access database <mydb>"
>> DBCC CheckDB gives me the same message.
>> Thinking back through what has occured in the last few months (since
>> these were last used), I've done some minor system maintenance such as
>> defrag and Windows Updates, but nothing else has been changed. And the
>> files still reside in the directory where the log file is pointed to.
>> I'm baffled as to how to get these out of recovery, so any advice is
>> appreciated.
>>
>|||> It certainly seems strange that Microsoft did not provide an escape hatch for this "Recovery
> Pending", i.e., in limbo, scenario.
What would the escape hatch be?
It is important to differentiate between a "real" Recovery Pending (RP) situation and a "false" one.
It seems you had a false RP situation. By "false" I mean that SQL server did already complete
recovery work, which is why you could detach and attach the databases without SQL Server
complaining. If you had a "real" RP situation, then SQL Server would *not* allow you to attach a
database for which recovery cannot complete. Why you experienced this false RP, I don't know.
Sometimes I see users who don't refresh the GUI, quite simply. There could be other things as well,
of course, I can't say. One option would have been to open a case with MS and have them sort out
whether it was a real or false RP case and if it was a false one sort out the bug in the product
that lead to this false RP situation.
There is a reason why there isn't an escape hatch for a *real* RP situation (almost, see end of this
paragraph) . It would leave the database in an inconsistent state. The data is inconsistent from a
logical viewpoint (foreign key and other constraints cannot be trusted, half-completed transactions
etc). But also from a physical viewpoint (system tables modifications half-done). Basically you
would have a useless database. This last two weeks I have worked with such a database. I've spent
two weeks to get inconsistent data out of 3 tables (yep, only 3 tables over two weeks). And I petty
the soul who will try to re-integrate this crap into the production database (which was restored
from a 1 month old backup). As you can imagine, this isn't something that MS want to expose to
normal users out there. If you do feel adventurous, you can read up on "Emergency mode". This is
your escape hatch. This should not be used unless you are en expert in SQL server, and you prefer
inconsistent data over your most recent backup.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Earl" <earl@.nospam.com> wrote in message news:OYbl276jIHA.4940@.TK2MSFTNGP02.phx.gbl...
> Thanks for the ideas Tibor. Nothing I could do would get those DBs out of "recovery pending". But
> tonight, on the off-chance that it might work, I went ahead and tried to detach. It gave me an
> error message that it could not close the files, but in fact, once I refreshed, it HAD detached
> the files! Just to confirm that they were actually detached, I created a new directory and moved
> the .mdf and .ldf files in there with no problem. I then re-attached and the previously
> in-recovery databases are functioning normally.
> It certainly seems strange that Microsoft did not provide an escape hatch for this "Recovery
> Pending", i.e., in limbo, scenario.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:6B5D9B92-E6AC-485B-9053-E9BF2B109A94@.microsoft.com...
>> Recovery Pending means that SQL Server need to do recovery for the database to bring it to a
>> consistent state. Recovery consists of REDO and UNDO, both parts are based on the entries in the
>> transaction log (ldf file). SQL Server feel that the ldf files are fishy or something similar,
>> and hence it cannot do recovery.
>> In most cases when I see something similar, it was somebody who deleted the log file or used some
>> other tool to reduce file size. If you are 100% certain that something like this didn't happen,
>> then you should carefully investigate the SQL Server errorlog file for all related error
>> messages. Also investigate the Windows eventlog for clues to what has happened to these files.
>> Int he end, if you cannot get these files back to healthy state, you are in for RESTORE DATABASE.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Earl" <earl@.nospam.com> wrote in message news:uiesseQjIHA.5160@.TK2MSFTNGP05.phx.gbl...
>> Strange problem that I just noticed. I use a handful of databases in SQL2005 Express for
>> development. All of these databases except the one I've been using most recently "cannot be
>> opened due to inaccessible files or insufficient memory'.
>> All of the databases show "recovery_pending" for status.
>> I tried to set them online with alter database, but get the message:
>> "File activation failure. The physical file name "...\mydb_log.ldf" may be incorrect."
>> Looking at all of the "recovery_pending" databases, I see that all of the log files are showing
>> as "may be incorrect."
>> sp_helpdb gives me the message: "No permission to access database <mydb>"
>> DBCC CheckDB gives me the same message.
>> Thinking back through what has occured in the last few months (since these were last used), I've
>> done some minor system maintenance such as defrag and Windows Updates, but nothing else has been
>> changed. And the files still reside in the directory where the log file is pointed to.
>> I'm baffled as to how to get these out of recovery, so any advice is appreciated.
>>
>>
>sql
Sunday, March 11, 2012
A Small Help Needed For a Beginner
I just want install ODBC driver for doing JDBC.How I must configure while installing SQl 2005 Express?.Which authentication I have to provide ?Whether Windows or SQL authentication?I want to connect jdbc odbc driver to my own system itself.
Thank You in advance.
There is no need to use an ODBC-JDBC bridge with SQL Server. You can download the latest JDBC driver here http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en
You can learn about the driver here http://msdn.microsoft.com/data/learning/jdbc/
Reference documentation is here http://msdn.microsoft.com/data/ref/jdbc/
|||
import java.sql.*;
public class AuthorsInfo
{
public static void main(String args[])
{
try
{
String str="SELECT * FROM sudheer";
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
/*Establish a connection with a data source*/
Connection con = DriverManager.getConnection("jdbc:sqlserver://localhost;user=MyUserName;password=*****");
/*Create a Statement object to process the SELECT statement*/
Statement stmt=con.createStatement();
/*Execute the SELECT SQL statement*/
ResultSet rs=stmt.executeQuery(str);
while (rs.next())
{
System.out.println(rs.getString(1)+rs.getString(2)+rs.getString(3));
}
con.close();
}
catch(Exception ex)
{
System.out.println("Error occurred");
System.out.println("Error:"+ex);
}
}
}
I wrote the code and it is giving no class found error.Where to set the class path CLASSPATH =.;C:\Program Files\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.1\enu\sqljdbc.jar?
How can I keep userid and password?
Thank You