Monday, March 26, 2012
How much performance gained by qualifying tables with dbo. in the database?
The great majority of our queries and stored procedures do not
reference the tables with the dbo.table_name format. Due to some
production issues, we're not facing a situation that is forcing us to
redo our database by scripting it out, making a few modificationsm, and
importing the data right back into it. (please don't aske me why!)
I believe now is a perfect opportunity to owner-qualify all references
to the tables with dbo.table_name in the database scripts, and I
strongly believe the performance gain will be significant.
I need to sell this idea to my boss who thinks the risks of
manupulating the production database scripts is far graver than its
benefits, and he wants to now "how much" performance is gained by doing
this.
What do you folks think is a good answer to him? How can I show some
tangible benefits in terms of "gained performance"?
Thanks for you help!Hi Dan
Using the dbo prefix should help cache hits, and the performance gain will
depend on how busy your server is, it could be very little, but then I would
implement it regardless as it is "using best practices". Check out the
current cache misses using SQL profiler. You would also need to add prefixes
for stored procedures, views etc... At the same time you may want to check
the case being consistent.
If you don't use source code control then maybe this is the time start using
it!!
You can gain confidence in the outcome by comparing the two databases.
You should also do a full regression test, and it sounds like your superior
does not have confidence in the outcome of this.
Make sure that you cover all eventualities in the implementation plan and
have backout strategies at each stage. Do some trail runs (on copies of live
data) to get timings and proof that it works.
John
"Dan Gorrison" wrote:
> Hello Folks:
> The great majority of our queries and stored procedures do not
> reference the tables with the dbo.table_name format. Due to some
> production issues, we're not facing a situation that is forcing us to
> redo our database by scripting it out, making a few modificationsm, and
> importing the data right back into it. (please don't aske me why!)
> I believe now is a perfect opportunity to owner-qualify all references
> to the tables with dbo.table_name in the database scripts, and I
> strongly believe the performance gain will be significant.
>
> I need to sell this idea to my boss who thinks the risks of
> manupulating the production database scripts is far graver than its
> benefits, and he wants to now "how much" performance is gained by doing
> this.
>
> What do you folks think is a good answer to him? How can I show some
> tangible benefits in terms of "gained performance"?
>
> Thanks for you help!
>
Friday, February 24, 2012
How i Read the data from MS-Excel and insert into Sql-server table
Hi All,
I have one excel file the format is some thing like this->
These are the column name of the excel file
All the column have Some Numeric value.
And i have Sql-Table Look like this->
In this table we have column "ActualValue" that need to get the value from the Excel sheet
Like-
Avg. Stop Time by Customer AMERICAN WOODMARK CORP-Actual Value
Avg. Stop Time by Customer MASTERBRAND CABINETS--Actual Value
Avg. Stop Time by Customer PANASONIC--Actual Value
Avg. Stop Time by Customer SIEMENS ACUSON--Actual Value
Avg. Stop Time by Customer WHIRLPOOL/QUALITY EXPRESS--Actual Value
But the problem i have is How i read the data from Excel because they not in same column
Example->
Avg. Stop Time by Customer-->>
AMERICAN WOODMARK CORP
Are 2 different column and i want the value of AMERICAN WOODMARK CORP and store in the "Actual Value" column in table.
May you show us SQL SELECT command ?Sunday, February 19, 2012
How format the time
If I enter 02:30 PM I would like to get 02:30 PM.
I have tried various convert functions in Sql, maybe there is a way to format with an ASP.Net datetime function but I need help to get the information back in the right format.
Thx In AdvanceYou would need to format as an nvarchar:
SELECT RIGHT(CONVERT(nvarchar(20),GetDate(),100),7)
This will be close (no space between minutes and AM or PM).
You can format easily in .NET
DateTime.Now.ToString("hh:mm tt")|||That worked!!!
I would also like to know what is going on in this peice of code, at your convenience.
Thank you so much|||In this code:
SELECT RIGHT(CONVERT(nvarchar(20),GetDate(),100),7)
I am CONVERTing the current datetime to an nvarchar() using format 100, which ends with the last 7 characters hh:mmtt
In .NET, the ToString() method is overloaded, and hh gets the hours in 12 hour format, mm gets the minutes, and tt gets the AM or PM.
DateTime.Now.ToString("hh:mm tt")
How format COMPUTE results?
SELECT ARBalance
FROM Invoice
compute SUM(ARBalance)
I have tried inserting variations from below with no luck:
CONVERT(varchar, CAST(SUM(Invoice.ARBalance) AS money), 1)
Thanks!Why don't you apply string formatting at the client/presentation tier? VB
has Format(), VBScript/ASP have FormatNumber() and FormatCurrency(), etc.
A
"Mike Harbinger" <MikeH@.Cybervillage.net> wrote in message
news:eelASapnFHA.3036@.TK2MSFTNGP14.phx.gbl...
> Is it possible to format ARBalance below with commas?
> SELECT ARBalance
> FROM Invoice
> compute SUM(ARBalance)
> I have tried inserting variations from below with no luck:
> CONVERT(varchar, CAST(SUM(Invoice.ARBalance) AS money), 1)
> Thanks!
>|||Hi
Formatting is really a function of the client, for instance if you are using
Query Analyser the "Use regional settings when displaying currency, number,
dates and times" check box on the connection tab does this.
John
"Mike Harbinger" wrote:
> Is it possible to format ARBalance below with commas?
> SELECT ARBalance
> FROM Invoice
> compute SUM(ARBalance)
> I have tried inserting variations from below with no luck:
> CONVERT(varchar, CAST(SUM(Invoice.ARBalance) AS money), 1)
> Thanks!
>
>|||Noye that COMPUTE is a deprecate feature. Use CUBE, ROLLUP or make the SUM
part of your query.
David Portas
SQL Server MVP
--|||Now how did I miss that! Thanks to all
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:03BC582C-EEA5-4AD2-BC33-B1CE1ED1A5AD@.microsoft.com...
> Hi
> Formatting is really a function of the client, for instance if you are
> using
> Query Analyser the "Use regional settings when displaying currency,
> number,
> dates and times" check box on the connection tab does this.
> John
> "Mike Harbinger" wrote:
>