Tool bars and Stored Procedures - Service Reporting (SQL) - sql

I have two small problems with Reports, I am using SQL Server and SSRS.
I am deploying reports through VS Shell (Report Sever Project).
I make a report, do settings, all things ok.
When I click Preview(VS Shell), the tool bar looks like:
But when I access the report in browser(IE), it looks like:
Do you know how I can resolve it?
The second problem is about stored procedures. When I open the SSMS (Sql Sever Management Studio) -> Programability -> Stored Procedures, I see all stored procedures.
The problem is when I try to use a stored procedure in VS Shell , I don't see them.
Do you have any idea why?

Question
I am not sure but i think this is a IE problem - tried any other browser?
Question
I often used stored procedures as source for reports, but NEVER used Query tpye "Stored Procedure" - didn't work for me. So what you can do is to Change the query type to "Text " and execute your stored procedure here. e.g.
exec dbo.my_stored_proc

Related

Editing Stored Procedures in MSSQL Server 2008

I imported a database for MSSQL 2008 for development. I know they have stored procedures because I was able to edit them live with the web interface front that they have.
Now that I have the database loaded in a development location how do I access them? Are they normally stored in a table? I see at least one table with stored procedures. Is there a way to edit them with a built in text editor?
EDIT: I do have SQL Management Studio installed, just not sure how exactly to access/edit the procedures.
Normally you would use SSMS - SQL Server Management Studio to do this. Its usually included with SQL Server, so you may just need to install it.
http://msdn.microsoft.com/en-us/library/ms174173.aspx
or download it here:
http://www.microsoft.com/en-us/download/details.aspx?id=7593
Got it!
So different from working with MySQL.
In Object Explorer, connect to an instance of Database Engine and
then expand that instance.
Expand Databases, expand the database in which the stored procedure
belongs, and then expand Programmability.
Expand Stored Procedures, right-click the procedure to modify, and
then click Modify.
Modify the text of the stored procedure.
To test the syntax, on the Query menu, click Parse.
To modify the stored procedure, on the Query menu, click Execute.
To save the script, on the File menu, click Save As. Accept the file
name or replace it with a new name, and then click Save.
try like this:
If You Installed SQL SERVER Management Studio then Type ssms in RUN
Select Installed SQL SERVER Instance and Log in
Then Type Below command, it gives you Text of stored procedure
sp_helptext 'Procedure_name'

When creating database model edmx files, Visual Studio 2k10 doesn't list all stored procedures

I'm having a really hard time with Visual Studio 2010. I have a SQL database I am programming against with Entity Framework. Most of the SQL code is simply executing stored procedures, which Entity Framework excels at.
However, I'm having a problem. When I click Update Model From Database, the Update Wizard intermittently fails to list all the stored procedures in the database. I've created a stored procedure called sp_foo. Sometimes, the Update Wizard will display and allow me to select it. Sometimes, it behaves as if sp_foo does not exists. I have absolutely no idea what is causing this. I can always execute sq_foo in SQL Server Management Studio.
What could be going wrong?
Check your permissions on the database to see EF can see all stored procs.
I had a similar problem that I fixed that way.
You might have to run something like this.
If Exists (SELECT name FROM sys.database_principals WHERE name = 'UserName' ) GRANT EXECUTE ON [dbo].storedProcName TO [YourUserName]

Execute sql commands in Visual Studio server explorer?

How can I execute SQL commands in Visual Studio Server Explorer?
When I right click a sql directory (like tables), I get the options:
Add new table
Compare data
Execute query
But I want to do none of these, what I want is an empty screen where I can type my command, and execute it.
I don't want to use "Execute query" for writing commands, because it's for writing "queries", not all commands.
Alright, this is a pretty retarded solution to this problem but I guess it's good enough for me. I downloaded SQL Managment Studio, and installed it. It comes with a handy "Ssms.exe" that's hidden somewhere in program files with which you can manage your db.
From SQL Server point of view; a "command" and a query is the same thing. It is evaluated by the same code in the server.
A "command" is a SQL server DDL (Data Definition Language). A query is a SQL server DML (Data Manipulation Language). In a SQL server command batch use can issue both DDL and DML.
The "New Query" button which will give you the behavior you are expecting is available by adding the menu through View > Toolbars > Transact-SQL Editor

Visual Studio DB project fails to detect changes to stored procedure parameters. Is that normal?

Whilst working on a SQL Server 2008 database project in Visual Studio 2010 I added a new parameter to an existing stored procedure definition. When I built the project it failed to detect that references to the sproc elsewhere in the project did not have enough parameters. It even let me deploy the project.
Is this the way it's meant to behave or have I forgotten to tick a box somewhere?!
Sam : )
Database projects do not detect problems with procedure/function parameters. Also, you will notice you can delete the offending procedure/function from your project all together and it won't fail.
In my case, I use an external tool for managing programmability, so not failing the build because of missing procs is a plus.
If you want to validate your procedures and functions you can write a scipt that will execute all your stored procedures with using "SET FMTONLY ON". The procedure will be compiled, but no permanent changes will be made to the DB during execution. You can't use this with procedures that use temporary tables (#table syntax).
That's how Microsoft does it in Visual Studio to determine what the output of your stored procedure should be.
Unless you re-run the code generation wizard (by deleting the sproc in the VS Server Explorer then dragging it back in) your project doesn't know that the database has changed. You may get runtime errors but not compile errors.
If it doesn't know about any changes it will compile normally. So yes, it's supposed to behave that way.

Creating multiple stored procedures from SQL executed by powershell issue

Ok, so I've got a bit of a SQL and Powershell problem. There are 2 SQL scripts, one to setup 4 different global stored procedures. Another to execute them and manipulate data before returning it to PS to be placed in a CSV file. The reason I'm not putting them into a single file is for readability. The procs are enclosing huge chunks of sql and I cannot create permanent procs in our production environment.
The problem I'm running into is the script runs fine in SQL Mgmt Studio but when ran by PS, I get several errors around the 'go's in the script.
I'm pretty sure this is a problem with the format that PS and the .NET classes expect when executing and returning data sets but...I'm at a loss.
I'm running SQL Server 2005 btw.
Any ideas or similar experiences?
What errors do you get? How are you executing each file? GO is a batch separator understood only by certain tools (e.g. Management Studio); PowerShell doesn't know what GO means. Have you tried executing the separate CREATE PROCEDURE scripts without issuing a GO command between them? If they are separate commands this shouldn't be an issue.
"GO" is a delimiter used by SQL Management Studio. It is not a valid SQL keyword. You can configure SQL Management Studio and change "GO" to "ENGAGE" if you wanted to.
Just remove "GO" from the scripts.