Showing posts with label functions. Show all posts
Showing posts with label functions. Show all posts

Monday, March 19, 2012

How can you get the current database name via T-SQL?

I have stored some commonly used sprocs and user-defined functions I have created in a separate db.

Some of these functions work with the current db sysobjects table, for instance, and need to "know" the database that I am calling the sproc/function from.

Is there anyway to return the current database name via T-SQL to assign to a local variable which I can then include in the procedure/function execute statement?

Bill

Use the system function: db_name().

SELECT db_name()

|||

Code Snippet

select db_name()

|||

Thanks so much. I knew is was probably simple, just couldn;t find it in the T-SQL help.

Monday, March 12, 2012

How can we check the language by which functions, stored-procedures, and triggers are written in

Hi, all here,

Could please any experts here give me any guidance in what way can we check in what language (T-SQL or CLR language?) the user defined database engine objects :functions, stored-procedures and triggers are written?

Thanks a lot in advance for any guidance and advices for that.

With best regards,

Yours sincerely,

Sys.objects provides that information

Have a look at this page in BOL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/f8d6163a-2474-410c-a794-997639f31b3b.htm

|||

Hi, Simon,

Thanks a lot.

With best regards,

Yours sincerely

How can we check the language by which functions, stored-procedures, and triggers are writte

Hi, all here,

Could please any experts here give me any guidance in what way can we check in what language (T-SQL or CLR language?) the user defined database engine objects :functions, stored-procedures and triggers are written?

Thanks a lot in advance for any guidance and advices for that.

With best regards,

Yours sincerely,

Sys.objects provides that information

Have a look at this page in BOL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/f8d6163a-2474-410c-a794-997639f31b3b.htm

|||

Hi, Simon,

Thanks a lot.

With best regards,

Yours sincerely

Friday, February 24, 2012

How can I use MDX functions in SQL Query Analyzer (Client Tool)

I'm very new to using MS-SQL stuffs and the IT dept here doesn't have any
DBMA to speak of. Thus, I'm a bit on my own - except for you helpful
people...
I just installed the Client Tools on my workstation and tried a simple query:
SELECT IIf(TBL.fld is NULL, "-N/A-", TBL.fld) FROM TBL;
and get the following error message:
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'is'.
According to the help files, this should work, but clearly not. Is there
something(s) I need to enable, install, configure, tweek, activate, cajole,
or otherwise beg into acquiesence?
See reply in microsoft.public.sqlserver.setup
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"slintz" <slintz@.discussions.microsoft.com> wrote in message
news:A2D102C1-1023-413A-94D3-B82440DB08EC@.microsoft.com...
> I'm very new to using MS-SQL stuffs and the IT dept here doesn't have any
> DBMA to speak of. Thus, I'm a bit on my own - except for you helpful
> people...
> I just installed the Client Tools on my workstation and tried a simple
> query:
> SELECT IIf(TBL.fld is NULL, "-N/A-", TBL.fld) FROM TBL;
> and get the following error message:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'is'.
>
> According to the help files, this should work, but clearly not. Is there
> something(s) I need to enable, install, configure, tweek, activate,
> cajole,
> or otherwise beg into acquiesence?
>

Sunday, February 19, 2012

How can i test my SPs and Functions

Hi,
I want to Know How can i test my SPs and functions for load and
performance. Is there any third party Tools available for this .
Thanking you
Aneesh
could look at OStress as per below
http://support.microsoft.com/default...b;en-us;887057
I've also used SQLLS that used to be in the Back Office 4.5 / SQL 7 Resource
Kit to good effect
cheers,
Andy.
"AR" <aneesh.r@.eostek.com> wrote in message
news:eote$Oc3EHA.536@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I want to Know How can i test my SPs and functions for load and
> performance. Is there any third party Tools available for this .
> Thanking you
> Aneesh
>