Click here to Skip to main content

The SQL Zone

 

The database server is the big iron in a server environment, and keeping them running smoothly is a full-time job. If you’re looking to improve your skills as a DBA or a database developer, this is the place to start.

The articles gathered in our SQL Server Zone cover everything from basic SQL syntax to advanced tuning techniques for stored procedures.

Alongside white papers and sample code, you can read articles for all levels of proficiency, and get answers for specific questions from the authors themselves. Your ongoing SQL Server learning begins here.

Red Gate Whitepapers


Featured Article

Featured
by psined
Introduction to Boomerang Framework

Articles

New
by Faisal(mfrony)
This Article will help you to manage our CRUD operation more efficient way
New
by dale.newman
Google your SQL.
New
by Randall Smith II
A simple solution trying out the Azure platform for development and deployment.
New
by Shemeer NS
CAST(), CONVERT(), PARSE(), TRY_PARSE(), TRY_CONVERT(), FORMAT(), SQL Server Functions, SQL...
New
by mf81
This will be a lightweight site that helps the user track their weekly comics subscriptions.
New
by Prashant M. Tailor
Using COM components in .NET framework.
New
by Andrew Timberlake-Newell
Demonstrates how to configure a DataGridView control to automatically store edits to bound...
New
by Gary Dryden
Multi-column dropdown combobox - an ASP.NET 2.0 server control.
New
by earmitage
An article on enumerating SQL Server instances in C# using ODBC thus removing any dependancy on...

Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionUsing float and likememberberba2 Jul '12 - 0:54 
Hi,
 
Can the following be used in a stored procedure?
 
convert(float, (columnname))like @x
 
I've tried it. It works.
 
Wanted to know if it's a good way of programming?
 
Cheers
Berba
AnswerRe: Using float and likeprotectorPete O'Hanlon2 Jul '12 - 2:52 
As you will be converting the value of each item in columnname to float, this is a more expensive operation than converting the value in @x into the appropriate type.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos

CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: Using float and likememberPIEBALDconsult2 Jul '12 - 6:59 
And then they're converted to string, which is worse. D'Oh! | :doh:
AnswerRe: Using float and likememberPIEBALDconsult2 Jul '12 - 7:04 
berba wrote:
if it's a good

 
Most likely not; all those conversions will kill you. What are you trying to do? Perhaps you want BETWEEN?
 
As mentioned, converting the parameter value (once) is much better* than converting all the values in the column.
 

* Anecdote: I once inherited maintenance of a batch program that took forty minutes to run; after fixing the conversions it took only ten minutes.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   



Red Gate Resources

Free eBooks

Product Announcements





Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 1 Aug 2007
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid