Friday, March 23, 2012
getdate() in UDF
I am getting an error message about invalid use of getdate() function.
Is there a way to use functions in UDF functions?http://www.aspfaq.com/2439
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Mark Goldin" <mgoldin@.ufandd.com> wrote in message
news:%23vVy542PFHA.2468@.tk2msftngp13.phx.gbl...
>I am trying to use getdate() function inside of my UDF function.
> I am getting an error message about invalid use of getdate() function.
> Is there a way to use functions in UDF functions?
>
Monday, March 19, 2012
get unspecified error when browsing data of CUBE in Analysis servise

I am getting this message when I am browsing data of cude
"Unable to browse data of <cude name>
unspecified error"
please tell me the solution of this.
You're going to have to be a little more specific here. What tools are you using? What version of SQL Server? What cube? What's working / not working?|||Sir,
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
What service pack have you installed? If you look at the Microsoft knowledgebase you will see that there are several problems which caused this. Typically it is fixed once you install SP4.
_-_-_ Dave
|||hey asif, m also getting the same problem, did u find any solution. I have installed SP4get unspecified error when browsing data of CUBE in Analysis servise

I am getting this message when I am browsing data of cude
"Unable to browse data of <cude name>
unspecified error"
please tell me the solution of this.You're going to have to be a little more specific here. What tools are you using? What version of SQL Server? What cube? What's working / not working?|||Sir,
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
What service pack have you installed? If you look at the Microsoft knowledgebase you will see that there are several problems which caused this. Typically it is fixed once you install SP4.
_-_-_ Dave
|||hey asif, m also getting the same problem, did u find any solution. I have installed SP4get unspecified error when browsing data of CUBE

I am getting this message when I am browsing data of cude
"Unable to browse data of <cude name>
unspecified error"
please tell me the solution of this.You're going to have to be a little more specific here. What tools are you using? What version of SQL Server? What cube? What's working / not working?|||Sir,
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
What service pack have you installed? If you look at the Microsoft knowledgebase you will see that there are several problems which caused this. Typically it is fixed once you install SP4.
_-_-_ Dave
|||hey asif, m also getting the same problem, did u find any solution. I have installed SP4get unspecified error when browsing data of CUBE

I am getting this message when I am browsing data of cude
"Unable to browse data of <cude name>
unspecified error"
please tell me the solution of this.You're going to have to be a little more specific here. What tools are you using? What version of SQL Server? What cube? What's working / not working?|||Sir,
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
I have SQL Server 2000 installed on Windows 2000 Advance Server. On same machine I installed MS Analysis servise. By default Analysis service have FoodMart2000 database which have some cubes and dimension. When I right click on cube and browse the data, it open the data browsing window and following message display
"Unspecified error unable to browes the data"
So please solve my problem and what can i do|||
What service pack have you installed? If you look at the Microsoft knowledgebase you will see that there are several problems which caused this. Typically it is fixed once you install SP4.
_-_-_ Dave
|||hey asif, m also getting the same problem, did u find any solution. I have installed SP4Friday, March 9, 2012
get the error message in scheduled task
Is there a way to get the error message in a scheduled task?
I've a backup scheduled with two steps. The first step is the backup
procedure and the second step is a t-sql code which fires an email to
the backup operator.
How can i set the error in the email message if the schedule fails?
ThnxJust a quick thought. If you have both the backup and the emailing code in
the same step, may be you could capture the @.@.ERROR variable after the
backup completes/fails. If @.@.ERROR is not 0, then you know you have an
error.
The way I deal with this is, using Microsoft Operations Manager. You can get
this to email you when a job fails.
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Jason" <jasonlewis@.hotrmail.com> wrote in message
news:uSlWOlbkFHA.3316@.TK2MSFTNGP14.phx.gbl...
Hello,
Is there a way to get the error message in a scheduled task?
I've a backup scheduled with two steps. The first step is the backup
procedure and the second step is a t-sql code which fires an email to
the backup operator.
How can i set the error in the email message if the schedule fails?
Thnx|||I find it easiest to define an output file for the first job step and includ
e that output file in
the emailing step.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Jason" <jasonlewis@.hotrmail.com> wrote in message news:uSlWOlbkFHA.3316@.TK2MSFTNGP14.phx.g
bl...
> Hello,
> Is there a way to get the error message in a scheduled task?
> I've a backup scheduled with two steps. The first step is the backup proce
dure and the second step
> is a t-sql code which fires an email to the backup operator.
> How can i set the error in the email message if the schedule fails?
> Thnx
Wednesday, March 7, 2012
Get Sql Err Message 15422 when activating application role.
Running VB 2005 Express Edition and Sql Server 2005 Express Edition (SQLX).
Developing a desktop application which calls a local instance of ".\sqlexpress".
This app needs to set data base options and add/del various table columns.
When activating the application role, I get the following message:
HariCari SQL Error/s 15422 - Application roles can only be activated at the ad hoc level.
Anyone know what this message means?
I have searched SQL Server Books On-Line and been unable to find a list of Sql err numbers. Either I have missed the obvious or Books On-Line has missed the obvious.
Thanks
Gary
You cannot call sp_setapprole or sp_unsetapprole within another stored procedure. These procedures must be called directly (that's what the message means by ad hoc level).
Here's the sp_setapprole topic:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_sa-sz_6tt1.asp
It mentions in the remarks section that: "The sp_setapprole stored procedure can be executed only by direct Transact-SQL statements; it cannot be executed within another stored procedure or from within a user-defined transaction."
Thanks
Laurentiu
Obviously, I will not continue going down a path which is not intended to work. You have save me time and agravitation.
Again, Thanks!!!
Gary|||Hi,
I have being trying to setup application roles in my application. I have been reading a couple of threads (the one with Ian), and am still a bit lost.
When you say that application roles must be called directly, how do you get the 3rd party application to to call this SP via ODBC and if you have to manualy type in the SP with the password, doesn't that allow the user (inputer) access to the database.
Please help.|||
You must make the calls directly from your application code, not by embedding them in a stored procedure and calling the stored procedure from the application code. Your application should issue the setapprole request directly, not call a procedure that calls sp_setapprole.
Thanks
Laurentiu
sqlrc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, parmlen[0], 0, app, parmlen[0], &cb[0]);
sqlrc = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, parmlen[1], 0, pw, parmlen[1], &cb[1]);
strcpy(buff, "{call sp_setapprole (?,?)}");
sqlrc = SQLExecDirect(hstmt, buff, SQL_NTS);
I have examined the stored proc code and have noticed that it signals this error when the nest level is greater than 1. Is there some code in ODBC that creates a SP on the fly and then calls the SQLExecDirect ?
Many thanks.|||
I am not sure what you are asking for. For ODBC questions, you may want to post on the SQL Server Data Access forum.
If you want to find out how to set an application role withing your application, here is a simple C# example that does that. It assumes you have created the application role in a database named test with the following commands:
create database test
use test
create application role approle with password = 'Password)^'
In the following function, you should replace the YOURSERVERNAME string with the name of your SQL Server instance:
static void sql_test()
{
SqlConnection sqlConn = null;
String strConn = "Persist Security Info=false;";
strConn += "Server=\'" + "YOURSERVERNAME"
+ "\';Integrated Security=true;";
try
{
sqlConn = new SqlConnection(strConn);
sqlConn.Open();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
sqlConn.ChangeDatabase("test");
SqlCommand sqlCmd = new SqlCommand("select user_name()", sqlConn);
try
{
Console.WriteLine(sqlCmd.ExecuteScalar());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
sqlCmd = new SqlCommand("sp_setapprole 'approle', 'Password)^'", sqlConn);
try
{
sqlCmd.ExecuteNonQuery();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
sqlCmd = new SqlCommand("select user_name()", sqlConn);
try
{
Console.WriteLine(sqlCmd.ExecuteScalar());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
}
This should print your original context and then the context of approle, showing that approle was set.
Thanks
Laurentiu
Get Sql Err Message 15422 when activating application role.
Running VB 2005 Express Edition and Sql Server 2005 Express Edition (SQLX).
Developing a desktop application which calls a local instance of ".\sqlexpress".
This app needs to set data base options and add/del various table columns.
When activating the application role, I get the following message:
HariCari SQL Error/s 15422 - Application roles can only be activated at the ad hoc level.
Anyone know what this message means?
I have searched SQL Server Books On-Line and been unable to find a list of Sql err numbers. Either I have missed the obvious or Books On-Line has missed the obvious.
Thanks
Gary
You cannot call sp_setapprole or sp_unsetapprole within another stored procedure. These procedures must be called directly (that's what the message means by ad hoc level).
Here's the sp_setapprole topic:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_sa-sz_6tt1.asp
It mentions in the remarks section that: "The sp_setapprole stored procedure can be executed only by direct Transact-SQL statements; it cannot be executed within another stored procedure or from within a user-defined transaction."
Thanks
Laurentiu
Obviously, I will not continue going down a path which is not intended to work. You have save me time and agravitation.
Again, Thanks!!!
Gary|||Hi,
I have being trying to setup application roles in my application. I have been reading a couple of threads (the one with Ian), and am still a bit lost.
When you say that application roles must be called directly, how do you get the 3rd party application to to call this SP via ODBC and if you have to manualy type in the SP with the password, doesn't that allow the user (inputer) access to the database.
Please help.|||
You must make the calls directly from your application code, not by embedding them in a stored procedure and calling the stored procedure from the application code. Your application should issue the setapprole request directly, not call a procedure that calls sp_setapprole.
Thanks
Laurentiu
sqlrc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, parmlen[0], 0, app, parmlen[0], &cb[0]);
sqlrc = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, parmlen[1], 0, pw, parmlen[1], &cb[1]);
strcpy(buff, "{call sp_setapprole (?,?)}");
sqlrc = SQLExecDirect(hstmt, buff, SQL_NTS);
I have examined the stored proc code and have noticed that it signals this error when the nest level is greater than 1. Is there some code in ODBC that creates a SP on the fly and then calls the SQLExecDirect ?
Many thanks.|||
I am not sure what you are asking for. For ODBC questions, you may want to post on the SQL Server Data Access forum.
If you want to find out how to set an application role withing your application, here is a simple C# example that does that. It assumes you have created the application role in a database named test with the following commands:
create database test
use test
create application role approle with password = 'Password)^'
In the following function, you should replace the YOURSERVERNAME string with the name of your SQL Server instance:
static void sql_test()
{
SqlConnection sqlConn = null;
String strConn = "Persist Security Info=false;";
strConn += "Server=\'" + "YOURSERVERNAME"
+ "\';Integrated Security=true;";
try
{
sqlConn = new SqlConnection(strConn);
sqlConn.Open();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
sqlConn.ChangeDatabase("test");
SqlCommand sqlCmd = new SqlCommand("select user_name()", sqlConn);
try
{
Console.WriteLine(sqlCmd.ExecuteScalar());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
sqlCmd = new SqlCommand("sp_setapprole 'approle', 'Password)^'", sqlConn);
try
{
sqlCmd.ExecuteNonQuery();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
sqlCmd = new SqlCommand("select user_name()", sqlConn);
try
{
Console.WriteLine(sqlCmd.ExecuteScalar());
}
catch (Exception e)
{
Console.WriteLine(e.Message);
return;
}
}
This should print your original context and then the context of approle, showing that approle was set.
Thanks
Laurentiu
Sunday, February 26, 2012
Get return value from stored procedure and trigger
Hello there,
I searched for answers to the above topic, but could not find what I want. My stored procedures and triggers are returning a message based on the result, mostly error messages. How can I get that message using ASP.Net? Should I use an output parameter?
Thank you for your help.
Use this type dataset generator it will do it for you. you select which sp to use with a gui and paf you get a nice typed dataset class.
Enjoy I love it greatly
SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET...
www.codeproject.com/cs/database/dbhelper.asp
Joel,
Thank you for the reply and a looking great tool. I will try it. I am not sure thought if it will answer, but trust you.
Another way I just found is that using Exception class in an event in .Net. For example, if you delete a row in a gridview and trigger is fired for some reason and raises an error, it is passed to theGridViewDeletedEventArgs.So you can that message withGridViewDeletedEventArgs.Exception.Message. You can do it GridView1_RowDeleted() event.
I hope this helps someone like me.
Sunday, February 19, 2012
Get message : The query cannot be excuted because some files are missing...
I can't work with my sql server 2000,
When I try to open a table I get the message:
"The query cannot be executed because some files are missing or not registered.
run setup again to make sure the required files are registered.
I uninstall and install again (few time)
But all the time i get this message.
Does any one know who to fix it??
Thanks
Efrat"Efrat" <shachare@.bgumail.bgu.ac.il> wrote in message
news:bcb64ccd.0405110145.62ff7855@.posting.google.c om...
> Hi
> I can't work with my sql server 2000,
> When I try to open a table I get the message:
> "The query cannot be executed because some files are missing or not
registered.
> run setup again to make sure the required files are registered.
> I uninstall and install again (few time)
> But all the time i get this message.
> Does any one know who to fix it??
> Thanks
> Efrat
Perhaps this applies?
http://support.microsoft.com/defaul...kb;en-us;315868
Simon