Monday, March 12, 2012
Help with a "select"
I want to "select" customer records from the file for which there is a 1993 record, but no 2004 record.
What would the select syntax be like?
Thanks in advance.Roughly:
Select * from Customers where Year(Fieldname) = '1993' and Customers.Cust_ID not in(select Cust_ID from Customers where Year(Fieldname) = '2004')
Friday, February 24, 2012
Help restore a database!
My PC crashed but was able to recover some of my data including the
directory and folder with SQL Server 2000. I bought a new PC and want
to restore some of my databases. I tried to create a new database with
the same name and then copy and paste data and log files to a Data
folder but the system wouldn't allow me to do that. Is there any other
way to use my data and log files to restore datbases on the new PC?
Many thanks!
Stan
suslishe@.mail.ruTry using sp_attach_db to attach the database files. For example:
EXEC sp_attach_db
'MyDatabase',
'C:\DataFiles\MyDatabase.mdf',
'C:\LogFiles\MyDatabase_Log.ldf'
Note that this may not work since your databases were not cleanly detached
using sp_detach_db. You may get lucky, though.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Suslishe" <suslishe@.netscape.net> wrote in message
news:d404c196.0312121220.20ef44be@.posting.google.c om...
> Hi SQL gurus!
> My PC crashed but was able to recover some of my data including the
> directory and folder with SQL Server 2000. I bought a new PC and want
> to restore some of my databases. I tried to create a new database with
> the same name and then copy and paste data and log files to a Data
> folder but the system wouldn't allow me to do that. Is there any other
> way to use my data and log files to restore datbases on the new PC?
> Many thanks!
> Stan
> suslishe@.mail.ru