SQL server -T-SQL questions and examples.
Lessons once learned and now recorded.
This article shows how to use string parameters to make selection on Boolean fields. What is it you need to select “true”, “false” of “ALL” records. How WHERE statement will look like in that case? […]
ASP.NET page returns this erorr: The EXECUTE permission was denied on the object ‘aspnet_CheckSchemaVersion’, database ‘YourDB’, schema ‘dbo’. (1) First try runing this command/wizard: %WinDir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe (2) If this doesn’t work, try this query: — Add user ASPNET to DB role USE YourDB GO sp_addrolemember ‘aspnet_Membership_FullAccess’, ‘ASPNET’ These steps should resolve […]
You are trying to access your ASP.NET page and getting this message: Cannot open database “YourDB” requested by the login. The login failed. Login failed for user ‘YourPC\ASPNET’. Use SQL Manager, navigate to Security ==> Logins. Double click on ASPNET user and go to User Mapping. Select YourDB and […]
This article contains 3 examples: – T-SQL; – MS Access; – AS/400. This example shows a standard T-SQL syntax tested on MS SQL 2005 server: update P set P.CertMemberLevelID = Z.CertLevelTo from UPM_MemberPermissionMask P INNER JOIN zzzCertRegistryUpdate Z ON P.MemberID = Z. Cert2ID Here we are updating one […]
It is meaningless to compare for equality (==) two fields of type SmallDateTime, because they contain time component and they are hardly ever the same. Here are some interesting ways around this problem to check, if two SmallDateTime fields have the same date component.
It was time to move many sites from W2K3 Server (Windows 2003 Server) and SQL 2000 Server to a new W2K8 Server (Windows 2008 Server) and SQL 2008 Server. And if I ever have to do it again, I will check with these notes. The greatest secret in technical life […]
You have a large table (in my case it has 8,697,647 records) with an Asset Number and a Business Unit, and you would like to know if any asset has record with multiple Business Units. You can count records of unique Asset/BU combinations, but this is not what you want: […]
You have 180 days to evaluate. You can check number of days till expiration: open your SQL Server Management Studio and widen first line in Help — About box. What if your trial is about to expire, and you need just a few more days to evaluate? You can switch […]
What is Wrong with Home Server? After a RAID drive hiccup on my local Windows 2008 Server, I was more inclined to consider an external hosting options. And one of my friends already uses Amazon hosting for at least 4 years now. So I decided to invest some time to […]