Archive for the ‘SQL’ Category

Problems with mssql_connect() on IIS

Lately I’ve been reinstalling my Windows servers a couple of time due to some problems. I’m running both PHP (WordPress) and ASP.NET on my server. From my WordPress blog I sometimes connect to MS SQL to get some data and this time i could not get the MSSQL extension in PHP to work. I got [...]

Return random rows from a MS SQL database

I always forget this command: SELECT * FROM YourTable TABLESAMPLE SYSTEM (10 PERCENT) This gives you some sample data from your database. In this case 10 percent of the content.  You could also use TABLESAMPLE SYSTEM (1000 ROWS) to get 1000 sample rows. Great to use if you have a big database and do not [...]

SQL Server: Saving changes is not permitted because table will be re-created

Microsoft has added a setting to Management Studio to prevent us from re-create tables when we make changes to them. I don’t like this settings and it would have be much better if they said ‘This table will be re-created, are you sure you want to do that?” instead of just stop us from doing [...]

ASP.NET membership: System.Web.Security. SqlRoleProvider problems

I had this really weird problem just now. I have done some work with the ASP.NET Membership provider and everything has been working great. But when i tried to deploy my application to the server i got this: The ‘System.Web.Security.SqlRoleProvider’ requires a database schema compatible with schema version ’1′. However, the current database schema is [...]