Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Wednesday, March 21, 2012

DataBase Backup

Hi,

I am using one database to store some information, which is now in my local system.Now i want to create a copy of the database, which is in my system to another system (including the data in the table's and the stored procedures i have created).

Is this possible. if yes please help

Thanks in advance....

If you want to use the database with data then you can RESTORE this A database with a new name.

If not you can script this database with all objects and use the same script to create another database with new name.

Refer to books online for RESTORE and SCRIPT for more information.

Sunday, March 11, 2012

Database as stripchart recorder - is it feasible?

We want to use SqlServer Express as a data recorder for a piece of equipment. The purpose is to store all possible data values the equipment generates for a length of time so that if a problem occurs, we can search through the data to see what happened. The data is floating point numbers, like temperatures, etc.

For example, there are 200 sensors on the equipment. Every second, we want to store the 200 sensor values. The database would be one big table with 200 columns for the sensors and each second we write a row of data. Every day, the equipment would delete data older than 30 days, so that the database doesn't grow past a certain size.

Questions:

1. Any obvious reason we can't do this?

2. 30 days * 200 values * 4 bytes/value creates a 2 GB database. SqlServer Express should be able to handle that, right?

3. The equipment is running at a customer site. If the customer has a problem, we would like to be able to say to them something like, "Retrieve 3 hours of data starting last Monday at noon for Sensors A, B, and C and email it to us." We plan to give them an application that will let them put in a time range and select which sensors; it will search the database, collect the resulting data and put it in a file to send to us. Any recommendations on what format the file be in? Text? XML? Is there an obvious format that one uses to store a chunk of data from a database in?

The number and types of sensors will be different on each piece of equipment, so we don't have a predefined table or report format, we have to create it on the fly.

Thanks in advance for your thoughts.

1. I've done this many times.

2. SQL Express is limited to a 4GB database. With indexes, your data size should fit -but may be close. You will want to index the datetime column -make it the primary key.

3. Transfer files 'should' be easy to use by the recipient. xml is good, csv is good; both are easy to create and transfer. Some folks think that xml is the panacea.

Will you be using Kepware/Linkmaster?

|||

1. Good - you give me hope!

2. Why will I want to index the datetime column? Does it make it faster to search?

3. Wouldn't XML add a lot of overhead to the size of the file?

I never heard of Kepware/Linkmaster, but I'm going to look them up right now.

|||

You indicated that you would be searching for data from a datetime range. Searching a 2GB table will be quite 'slow' without the indexing. However, you will need to examine the trade-offs, less insertion overhead in index maintenance vs. slower query responses. If the queries are a 'rare' occurrance, then you may choose to forgo the indexing and live with slow query responses.

xml does add to file size, but the resulting files can be easily opened in Excel. In your situation, where you are the only recipient of the transfer file, csv may be a good solution. (Even the Fixed field table output may work for you too.)

|||Time to create a table and play around. Thank you for your advice.

Saturday, February 25, 2012

Data/records in other languages

Hi,

Can the English version of Sql Server (or other DBMSs) store data/records in
other languages (e.g. French, Chinese, etc.) or
do you have to use the French version of Sql Server to store French data?

Where can I go to read more on this?

Thanks.
Eric"Eric" <ericd_@.hotmail.com> wrote in message news:<Gpjjb.3561$Z_2.317631@.news20.bellglobal.com>...
> Hi,
> Can the English version of Sql Server (or other DBMSs) store data/records in
> other languages (e.g. French, Chinese, etc.) or
> do you have to use the French version of Sql Server to store French data?
> Where can I go to read more on this?
> Thanks.
> Eric

You can use Unicode data types (nchar, nvarchar, ntext) to store
Unicode data, and it doesn't matter what language your version of
MSSQL is. You can get more information in Books Online in the sections
on "Using Unicode Data" and "Collations".

Simon

Friday, February 24, 2012

data type to store time

Hi all ,

What datatype should I take to store time in a table -- datetime , float or decimal?

my requirement is to store "Worked Hours in a day by an employee" in the field say, 9 hrs and 30 mins.

I should be able to manipulate data in this field such as total hours present in the month, extra hours worked in a day (considering 9 hrs as standard time),less hours worked in a day, and so on

I would suggest the builtin DATETIME datatype. The advantage of this datatype is that it gives you the ability to directly use the builtin functions that come with TSQL.|||

As Kent indicated, using a datetime is most likely the best option. Yes, it will put the default date of Jan 1st, 1900, but you are interested in the hours.

You will be able to use datetime math functions, AND you don't have to remember to convert 20 minutes to .333333 hr, etc.

IF you are not concerned with seconds and milliseconds, you might consider a smalldatetime datatype.

|||Thanks Kent and Arnie for the quick response. I 'm new to this forum and sql server. Hope many more responses from you guys Smile

Data type to store photo

hello,

I want to store the photo in the sql server 2005 , what datatype should I use?

Moving to SQL Forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=158&SiteID=1

Answer: VarBinary(MAX)

|||

Hi Amit,

You can use the datatype to store the images or data in DATABASE but it is not advisable, best practise says that it is better to store only path of the images or documents and let it play with front end application here is a Research paper availble prepared by ussell Sears; Catharine Van Ingen; Jim Gray http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2006-45

HTH

Hemantgiri S. Goswami

|||but wht about replacement or file movement /deletion of the file ...the system /application will crash immediately....

Data type to store photo

hello,

I want to store the photo in the sql server 2005 , what datatype should I use?

Moving to SQL Forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=158&SiteID=1

Answer: VarBinary(MAX)

|||

Hi Amit,

You can use the datatype to store the images or data in DATABASE but it is not advisable, best practise says that it is better to store only path of the images or documents and let it play with front end application here is a Research paper availble prepared by ussell Sears; Catharine Van Ingen; Jim Gray http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2006-45

HTH

Hemantgiri S. Goswami

|||but wht about replacement or file movement /deletion of the file ...the system /application will crash immediately....

Data type to store photo

hello,

I want to store the photo in the sql server 2005 , what datatype should I use?

Moving to SQL Forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=158&SiteID=1

Answer: VarBinary(MAX)

|||

Hi Amit,

You can use the datatype to store the images or data in DATABASE but it is not advisable, best practise says that it is better to store only path of the images or documents and let it play with front end application here is a Research paper availble prepared by ussell Sears; Catharine Van Ingen; Jim Gray http://research.microsoft.com/research/pubs/view.aspx?msr_tr_id=MSR-TR-2006-45

HTH

Hemantgiri S. Goswami

|||but wht about replacement or file movement /deletion of the file ...the system /application will crash immediately....
|||

Hi Amit,

The deletion/file movement can be handle through front end application.

Sunday, February 19, 2012

Data Type for audio?

I wanted to save/store a voice message in SQL Server,
and BLOB is the data type that I'd thought about but
never been used it. Do you have any best practice or
suggestion on this subject?
Thanks.You need an ActiveX to listen to your audio. The datatype to use on SQL is image. And you can use ADO.Stream to read/write the file.|||Thanks rdjabarov,

If using the Image data type, and since each audio message is only between 9k ~ 18K, is using the text in row (ON) will improve the performance, or the text in row (OFF), which saved the audio file outside of SQL Server is
better?

SVT|||You'll benefit from TEXT_IN_ROW only with TEXT data type, when you're storing "clear" text into it. In other words, when you SELECT from a table with this setting on, the optimizer doesn't need to read the pointer value and then go to the BLOB pages to retrieve the actual value of the field. In your case it's a binary file, so you shouldn't bother with this setting.

Friday, February 17, 2012

data type .... Q.....

I want to store amount data in a field. I am getting confused whether to use
Deciaml data type or Currency data type. I am not finding muh advantage in
using currency when compared to decimal data type. Any comments.
GaryDon't post the same question separately to multiple newsgroups. See my
answer in .programming.
SK
Gary Smith wrote:
quote:

>I want to store amount data in a field. I am getting confused whether to us
e
>Deciaml data type or Currency data type. I am not finding muh advantage in
>using currency when compared to decimal data type. Any comments.
>Gary
>
>

data type .... Q.....

I want to store amount data in a field. I am getting confused whether to use
Deciaml data type or Currency data type. I am not finding muh advantage in
using currency when compared to decimal data type. Any comments.
GaryDon't post the same question separately to multiple newsgroups. See my
answer in .programming.
SK
Gary Smith wrote:
>I want to store amount data in a field. I am getting confused whether to use
>Deciaml data type or Currency data type. I am not finding muh advantage in
>using currency when compared to decimal data type. Any comments.
>Gary
>
>

Data type

Hi,
I am trying to find the data types of the fields in my table "XYZ"....Since i have 140 fields in that table, i like to store a value in INT datatype.
Does anyone it on top of their head? Really appreciate the help...

Thanks.

Do you mean a one-time query to take a peek at the data types in your table? Try this:
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'yourTable'
|||Thanks. Really appreciate your help..

Data type

I`m creating a database which will be use to store huge news data. Whatis the perfect data type for the news content, because I`ve tried allthe data types but they can`t store very long news. Thank you very much.
The Text data type will do what you are looking to do.