
|
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
|
|
|
|

|
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.
|
|
|
|

|
And then they're converted to string, which is worse.
|
|
|
|

|
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.
|
|
|
|