Showing posts with label ms sql server. Show all posts
Showing posts with label ms sql server. Show all posts

Monday, December 14, 2009

mySQL and msSQL Limit and TOP

SELECT TOP 10 * FROM stuff;

Will return the top ten rows, effectively doing the same thing as

SELET * FROM stuff LIMIT 10;

Friday, November 6, 2009

Creating user in SQL Server

INside Microsoft SQL Server Management after you login via windows authentication, select the security table and insert new user, you also need to assign userrole such as sysadmin to the user.

After that, you need to modify the properties of the connection instance to WINDOWS + SQL Server mode. Either that modify it via the Registry settings.

Creating user in SQL Server

INside Microsoft SQL Server Management after you login via windows authentication, select the security table and insert new user, you also need to assign userrole such as sysadmin to the user.

Sunday, August 16, 2009

Pipe Problems

Gbeacon server has SQL Server Configuration Manager
http://blogs.msdn.com/sql_protocols/archive/2006/03/23/558651.aspx

Monday, May 11, 2009

Could not find stored procedure

When you cannot find the stored procedure and you are sure that the connectionString works and the stored procedure is inside the programmability folder. Example connection String is:
csb.ConnectionString = "Server=SERVER\WHATEVER;Initial Catalog=mw;Database=mw;User ID=aaron;Password=aaron";

Restore failed for Server

When you restore a database from another device and run into an error such as: System.Data.SqlClient.SqlError: File 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\salon.mdf' is claimed by 'salon_1'(1) and 'salon_Data'(2). The WITH MOVE clause can be used to relocate one or more files. (Microsoft.SqlServer.Smo)

You need to look under options and make sure that the SQL server is not trying to output to the same file name. The problem was due to the rows under the column "Restore As" (under options tab) having the same file name. So in other words, simply change the value of the column name for the "Restore As" to unique MDF values, and the restore should be successful.