Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Friday, March 30, 2012

Question relating Conversion and calculations

Hi,

I have couple of DBF files.. and when i get them into my scrub database the datatype for all the fields in char. but after i scrub the data i put them into a money feild.. so that if so that i can do any calculations that i want in the report...

Suppose if i keep as a char or varchar in my production database... is it possible to any calculation on it in my report.. just simple additions... and if yes... do i need to convert them into anything before doing the additions... The reason i am asking this is Some of the fields in the scrub database are empty and i want to keep them the same in my production database instead of showing 0.00 as a default.

Any help will be appreciated.

Regards

Karen

Hi,

From your description, it seems that you want make calculation on fields such as char typed in your database, right?

If so, I think you can achieve it by converting your fields in your stored procedure or select statement.
See the following sample, suppose we have two fields called Sp and Hd, which is nvarchar typed, now we can convert them into money typed and make calculation on them.

selectsum(convert(money,Hd))+sum(convert(money,Sp))As Totalfrom MatrixCapital

Thanks.

Monday, March 26, 2012

Question regarding .LDF and .MDF files and backup

Hello,
I have pretty basic question regarding databases on my MS SQL server.
There are .MDF and .LDF files. From what I can tell (and I may well be VERY
wrong here), the MDF file is the REAL data. The LDF file are changes yet to
be merged into the live data.
1 - What are the LDF files?
2 - Why are they so big? Do they never flush?
3 - When do "transactions" become part of the "data"?
4 - If I want to make a Full backup of a database can I make a full database
backup or do I need to make a logfiles backup also to get a "full backup".
The database is not written so often to so a full backup each night is
enough.
Thanks in advance.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Magnus" <Magnus@.discussions.microsoft.com> wrote in message
news:C5C38AE4-1C1D-4B1F-BEB7-D22565A8FE8E@.microsoft.com...
> Hello,
> I have pretty basic question regarding databases on my MS SQL server.
> There are .MDF and .LDF files. From what I can tell (and I may well be
VERY
> wrong here), the MDF file is the REAL data. The LDF file are changes yet
to
> be merged into the live data.
> 1 - What are the LDF files?
The transaction log.
> 2 - Why are they so big? Do they never flush?
They grow until you either backup the log, or set the database to Simple
recovery mode
> 3 - When do "transactions" become part of the "data"?
Immediately when the transaction commits
> 4 - If I want to make a Full backup of a database can I make a full
database
> backup or do I need to make a logfiles backup also to get a "full backup".
> The database is not written so often to so a full backup each night is
> enough.
Set the database to Simple recovery mode, then backup the entire database
nightly... You will loose any transactions since the last full backup.
>
> Thanks in advance.
|||There is a section in BOL titled "Physical Database Architecture",
explaining the files and their usage. The section title "Backup/Restore
Architecture" will also be useful.
"Magnus" <Magnus@.discussions.microsoft.com> wrote in message
news:C5C38AE4-1C1D-4B1F-BEB7-D22565A8FE8E@.microsoft.com...
> Hello,
> I have pretty basic question regarding databases on my MS SQL server.
> There are .MDF and .LDF files. From what I can tell (and I may well be
VERY
> wrong here), the MDF file is the REAL data. The LDF file are changes yet
to
> be merged into the live data.
> 1 - What are the LDF files?
> 2 - Why are they so big? Do they never flush?
> 3 - When do "transactions" become part of the "data"?
> 4 - If I want to make a Full backup of a database can I make a full
database
> backup or do I need to make a logfiles backup also to get a "full backup".
> The database is not written so often to so a full backup each night is
> enough.
>
> Thanks in advance.
|||Some information scattered in these articles about why log files are
large...
http://www.aspfaq.com/2446
http://www.aspfaq.com/2471
http://www.aspfaq.com/
(Reverse address to reply.)
"Magnus" <Magnus@.discussions.microsoft.com> wrote in message
news:C5C38AE4-1C1D-4B1F-BEB7-D22565A8FE8E@.microsoft.com...
> Hello,
> I have pretty basic question regarding databases on my MS SQL server.
> There are .MDF and .LDF files. From what I can tell (and I may well be
VERY
> wrong here), the MDF file is the REAL data. The LDF file are changes yet
to
> be merged into the live data.
> 1 - What are the LDF files?
> 2 - Why are they so big? Do they never flush?
> 3 - When do "transactions" become part of the "data"?
> 4 - If I want to make a Full backup of a database can I make a full
database
> backup or do I need to make a logfiles backup also to get a "full backup".
> The database is not written so often to so a full backup each night is
> enough.
>
> Thanks in advance.

Question regarding .LDF and .MDF files and backup

Hello,
I have pretty basic question regarding databases on my MS SQL server.
There are .MDF and .LDF files. From what I can tell (and I may well be VERY
wrong here), the MDF file is the REAL data. The LDF file are changes yet to
be merged into the live data.
1 - What are the LDF files?
2 - Why are they so big? Do they never flush?
3 - When do "transactions" become part of the "data"?
4 - If I want to make a Full backup of a database can I make a full database
backup or do I need to make a logfiles backup also to get a "full backup".
The database is not written so often to so a full backup each night is
enough.
Thanks in advance.--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Magnus" <Magnus@.discussions.microsoft.com> wrote in message
news:C5C38AE4-1C1D-4B1F-BEB7-D22565A8FE8E@.microsoft.com...
> Hello,
> I have pretty basic question regarding databases on my MS SQL server.
> There are .MDF and .LDF files. From what I can tell (and I may well be
VERY
> wrong here), the MDF file is the REAL data. The LDF file are changes yet
to
> be merged into the live data.
> 1 - What are the LDF files?
The transaction log.
> 2 - Why are they so big? Do they never flush?
They grow until you either backup the log, or set the database to Simple
recovery mode
> 3 - When do "transactions" become part of the "data"?
Immediately when the transaction commits
> 4 - If I want to make a Full backup of a database can I make a full
database
> backup or do I need to make a logfiles backup also to get a "full backup".
> The database is not written so often to so a full backup each night is
> enough.
Set the database to Simple recovery mode, then backup the entire database
nightly... You will loose any transactions since the last full backup.
>
> Thanks in advance.|||There is a section in BOL titled "Physical Database Architecture",
explaining the files and their usage. The section title "Backup/Restore
Architecture" will also be useful.
"Magnus" <Magnus@.discussions.microsoft.com> wrote in message
news:C5C38AE4-1C1D-4B1F-BEB7-D22565A8FE8E@.microsoft.com...
> Hello,
> I have pretty basic question regarding databases on my MS SQL server.
> There are .MDF and .LDF files. From what I can tell (and I may well be
VERY
> wrong here), the MDF file is the REAL data. The LDF file are changes yet
to
> be merged into the live data.
> 1 - What are the LDF files?
> 2 - Why are they so big? Do they never flush?
> 3 - When do "transactions" become part of the "data"?
> 4 - If I want to make a Full backup of a database can I make a full
database
> backup or do I need to make a logfiles backup also to get a "full backup".
> The database is not written so often to so a full backup each night is
> enough.
>
> Thanks in advance.|||Some information scattered in these articles about why log files are
large...
http://www.aspfaq.com/2446
http://www.aspfaq.com/2471
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Magnus" <Magnus@.discussions.microsoft.com> wrote in message
news:C5C38AE4-1C1D-4B1F-BEB7-D22565A8FE8E@.microsoft.com...
> Hello,
> I have pretty basic question regarding databases on my MS SQL server.
> There are .MDF and .LDF files. From what I can tell (and I may well be
VERY
> wrong here), the MDF file is the REAL data. The LDF file are changes yet
to
> be merged into the live data.
> 1 - What are the LDF files?
> 2 - Why are they so big? Do they never flush?
> 3 - When do "transactions" become part of the "data"?
> 4 - If I want to make a Full backup of a database can I make a full
database
> backup or do I need to make a logfiles backup also to get a "full backup".
> The database is not written so often to so a full backup each night is
> enough.
>
> Thanks in advance.

Friday, March 23, 2012

Question on Tempdb mdf & ldf files

Thanks in advance.
I have heard much about putting tempdb on separate raid 1 spindles but
should I go further and put the tempdb data and tempdb logs on separate
spindles? Will that buy me anything? This will be a very large db server, a
cluster, and will have multiple dbs. I have two large raid 10 arrays for
data and multiple raid 1 arrays for logs and can separate out tempdb further
so the data has its own raid 1 array and the tempdb logs can have its own
raid 1 array as well. This is all on an emc san, cx400.
Thanks,
John
hard to say.
You'll likely have to test this with the SQL IO Stress tool or some other
test tool.
Greg Jackson
PDX, Oregon
|||Hi John,
Take a look at this article.
FIX: Concurrency enhancements for the tempdb database
http://support.microsoft.com/default...b;en-us;328551
The article discusses some of the enhancement made in SP 4 and ways to
enhance tempdb performance.
Yih-Yoon Lee
E-mail: yihyoon@.gmail.com
John - PDX wrote:
> Thanks in advance.
> I have heard much about putting tempdb on separate raid 1 spindles but
> should I go further and put the tempdb data and tempdb logs on separate
> spindles? Will that buy me anything? This will be a very large db server, a
> cluster, and will have multiple dbs. I have two large raid 10 arrays for
> data and multiple raid 1 arrays for logs and can separate out tempdb further
> so the data has its own raid 1 array and the tempdb logs can have its own
> raid 1 array as well. This is all on an emc san, cx400.
|||For a consolidated system, it is a good idea to seperate out at least the
TempDB data file(s). In our installation, we have also seperated out the
log files even though most of the activity resides in the data files.
Also, check out the following KB. You might want to consider planning this
now instead of waiting for it to happen to you.
FIX: Concurrency enhancements for the tempdb database
http://support.microsoft.com/default...b;en-us;328551
This recommendation includes applying a hotfix, setting a trace flag, and
creating multiple fixed sized data files for tempdb.
Sincerely,
Anthony Thomas

"pdxJaxon" <GregoryAJackson@.Hotmail.com> wrote in message
news:%23wCVc%23uaFHA.2536@.TK2MSFTNGP10.phx.gbl...
hard to say.
You'll likely have to test this with the SQL IO Stress tool or some other
test tool.
Greg Jackson
PDX, Oregon
sql

Question on Tempdb mdf & ldf files

Thanks in advance.
I have heard much about putting tempdb on separate raid 1 spindles but
should I go further and put the tempdb data and tempdb logs on separate
spindles? Will that buy me anything? This will be a very large db server, a
cluster, and will have multiple dbs. I have two large raid 10 arrays for
data and multiple raid 1 arrays for logs and can separate out tempdb further
so the data has its own raid 1 array and the tempdb logs can have its own
raid 1 array as well. This is all on an emc san, cx400.
--
Thanks,
Johnhard to say.
You'll likely have to test this with the SQL IO Stress tool or some other
test tool.
Greg Jackson
PDX, Oregon|||Hi John,
Take a look at this article.
FIX: Concurrency enhancements for the tempdb database
http://support.microsoft.com/defaul...kb;en-us;328551
The article discusses some of the enhancement made in SP 4 and ways to
enhance tempdb performance.
Yih-Yoon Lee
E-mail: yihyoon@.gmail.com
John - PDX wrote:
> Thanks in advance.
> I have heard much about putting tempdb on separate raid 1 spindles but
> should I go further and put the tempdb data and tempdb logs on separate
> spindles? Will that buy me anything? This will be a very large db server,
a
> cluster, and will have multiple dbs. I have two large raid 10 arrays for
> data and multiple raid 1 arrays for logs and can separate out tempdb furth
er
> so the data has its own raid 1 array and the tempdb logs can have its own
> raid 1 array as well. This is all on an emc san, cx400.|||For a consolidated system, it is a good idea to seperate out at least the
TempDB data file(s). In our installation, we have also seperated out the
log files even though most of the activity resides in the data files.
Also, check out the following KB. You might want to consider planning this
now instead of waiting for it to happen to you.
FIX: Concurrency enhancements for the tempdb database
http://support.microsoft.com/defaul...kb;en-us;328551
This recommendation includes applying a hotfix, setting a trace flag, and
creating multiple fixed sized data files for tempdb.
Sincerely,
Anthony Thomas
"pdxJaxon" <GregoryAJackson@.Hotmail.com> wrote in message
news:%23wCVc%23uaFHA.2536@.TK2MSFTNGP10.phx.gbl...
hard to say.
You'll likely have to test this with the SQL IO Stress tool or some other
test tool.
Greg Jackson
PDX, Oregon

Question on Tempdb mdf & ldf files

Thanks in advance.
I have heard much about putting tempdb on separate raid 1 spindles but
should I go further and put the tempdb data and tempdb logs on separate
spindles? Will that buy me anything? This will be a very large db server, a
cluster, and will have multiple dbs. I have two large raid 10 arrays for
data and multiple raid 1 arrays for logs and can separate out tempdb further
so the data has its own raid 1 array and the tempdb logs can have its own
raid 1 array as well. This is all on an emc san, cx400.
--
Thanks,
Johnhard to say.
You'll likely have to test this with the SQL IO Stress tool or some other
test tool.
Greg Jackson
PDX, Oregon|||Hi John,
Take a look at this article.
FIX: Concurrency enhancements for the tempdb database
http://support.microsoft.com/default.aspx?scid=kb;en-us;328551
The article discusses some of the enhancement made in SP 4 and ways to
enhance tempdb performance.
Yih-Yoon Lee
E-mail: yihyoon@.gmail.com
John - PDX wrote:
> Thanks in advance.
> I have heard much about putting tempdb on separate raid 1 spindles but
> should I go further and put the tempdb data and tempdb logs on separate
> spindles? Will that buy me anything? This will be a very large db server, a
> cluster, and will have multiple dbs. I have two large raid 10 arrays for
> data and multiple raid 1 arrays for logs and can separate out tempdb further
> so the data has its own raid 1 array and the tempdb logs can have its own
> raid 1 array as well. This is all on an emc san, cx400.|||For a consolidated system, it is a good idea to seperate out at least the
TempDB data file(s). In our installation, we have also seperated out the
log files even though most of the activity resides in the data files.
Also, check out the following KB. You might want to consider planning this
now instead of waiting for it to happen to you.
FIX: Concurrency enhancements for the tempdb database
http://support.microsoft.com/default.aspx?scid=kb;en-us;328551
This recommendation includes applying a hotfix, setting a trace flag, and
creating multiple fixed sized data files for tempdb.
Sincerely,
Anthony Thomas
"pdxJaxon" <GregoryAJackson@.Hotmail.com> wrote in message
news:%23wCVc%23uaFHA.2536@.TK2MSFTNGP10.phx.gbl...
hard to say.
You'll likely have to test this with the SQL IO Stress tool or some other
test tool.
Greg Jackson
PDX, Oregon

Wednesday, March 7, 2012

Question on deploying .SQL files

Hi..

I would not like my customers to have access to any SQL code that is
being packaged with our product and hence would like to encrypt it in
some fashion. What's your recommendation on packaging/deploying .sql
files?

Would appreciate any feedback.

Thanks,
Sandeep Madduri.Sandeep Madduri's group (sandeepmadduri@.gmail.com) writes:

Quote:

Originally Posted by

I would not like my customers to have access to any SQL code that is
being packaged with our product and hence would like to encrypt it in
some fashion. What's your recommendation on packaging/deploying .sql
files?


First of all, keep in mind that while you can create a stored procedure
WITH ENCRYPTION, it is not real encryption, but merely obfustication.
Any users who is dead set will be able to recover the original code.
(Can easily be found on Google.) That is not to say that WITH ENCRYPTION
is useless. It does act like a sign saying "NO TRESPASSING" and will
keep honest people out. But you still need a license agreement.

As for the setup, you could ship the files in some obfusticated
fashion, and then have a program that knows how to "decrypt" the files
and then pass them to SQL Server unecrypted.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx