|
Which version of SQL server you are using
Alomgir Miah
Live Life King Size
|
|
|
|
|
Restore an entire database:
RESTORE DATABASE { database_name | @database_name_var }
[ FROM < backup_device > [ ,...n ] ]
[ WITH
[ RESTRICTED_USER ]
[ [ , ] FILE = { file_number | @file_number } ]
[ [ , ] PASSWORD = { password | @password_variable } ]
[ [ , ] MEDIANAME = { media_name | @media_name_variable } ]
[ [ , ] MEDIAPASSWORD = { mediapassword | @mediapassword_variable } ]
[ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ]
[ ,...n ]
[ [ , ] KEEP_REPLICATION ]
[ [ , ] { NORECOVERY | RECOVERY | STANDBY = undo_file_name } ]
[ [ , ] { NOREWIND | REWIND } ]
[ [ , ] { NOUNLOAD | UNLOAD } ]
[ [ , ] REPLACE ]
[ [ , ] RESTART ]
[ [ , ] STATS [ = percentage ] ]
]
Live Life King Size
Alomgir Miah
|
|
|
|
|
mssql2000
Thanks
Rastegar
|
|
|
|
|
hey!nice to meet you,everyone.you can call me bill.can we make friends?
recently i posted a problem on the forum,but hasnot had an answer.could
you please help me?i'm worring about it.my question is:how to serialize
(save) object into SQL Server?for a instance:
<serializable()>_
public class employee
private _name as string
private _age as string
public property name() as string
get
return me._name
end get
set(byval value as string)
me._name=value
end set
end property
.........
maybe use DataSet as interface,but i failed.i think you are a
warmhearted man.please help me.thank you very very much.
good luck and make more money! bill(in Code Project's name is:maaaxwell)
|
|
|
|
|
maaaxwell wrote:
i think you are a warmhearted man
Some of us are warm hearted, and some of us are men. Not all are both, or even either
To serialise an object, you need to store it as a stream of bytes, so the first step is being able to convert an object to a byte stream. I'm pretty sure that's what serialising a class does anyhow. Basically the steps are:
1. convert object to bytes
2. store bytes in DB
3. get bytes back
4. convert bytes back into object.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hey!thanks for your reply!yeah,you are a warm hearted man
i know the four steps you wrote,but i havenot had any idea about how to serialize them into database(SQL Server),could you please write in detail?
thanks!
maaaxwell
|
|
|
|
|
I can't provide more detail because I have no idea what your objects are. What are you trying to store ?
Here[^] is an article on serializing classes. Once you have the ability to serialise to a stream, you can build a string to pass to the SQL, and use that string to deserialise.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How can I create a DTS package dynamically? I want to transfer data from tables in sql server to an access database.
The access database already exists but not the tables. The tables in the access database need to be created on the fly because I don’t know what tables will be transferred.
Thanks,
Martin
|
|
|
|
|
Check here
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
Hi,
I'm trying to get/set datetime field of exchange item (in resolution of Milliseconds) - using ADO.RecordClass.
However it seemed that after I call Record.Update (in set case) the datetime value is rounded in seconds resolution.
(i.e. trying to set 19:00:00.111 --> result with 19:00:01.000)
Please note - I'm using C# language to do so.
Can anyone help me to overcome this problem?
10x,
Zachi
|
|
|
|
|
I always use TimeSpan or DateTime as they have access to millisecond, please explain a little bit more why you are using ADO.RecordClass
Thanks
Al
|
|
|
|
|
Hi,
First, Thanks for your reply.
Here is the thing - I'm using ADO (as interop in c# project) to access exchange storage items.
When I tried to access record field of type 'datetime.tz' (using Record.Fields[<fieldname>].Value) either for reading or for writing - it seemed that ADO round DateTime fields with resolution of seconds (i.e. instead of getting '12:00:00.123' --> I'm getting '12:00:01').
Also, I'm using Exchange-Explorer tool to read/modify 'datetime.tz' field it succeed to do so (with resolution of milliseconds).
It is strange - but I checked retrieval using OLE-DB (not ADO) and it succeed to bring resolution of milliseconds (as should).
I will be more than grateful if you can help me with this one.
10x,
Zachi
|
|
|
|
|
I am using ADO classes but when I'm compiling my file im having linking errors that are:
--------------------Configuration: file_name - Win32 Debug--------------------
Compiling...
file_name.cpp
Linking...
file_name.obj : error LNK2001: unresolved external symbol "public: int __thiscall CADODatabase::Execute(char const *)" (?Execute@CADODatabase@@QAEHPBD@Z)
file_name.obj : error LNK2001: unresolved external symbol "public: int __thiscall CADODatabase::Open(char const *,char const *,char const *)" (?Open@CADODatabase@@QAEHPBD00@Z)
file_name.obj : error LNK2001: unresolved external symbol "public: void __thiscall CADODatabase::Close(void)" (?Close@CADODatabase@@QAEXXZ)
Debug/file_name.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
file_name.exe - 4 error(s), 0 warning(s)
I can't figure out what's the problem
Can you help me?
Thanks guys
Zvanolli
|
|
|
|
|
It seems that you must add to the project the files or the library where CADODatabase is defined.
Marc.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Hi,
I am writing a window desktop application which only
allow single user. Then is it necessary to have transaction
management for the data writing to the relational database ?
The data writing operation includes several steps (ie. if
the window hangs, then the operation may be corrupted).
Thanks
|
|
|
|
|
sure necessary especially if your writing operation has several steps.
think about if you get an error while inserting or deleting a record related to several tables. there would sure remain some unnecessary data in tables. (records that have been deleted or inserted before getting the error.)
|
|
|
|
|
Thanks for your reply.
But my program is not for enterprise application,
just for desktop single user. Is this still necessary coz
the addition of transaction into my program will cause a lot of effort ?
So are application like MSWord,...also adopts transactions ?
|
|
|
|
|
its up to you but if i were you i would use transaction. (depending uopn your words about the writing process)
anonymous wrote:
So are application like MSWord,...also adopts transactions ?
can you be more clear?
|
|
|
|
|
MSWord is not a database, so it neither supports not needs transactions. If you are making multiple related changes to multiple taples (for example: insert new row in main table, insert new row(s) in detail table using foreign key from new row in main table) you should always enclose these in a single transaction, so that if one of the dependant changes fails (an unexpected null value, an out of range value, etc. ) you can easily cancel the preceding changes (rollback the transaction). Adding the transaction support is relatively easy, and should not take much code,
Transactions really have nothing to do specifically with multi-user scenarios, instead the have to do with keeping changes consistent - preventing partial updates that could corrupt the data.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
When creating table in access, the default item is not null.
How to create item which could be null?
Thanks!
|
|
|
|
|
Open the table in design view. Select the field in which you wish to allow nulls
set the "Required" entry to "no". If the field is a text or memo type, you may also want to set "allow zero length" to yes (this allows an empty string as a value, not the same as a null).
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
hii all,
Am working with sql server 2000,i have a series problem my database log file is expanding in unusual way; my data file(MDF) just 50MB but my log is 2 GB can u imagine that. i know i can restrict size but why its expanding like this?
marcoryos
|
|
|
|
|
Wow 2 GB is quite a lot, make sure there are no errors, you can avoid using the LOG but changing to Simple. Thought to let you know!
Al
|
|
|
|
|
What is the recovery model set to? Unless it is 'simple', the log file will not be automatically truncated, but will continue to grow until you truncate it either by issuing a 'backup log with truncate only' or by making a full backup and truncating the log as part of the backup command. Otherwise all changes are saved for possible use in restoring the database changes since the last backup. The 'simple' recovery model says you are only going to depend on backups and won't use logs for restore, so the log will be truncated as soon as changes are commited.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Hi Folks,
Using
MS-SQL Server 2000
Windows XP Pro
VB 6
I need to find the actual data size for a nvarch, datefields, money etc.. using a SQL Statement. When I use the 'sp_column' command in SQL Server it doesn't tell me the actual field length that has been defined for the Table. Does anyone have a SQL Statement that can give me the correct field size. If you look at the table definition is Enterprise Manager it shows me the correct values. Just need to replicate this info into a sql statement.
Cheers,
Narly..
Narly
|
|
|
|