How can I capture SQL Query that is hitting my SQL database? - visual-studio-2012

I've recently lost all files on a web project that contained over 200 reports written in Visual Studio. The internal web server is still running the reports that were published but I cannot make any changes now that the project files are gone. In an effort to save time and not have to rewrite all of the queries I'd like to know if there is a way to capture the queries as they hit my database.
Thanks in advance.

If you have Sql Server Management Studio, then you can simply go to Tools --> Sql Server Profiler. Connect to your Database Instance, and it will begin showing you all the activity between your DB and anything that is interacting with it.
https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
Hope this helps.

Related

Changing the Power query SQL Server database settings when moving an Excel workbook

I'm working on creating an excel report that collects data from a local copy of a SQL Server database on my maschine, where I use Power Query to retrieve the data. These are then loaded into a PowerPivot data model. Now I'm finished with the development and on my way to put this into production on another server on the customer's server. The Excel workbook must change database settings using sql server database user Connection (not integrated). I had hoped that I could change the database Connection Properties at the Data tab, but there are not any easy way to change the connection string to the new server. Now I can't see any option that going through every Power Query query and change them manually. I have great hope that you Power Query experts have a Nice explaination and an example how I can solve this.
Hope to hear from you soon
Regards Geir F
There isn't a great solution for bulk server rename today, but we're very aware of the customer demand! (I can't promise anything about upcoming features, but at some point in the past I heard the dev team discuss this feature.) I'd recommend showing your support for this feature at https://excel.uservoice.com/
If you need to solve this soon, manually opening each query and editting the server string is what you need to do, sorry :\
(If you're building new reports again, Power BI Desktop lets you parameterize the server name to a top-level query, which would allow for quick rename operations!)
Do you only need to change the server name? If you go to the Data Source Settings window, you can select the SQL Server source you are using and click on the "Change Source..." button. If you change the server name in that dialog, it will change the server name in all of the queries that use that source (assuming it's the first step in the query).

SharePoint 2010 Remove server from a Farm by force?

I am trying to remove on of the servers on My farms but I ma not able to do it ,please check this Image :
When I Click on "remove Server" I get this error :
An object in the SharePoint administrative framework, "SPDatabaseServiceInstance", could not be deleted because other objects depend on it. Update all of these dependents to point to null or different objects and retry this operation
Or at less is there a way to know what are the dependents on that server ?
thanks and best regards.
If it is possible, I would connect to the database server to remove and using Management Studio I would check if there is some sharepoint databases running.
Then you can move existing databases to another sql server.
This post helped me a lot to do it :
http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=255
(it is for sharepoint 2007 but process is the same)

how to update an existing Visual Studio 2012 SQL Server Database project from a database?

I'm trying to use VS 2012 SQL Server Database project for versioning control of our database schema. However, our database schema is being updated by another team/tool, instead of through the Database project. Whenever it's updated, I have to manually update the Database project files - very tedious and error-pron. I'm wondering if there is a way to auto refresh all the schema changes from the updated database (just like the EF UI design tool which has a 'Update model from database' menu)?
Thanks!!
You can try using Schema Compare to compare & update the schema changes. Learn more:
http://msdn.microsoft.com/en-us/library/dd193250(v=vs.100).aspx
With the disclaimer that it's still a 'beta' feature (for now), you can now use SQL Source Control to link your database with a database project. This integrates into SQL Server Management Studio. This means that you will get little blue indicators overlaid on the Object Explorer each time a change gets made to the database that isn't synced to your project. It doesn't matter where the change gets made, be it in SSMS or otherwise.
There's a 28-day trial, so we'd encourage you to try it and let us (Red Gate) know if you come across any issues.

Is it impossible to view and edit T-Sql statements from within Visual Studio 2012?

I am thinking of migrating our database from SQL Server to SQL Azure, but I am a little concerned about the problems with the tooling I've been having.
Specifically, I haven't been able to "design" a T-SQL query directly from VS while working with local Sql Server 2012 Express database. For instance, previously in VS2012 I could go to "Show table data", then display the SQL used to generate the data and then add "order by" clause. But now in VS2012 I don't see a way to show t-sql statements (unless I want to write them from scratch, which I don't).
Thanks for clearing this confusion up for me. Also, can anybody point me to some online documentation describing these changes? I was looking for it but couldn't find anything :-(
Thanks a lot!
Jan

How do I know which database is configured SharePoint?

I'm in a machine that has already SharePoint installed, so when I started the SharePoint Central Administration to config, this message appear to me: "Can not connect to the database configuration."
How do I know which database is configured SharePoint?
Normally the Admin database is created using the naming convention SharePoint_AdminContent_{GUID}. However if there's more than one, you'll need to use SQL Management studo or other tool to look inside the DBs, look for a table called "DatabaseInformation" which will contain two items, look in the AlternateAccessMappingXML entry and look for the XML tage IncomingUrl, that should help you narrow it down.
Or just use the SQL profiler and watch for connections.
By default SharePoint will install the Database on the same machine as the web server, but you can ask whoever installed SharePoint on the machine.
Anyhow, most likely it's not relevant and something else is the problem, follow the resolution methods described here and you'll probably have it fixed.

Resources