Showing posts with label couple. Show all posts
Showing posts with label couple. 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.

Wednesday, March 28, 2012

Question regarding Object querying

Platform - SQL Svr 2000 SP3a
I have a couple of questions regarding stored procs
1. Is there a way to query on keyword text withiin stored proceduers?
for example, if I wanted to find all stored proc's that contain 'AND
where col_name <> 3' in the statement(s), can I do that? Does Full-text
support only include Table objects?
2.) Do objects (specifically stored procedures) have a modified date
property that can be queried on? If so, how is this done?
Thanks,
-Troy> 1. Is there a way to query on keyword text withiin stored proceduers?
> for example, if I wanted to find all stored proc's that contain 'A
ND
> where col_name <> 3' in the statement(s), can I do that? Does Full-text
> support only include Table objects?
How do I find a stored procedure containing <text>?
http://www.aspfaq.com/show.asp?id=2037

> 2.) Do objects (specifically stored procedures) have a modified date
> property that can be queried on? If so, how is this done?
No. SQL Server does not save this information.
AMB
"Troy Jerkins" wrote:

> Platform - SQL Svr 2000 SP3a
> I have a couple of questions regarding stored procs
> 1. Is there a way to query on keyword text withiin stored proceduers?
> for example, if I wanted to find all stored proc's that contain 'A
ND
> where col_name <> 3' in the statement(s), can I do that? Does Full-text
> support only include Table objects?
> 2.) Do objects (specifically stored procedures) have a modified date
> property that can be queried on? If so, how is this done?
>
> Thanks,
> -Troy
>
>|||Thanks for the link. This very good.
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:D9E8C74E-19CA-4549-905B-F1364E59E726@.microsoft.com...
> How do I find a stored procedure containing <text>?
> http://www.aspfaq.com/show.asp?id=2037
>
> No. SQL Server does not save this information.
>
> AMB
> "Troy Jerkins" wrote:
>