Showing posts with label procedures. Show all posts
Showing posts with label procedures. Show all posts

Monday, March 26, 2012

problem with aspnet_ "Could not find stored procedure"


I have developed an asp.net 2.0 web application that uses sql2000 and with storded procedures.
Everything has been working great untill i yesterday found that someone have put in new stored procedures
in the database. The procedures starts with "dbo.aspnet_" like dbo.aspnet_CheckSchemaVersion.
Because i din't create them and i surtenly not call them from the application, i deleted them all.

Now when i try to use my web application nothing works. The app, somehow calls the procedure and becuase they are deleted
an error message is thrown like: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

But the strange thing is that the problem only accure when i publish the site on the web server.
if i would publish it to a local folder on my desktop ore just run in debug mode against the database there are no problems.

I don't want to use the aspnet procedures that probebly comes from aspnet_regsql.exe and that im not calling from the code but reacts somehow,
I just want it to tun as it was designed to do.
And if i need them, can someone explain why?

please help :)

Dude, the "aspnet_" stuff is from Microsoft... it's the Membership provider. To get it back run "aspnet_regsql' in c:\windows\microsoft.net\framework\v2.blah (or wherever your windows files are).

|||

Yo Dude :) I did what you said and of course it worked. But i don't know why aspnet_regsql.exe is suddenly needed and all of those procedures that comes along. It worked without it before.

thx :)

sql

Tuesday, March 20, 2012

Problem while using stored procedures with temporary tables in dataset

I am trying to generate a report using SQL Server Reporting Service. The dataset is passed the results from a stored procedure. The stored proc contains a temporary table. On exceuting of proc, it fetches the result but when I try to save dataset I get following error message

Invalid object name '#AdditionalParams'. (.Net SqlClient Data Provider)

And no colums are returned in the data set created.

Any help on this would be appreciated.

Thanks in advance

If possible, try using a table variable instead, or create a physical table first.

http://www.odetocode.com/Articles/365.aspx

Here are some workarounds for temp tables.

http://www.sql-server-performance.com/rd_temp_tables.asp

If you have to, try using set fmtonly off in stored procedure.

http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/

cheers,

Andrew

|||

I exceuted the proc as stored procedure. And latter I added a new field to same dataset, as it didnt had any field because it had thrown error. I refreshed the datset and I got all the dataset fields although initally it showed error and it worked.

But their is essentially problem the way datset are handled in reporting service.

Thanks

Problem while using stored procedures with temporary tables in dataset

I am trying to generate a report using SQL Server Reporting Service. The dataset is passed the results from a stored procedure. The stored proc contains a temporary table. On exceuting of proc, it fetches the result but when I try to save dataset I get following error message

Invalid object name '#AdditionalParams'. (.Net SqlClient Data Provider)

And no colums are returned in the data set created.

Any help on this would be appreciated.

Thanks in advance

If possible, try using a table variable instead, or create a physical table first.

http://www.odetocode.com/Articles/365.aspx

Here are some workarounds for temp tables.

http://www.sql-server-performance.com/rd_temp_tables.asp

If you have to, try using set fmtonly off in stored procedure.

http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/

cheers,

Andrew

|||

I exceuted the proc as stored procedure. And latter I added a new field to same dataset, as it didnt had any field because it had thrown error. I refreshed the datset and I got all the dataset fields although initally it showed error and it worked.

But their is essentially problem the way datset are handled in reporting service.

Thanks

Problem while taking script

Hi all,
I have some stored procedures in my database.
When I take script of a stored procedure using Enterprise manager from a
client system, the alignment of IF, ELSE, END,etc... are changed. They are
not in a format that I typed in query analyzer.
When I take the same script from another client system they are in proper
alignment.
Please guide me to avoid this.
Should I change any of the settings?
Thanks,
SouraHi
You may want to check what service pack has been applied to the client i.e.
check the file version of (say) one of the exes ? Try scripting from the
Object Browser in Query Analyser.
John
"SouRa" wrote:
> Hi all,
> I have some stored procedures in my database.
> When I take script of a stored procedure using Enterprise manager from a
> client system, the alignment of IF, ELSE, END,etc... are changed. They are
> not in a format that I typed in query analyzer.
> When I take the same script from another client system they are in proper
> alignment.
> Please guide me to avoid this.
> Should I change any of the settings?
> Thanks,
> Soura

Problem while taking script

Hi all,
I have some stored procedures in my database.
When I take script of a stored procedure using Enterprise manager from a
client system, the alignment of IF, ELSE, END,etc... are changed. They are
not in a format that I typed in query analyzer.
When I take the same script from another client system they are in proper
alignment.
Please guide me to avoid this.
Should I change any of the settings?
Thanks,
SouraHi
You may want to check what service pack has been applied to the client i.e.
check the file version of (say) one of the exes ? Try scripting from the
Object Browser in Query Analyser.
John
"SouRa" wrote:

> Hi all,
> I have some stored procedures in my database.
> When I take script of a stored procedure using Enterprise manager from a
> client system, the alignment of IF, ELSE, END,etc... are changed. They ar
e
> not in a format that I typed in query analyzer.
> When I take the same script from another client system they are in proper
> alignment.
> Please guide me to avoid this.
> Should I change any of the settings?
> Thanks,
> Soura

Monday, March 12, 2012

Problem while accessing sysprocesses table

Hi all,
I am facing one wired problem with sysprocesses table of system table.
What i am doing is executing some stored procedures though code written
in dot net.
What i want is to check those stored procedure's id in sysprocesses
table and then update status in one user defined table.
So when user started say 4 stored procedure. and when i check
sysprocesses table even if my 4 stored procedures are running those are
not getting displayed in sysprocesses table.
I am checking each processid and all my stored proceudures are heavy
running means there is no possibility that they will complete execution
within say 1 to 2 min.
So my question is why sysprocess table is not giving me information
about those procedures which i am running.
Can some one shed some light on it.
Any help will be truely appreciated.
Thanks in advance.try
sp_who2
and see if there are processes running from the machine which has the dotnet
code running.|||As you mentioned you execute the sp though code written in dot net, it
won't show directly in the sysprocesses table as a sp in the cmd field.
If you execute the sp in QA, you will then see it clearly.
Alternatively, run the profiler to capture the action.
Mel

Saturday, February 25, 2012

Problem Using Stored Procedures in Report Datasets

I have a local Reporting Services report that I am modifying to use a stored procedure.

Although I am executing a stored procedure in the dataset query window, I also have to run a SELECT statement to retrieve the fields from a table that will populate the report.

The code that I have in the dataset query window looks like the following:

EXECUTE @.retCode = RunClaimVerification @.parmID, @.parmDate, @.parmRecordID OUTPUT

SELECT *

FROM ClaimsDetail

WHERE ClaimRecordID = @.parmRecordID

When I execute this code, the only results that are returned SEEM TO BE the return code associated with running the stored procedure.

I thought about putting the SELECT code in the stored procedure and returning a table or a cursor from the stored procedure BUT it looks like tables are not supported as Report Parameter data types.

The stored procedure code generates Claim data that is stored in a SQL Table. The fields in this SQL table need to be retrieved by a unique record id to populate the fields in the report.

Does anybody have any suggestions as to how to go about doing this OR any suggestions that would help me resolve this problem?


Reporting Services only allows one result (table or the return value of a stored procedure) to be retrieved per query. This is the reason that only the return code seems to be included in the dataset. Also, out parameters for stored procedures are not supported in Reporting Services.

Try changing the stored procedure to also Select the data from the ClaimsDetail table, and return the resultant table instead of the return code. However, don't set the return value to a parameter--just execute the stored procedure. This should produce a dataset containing the results of the Select statement.

Ian