Skip to main content

Posts

Copy databases using SQL Server SMO

The following steps are required to perform the Copying a Database using SQL Server objects exposed to the .Net Framework by Microsoft. Net 1. Add reference to the project with the following DLL files, Microsoft.SqlServer.ConnectionInfo.dll Microsoft.SqlServer.Smo.dll Microsoft.SqlServer.SmoExtended.dll Microsoft.SqlServer.Management.Sdk.Sfc.dll These dlls are found in the following folder C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies 2. Define a source Db and then the target DB, the source db will be scanned and then its contents [structure & data] string sourceDB = "cs_notification_test"; string targetDB = "cs_notification_test1"; SqlConnectionStringBuilder connStringBuilder = new SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings["ApplicationConnectionString"].ConnectionString); ServerConnection conn = new ServerConnection(connStringBuilder.DataSource, connStringBuilder.UserID, connStr

Celebrating 25 years of Web

Though this post has crossed the exact mark of the 25th Anniversary of Web evolution. I take this opportunity to thank every one who worked for weaving this beautiful web that links us today, esp. Tim Berners Lee. Thanks for weaving this web so gregariously and I am also proud to be on a node exploring its untamed beauty.

Software As A Service (SaaS)

A Short Note on SaaS [Software As A Service]. IMHO, I am building upon a short post on SAAS, this is not exhaustive, but I encourage the readers to share their valuable comments to improve this post. SaaS is an abbreviation of Software As A Service.AKA Software on Demand, where the vendors develop, host and operate on the software and make it available on the internet for its consumers / customers. SaaS is the most mature category of cloud service, since it evolved from the application-service-provider model of software hosting. With SaaS, software applications are rented from a provider as opposed to purchased for enterprise installation and deployment. SaaS is the most mature category of cloud service, since it evolved from the application-service-provider model of software hosting. With SaaS, software applications are rented from a provider as opposed to purchased for enterprise installation and deployment. Users Can range from small group to multitude SaaS Considerat

Enabling The SQL Server To Be Accessed Across Machines Or From Remote Machine

Following steps are to be followed so that the SQL Server can be accessed across machines or be accessed from a remote machine via Sql Server Management Studio [SSMS] Enable the following 1) TCP/IP, 2) Shared Memory 3) Named Pipes from all programs> sql 2012 > configuration tools > sql server configuration manager > expand sql server network configuration > protocols for sql2012r2de Now, in the “Run” command, put Services.msc and then choose the SQL Server and then enable the SQL Server Browser service Now try connecting from any remote machine. Trackback:  http://stackoverflow.com/questions/5956926/unable-to-connect-to-a-sql-server-database-remotely

SQL Update From One Table To Another Based On A Id Match

I have an employees table and an EmployeeTerritories table. The employeeid in both these tables are in integer datatype.   I have to create a new unique identifier column in both these tables and then update them accordingly. 1. I created a newsequentialid column in the employees table that will create new ids for the employees 2. Next, i added a new column to the employee territories table and set it as a foreign key to the employees table 3. now, i am in need of a query that will fetch the new guid from the employee table and fill in the employee territories table 4. i need to have a single update statement that do the trick by making use of the existing numerical id values UPDATE EmployeeTerritories SET empid = Id FROM EmployeeTerritories INNER JOIN Employees ON Employees.EmployeeID = EmployeeTerritories.EmployeeID This update statement will update the empid in the territories table based on the id matching. This saves a lot of time in comparison to the manual match