Wednesday, March 28, 2012
Help! Uninstall
When you uninstall SQL Server (or MSDE), it leaves the database files
and the error logs (usually, in "C:\Program Files\Microsoft SQL
Server\MSSQL\Data" and "...\Log"). If the executable files were removed
(i.e. you don't have anything in "C:\Program Files\Microsoft SQL
Server\MSSQL\Binn" and in "C:\Program Files\Microsoft SQL Server\80",
etc), and if you don't need the data files, you can remove the
remaining files manually, before reinstalling SQL Server. If you do not
remove them before reinstalling, I think they would be overwritten,
anyway (without any error message).
RazvanThanks, Razvan!
--
Sandy
"Razvan Socol" wrote:
> Hi, Sandy
> When you uninstall SQL Server (or MSDE), it leaves the database files
> and the error logs (usually, in "C:\Program Files\Microsoft SQL
> Server\MSSQL\Data" and "...\Log"). If the executable files were removed
> (i.e. you don't have anything in "C:\Program Files\Microsoft SQL
> Server\MSSQL\Binn" and in "C:\Program Files\Microsoft SQL Server\80",
> etc), and if you don't need the data files, you can remove the
> remaining files manually, before reinstalling SQL Server. If you do not
> remove them before reinstalling, I think they would be overwritten,
> anyway (without any error message).
> Razvan
>
Monday, March 19, 2012
HELP! insert record
connect 'jdbc:rmi://localhost:1099/jdbc:cloudscape:customers;create=true'
;
drop table custProducts
;
drop table products
;
drop table custinfor
;
create table custinfor (
userName varchar (20) NOT NULL,
firstName varchar (20) NOT NULL,
lastName varchar (30) NOT NULL,
email varchar (30) NOT NULL,
password varchar (20) NOT NULL,
verify varchar (20) NOT NULL,
constraint pk_custinfor primary key (userName)
)
;
create table products (
productID int DEFAULT AUTOINCREMENT,
productName varchar (100) NOT NULL,
description varchar (100) NOT NULL,
price real NOT NULL,
imageFile varchar (50) NOT NULL,
constraint pk_products primary key (productID)
)
;
create table custProducts (
userName varchar (20) NOT NULL,
productID int NOT NULL,
constraint fk_custProducts_1 foreign key (userName)
references custinfor (userName),
constraint fk_custProducts_2 foreign key (productID)
references products (productID)
)
;
insert into custinfor (userName,firstName,lastName,email,password,verify ) values ('jSmith','John','Smith','sjohn@.hotmail.com','jsmi th123','jsmith123')
;
insert into custinfor (userName,firstName,lastName,email,password,verify ) values ('jess88','Jess','Ling','jess88@.yahoo.com','jess45 6','jess456')
;
insert into products (productName,description,price,imageFile) values ('Desktop-1','Intel Pentium 4 Processor 1.8Gb,256MB RAM',2998.00,'pentium4 processor.jpg')
;
insert into products (productName,description,price,imageFile) values ('Desktop-2','Intel Celeron Processor,256MB RAM',2260.00,'pentium4 processor.jpg')
;
insert into custProducts (userName,productID) values ('jSmith',1)
;
insert into custProducts (userName,productID) values ('jess88',2)
;
can someone tell me what's the mistake that i made?Hi:
Look... your problem is easy.
Please, try to execute one insert at the time and then you can figure which sentence has the problem.
One of them is tryng to insert a null value in a null column.|||At first glance, everything in your SQL looks good. I notice that you probably should handle the users' password verification in the UI instead of the DB, but that's a minor nit-pick.
Which statement gives you the error?|||thanks moku and avarta. i cancelled the some of the NOT NULL and it works. thanks.
Monday, March 12, 2012
HELP! database restore using SQL Express
I've try to do the database restore in Microsoft SQL Server 2005 Express using sql command as below:
RESTORE DATABASE testJG
FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Backup\JGsql.bak'
GO
But I get this error message.
Msg 3102, Level 16, State 1, Line 1
RESTORE cannot process database 'testJG' because it is in use by this session. It is recommended that the master database be used when performing this operation.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Does this means that I need to restore the master database from systems database to the database testJG before I restore the backup database?
Give this a try....
With your query window active, make sure that the current database you have selected from the drop-down is the Master db and not the testJG database. That should free up your the active connection that SQL is complaining about.
You should then be able to execute your restore command.
Regards,
John
|||Or, to be more explicit, add the command
USE MASTER;
to the beginning of your session, before the restore command.
|||Owesome....it works...
thank you.....thank you!!! I love you guys....
that really solved my problem and I could successfully restore the database now....
Monday, February 27, 2012
Help!
Quote:
Originally Posted by ghostrider
Okay I'm totally new to SQL, I need to write a program that has 2 tables, can any one help me get started?
Can you give us any more specifics?
What kind of program are you writing, what are the specs? What platform/programming language are you using?|||I'm using MS SQL 2005 Express. I'm trying to write a INSERT statement pulling data from my online school database and I'm not sure how to do it.|||
Quote:
Originally Posted by ghostrider
Okay I'm totally new to SQL, I need to write a program that has 2 tables, can any one help me get started?
Hi,
can you tell me clearly your requirements.really you want help for creating tables|||
Quote:
Originally Posted by ghostrider
I'm using MS SQL 2005 Express. I'm trying to write a INSERT statement pulling data from my online school database and I'm not sure how to do it.
If I understand correctly, you are trying to insert data from one table into another.
If these tables exist on different platforms you will need to write an application that does this.
I will assume both tables are in the same database.
INSERT INTO Table1(Column1,Column2)
SELECT Column1,Column2
FROM Table2|||Thanks this is what I was looking for. Thanks again!!!!