I am using Crystal Reports in my application. Now, I have created an SQL view in my SQL Server database. Can I use this view as data source for Crystal Reports?
I know that we can use a stored procedure as data source for Crystal Reports, but I don't know that we can use a view as data source for the same.
Can any one give me some more ideas regarding the same?
In SQL Server Manager:
Ensure that the grants are set correctly (perhaps SELECT to PUBLIC)
In Crystal Reports:
Select Database | Database Expert...
Expand the desired database node
Expand the 'View' node
Select desired view
You may link views to other views and also to tables.
Related
I am creating a small tool to update database table. So i want to add columns to table using embedded database (using alias path- without running Nxserver) database. I did it successfully but table can't be opened from Enterprise manager.
It says "incompatible stream". I can load table to a dbgrid using embedded database.
it might be a version issue between embedded database and server. But how can i do this for any version?
Restructure upgrades a table file to the table version of the server engine that performed the restructure. In this case the server engine that's embedded in your application.
If this table version is newer than the table version supported by the nxServer or EM (if using the internal server) you are later using to try and access this table, then you may get this error.
If you are going to access the table through a specific nxServer later, you should be using that server to perform the restructure, not the embedded engine in your program.
I connect to Sybase IQ database via PhpStorm. End I have a tables explorer at database tool window.
What I need is to make tables names display like schema_name.table_name, not just the table name. Seems like I can achieve it in database driver settings, but don't know what should I do exactly. There is a setting in database connection window where I can choose such setting in AquaData studio.
AFAIK it's not possible to have schema_name.table_name -- only db_name.schema_name.table_name.
For this just enable "Flatten Schemas" option (under "cog" icon or via right click on tool window title/label).
P.S.
Cannot say anything about database driver settings for Sybase.
Usually connect to an external database but I wanted to fiddle with creating a project with a local database. I am using SQLServer Express Local Database, not CE.
I can add tables with EF but if I right click on Tables in Server Explorer the only options I have are Refresh and Properties, i.e. no Add Table menu option. Similarly, if I right click on one of the tables EF has created I also get only the Refresh and Properties menu options so I can't add rows, etc. Same problem with stored procedures; I can't add any (should I want to do some testing with EF and stored procedures) because I only have the Refresh and Properties menu options.
FOLLOW UP:
I have isolated this problem to VS2012 Professional. When I use VS2010 it works exactly as expected: I can add tables and stored procedures. Following the same steps with VS2012 results in the situation where there is no menu option to add either tables or stored procedures. I produced these test results with SQLServer 2012 LocalDB.
If you only see Refresh and Properties when you right click on Tables in Server Explorer, you probably need to install SQL Server Data Tools from http://msdn.microsoft.com/en-us/data/hh297027 .
I had a similar problem only with Visual Studio 2012 Express for Web following along with the "Getting started with ASP.Net MVC3" at www.asp.net. The tutorial used a Sql Server Compact edition but I have SQL Express 2012 so I changed the connection string to have the data source point at my local instance, .\SQLExpress2012. The app worked fine and was able to read and write to the database. However I could not edit the database in the Visual Studio Express Database Explorer (all the context menu options were missing except "refresh" and "properties).
I found that changing the data source in the connection string to "Data Source=(LocalDB)\v11.0;" fixed the problem. I read somewhere that if you use LocalDb instead of the SQL Server instance name then it will be accessed under your user account - must have been some kind of permissions issue.
The whole (working) connnection string is:
"Data Source=(LocalDB)\v11.0;AttachDBFilename=|DataDirectory|Movies.mdf;Integrated Security=True;"
Hope this saves someone a bunch of hours pulling their hair out, I'm almost bald now :)
I found that when installing Visual Studio 2013, I had not requested the 'SQL Server Data Tools' feature.
By re-running the installer from 'Control Panel' > 'Programs and Features', using the 'Modify' option, I could add the missing feature. On completion, the 'Add New Table' menu item was available.
The only way I can determine in VS 2012 to open an existing stored procedure for modification and save changes is the following:
1) Manually remove the initial word CREATE and retype ALTER in its place (every time).
2) From the "SQL" menu, then its "Transact-SQL Editor" submenu, choose Execute.
Given that VS2012 is in Release Candidate, I'm certain there will be no fundamental changes along these lines.
And, I understand that from a purist point of view that this is executing a query to change the procedure on the server. But from a usability point of view is there no longer a near-equivalent to a simple Save button on a toolbar? Over the course of day this is a not-inconsequential waste of time and mental focus. I could live with Ctrl+Shift+E but manually editing CREATE to ALTER every time is ridiculous.
I take it that you're trying to apply changes to a stored procedure to your database?
You can try the following:
Go to View SQL Server Object Explorer. Right click on the SQL Server node and add your server. Open the database and identify the procedure you need to edit. Double click on the procedure, which opens the CREATE script for the object. Leave the CREATE there and simply modify this and click the 'Update' button. Then select Generate Script or Update database depending on whether you want to apply the changes immediately or generate the script to a query window and apply the script yourself.
If you want to generate an ALTER, you can use the Server Explorer (as distinct from the SQL Server Object Explorer, which is also in the View menu). Add your database to Data Connections. Find your procedure, right click and select Open.
I'm fairly certain you can add the procedure to source control, make changes, check in, and publish to your DB. I've never done it, but its talked about in this video:
SSDT talk at TechEd 2012
I do not have admin panel on my website (I find it overkill) and use default local MS Studio Server Explorer to admin my website's database. I use Views and it works great for my purposes. But now I need parametrized View and I created Stored Procedure. But I didn't find a way how to display result set of SP as View does it. It sends data to Output window instead of Server Explorer's grid view. Any ideas?
you can run the stored proc using "EXEC", this will put the results in a grid at the bottom of the screen. i.e.
exec mySp 'Param'