A developer on my current project has used Microsoft.SqlServer.Management.Smo within the code of our development to build tables programmatically.
To me this seems like a bad idea.
Is it?
I thing being or not being a bad idea for that matter depends on the environment under which the application will be run or deployed or what the application is required to do.
SMO makes it easy to perform database administration operations in .NET code. While all of those admin tasks can be performed with T-SQL directly on a database or through the SQL Server Management Studio, being able to use SMO offers broad flexibility to include these types of operations in .NET applications.
In fact, SQL Server Management Studio relies on SMO for most of its management tasks.
I did find an article demonstrating what can be done with SMO here http://msdn.microsoft.com/en-us/magazine/cc163409.aspx
Related
I would like to use MS SQL Management Studio and Reporting Services, but I have a Macbook. Can I run SSMS with SSRS in Azure or AWS?
*Edited to not ask for a recommendation
SSMS(SSRS) only support Windows now.
I think you can think about using Azure Data Studio. Previously released under the preview name SQL Operations Studio, SQL Operations Studio tool can be a good option, it provides enough function like security, linked server and database manager, it is enough to use if you only use it for development.
Hope this helps.
I have on scenario which I have to call a web service from SQL Server. Is there any way to accomplish this task?
As GSerg mentioned in comments, this is something you can do within a SQL CLR procedure. This link will walk you through a proof of concept scenario, but the principles are there.
http://blogs.msdn.com/b/spike/archive/2010/11/25/how-to-consume-a-web-service-from-within-sql-server-using-sql-clr.aspx
Depending on what you need to do with it, you can also build an SSIS package. It has an out-of-the-box task for web services.
https://msdn.microsoft.com/en-us/library/ms140114.aspx
I would use SQL Server Data Tools for Business Inteligence (SQL2012+) or Business Inteligence Development Studio (SQL2008[R2]) to create an Integration Services project including Web Service Task:
Does anyone have a good method for doing source control against SQL Queries. I am not concerned with the database itself but rather just the SQL queries.
Currently I store them in a folder on my local machine and intend to just point GITHUB at that folder. However, it would be ideal if there is a solution that integrates into SQL Server Management Studio.
The one that I use is RedGate's Source Control, this product integrates directly in to SQL Server Management Studio. Unfortunately, this is not a free product.
Another option with a trial version (55 days)
Agent SVN - SCC Subversion Plug-in
I've ran into problem very similar to this. I have a .dbproj Visual Studio database project. It deploys just fine in SQL Server Express. Now I want to deploy it to SQL Azure - I change the connection parameters but deployment fails with the following text:
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets(120,5): Error Deploy01234: The target database schema provider could not be determined. Deployment cannot continue.
Done executing task "SqlDeployTask" -- FAILED.
Is deploying .dbproj projects to SQL Azure supported? How do I make Visual Studio deploy the database into SQL Azure? What are other ways to achieve more or less the same results except recreating the database manually using Azure portal?
If you are using Visual Studio 2012, you can now create a Database project and go to Properties - set its Target Platform to SQL Azure in Project Settings tab. Also you can configure the setting for dacpac output. Use this file to import directly as a new SQL Azure database.
As far as I know, Database projects are still not supported by Windows Azure. You can deploy the project to a local SQL server and then use the "Generate Scripts" feature to port the database to SQL Azure. See this link.
An easy solution is to create the database locally and use the SQL Azure Migration Wizard to do the migration up to SQL Azure. It works very well in just a few clicks (and will fix common errors).
Database projects don't work with SQL Azure. What I do is before deploying, create a brand new database on local server (to ensure it is up to date with no dev scripts), and then sync that database to Azure with RedGate SQL Compare. I do a backup first with RedGate SQL Azure Backup.
When we first built DB projects, SQLAzure was still going through its identity crisis and didn't know what it wanted to be. ;)
DBProjects support a significant superset of capabilities vs. SQLAzure. Therefore, it's quite possible that it'll create scripts that won't run against SQLAzure.
I know that the team who took-over the DBProject tooling were looking at restricting the database project generators to output SQLAzure-compatible scripts, but I don't know how far they got or whether they decided to proceed.
I echo dunnry's suggestion above and use the SQL Azure Migration Wizard or Jeremy's and use SQL 2008 R2 and generate Azure-compatible scripts.
I've been trying to work out whether it's possible to manage (i.e. add tables, modify them, create stored procedures) a SQL Azure database using some kind of GUI like SSMS and I keep coming up against different answers.
I found a post from the end of 2009 saying that it would be supported in SSMS but I'm not sure if that includes the Express version? Does anybody know what the most recent update of the express version is and whether it supports it?
I think I'm right in saying that it can't be done in Visual Web Developer 2010 (and I can't afford the full fat VS2010).
I'm prepared to consider alternatives though if anybody knows any full features GUI tools that work with SQL azure and I don't mind paying for a commercial license if it's not too expensive.
Thanks.
Yes, SQL Server 2008 R2's Management Studio does support working with SQL Azure databases.
See:
Getting Started with SQL Azure Development
There are a couple of options
1) You can use SSMS (get the free version by downloading SQL Express v2008 or greater) with advanced services. This will give you SSMS. You can then connect to SQL Azure using SSMS. However - there is a limited set of functionality available via this tool.
2) You can use SSDT (stand-alone for free) or from within VS2010 SP1 or greater. Again, you can connect to SQL Azure, but there are some restrictions on what you can do.
I am using the SQL Express on AWS RDS (free usage tier) myself lately (and connecting via SSMS or SSDT). I prefer their implementation of SQL Server in the cloud to Microsoft's implementation of SQL Azure.