SQL Server Cannot Connect to WMI Provider, No Permission
We have SQL Server Management Studio 2012 Express works well, but when we tried to launch SQL Server Configuration Manager, we got the following error message:
How to Change Multiple Data Table Names in SQL Server
In our one case we have multiple data tables with names includes spaces, we need to cut off all spaces.
Copy Data Tables From Another Database Using SQL Server Management Studio
Sometimes we need to copy data tables from another database in SQL Server. There are multiple ways to do it. Here we show the steps using SQL Server Management Studio.
Install PostgreSQL on Windows
PostgreSQL is an open source database platform which support multiple platforms: Linux, BSD, Mac, Windows.. etc.
When SQL Server Express is Oversized
We record for our internal issue about the Free SQL Server oversized, to backup our operations for checking in the future.
Limitations of SQL Server 2012 Express
Some software providers want to use free SQL Server Express as one part of their software product and then deploy to their customers. Personally I don’t think it is a good idea, but actually they can do like that. But we must acknowledge some limitations when using SQL Server Express as product.
SqlCmd vs oSql vs iSql
SqlCmd, oSql and iSql actually looked like the same product.
Update Local SQL Server ‘ServerName’ after Changed Computer Name
If you changed your computer name with a SQL Server installed (my version is SQL Server 2012 Express), you will find your installed SQL Server did not change its Servername to new host computer name, which will causes some issues if you have stuff using Windows Authentication access.
Check SQL Server Database Size
There are 2 ways to check SQL Server database size:
Microsoft’s SQL Server Connection Strings samples
Here is Microsoft’s SQL Server Connection Strings samples.
Install SQL Server Management Studio Express 2012
After we have installed LocalDB or SQL Server Express, we still feel we need SQL Server Management Studio Express to manage the local database system, it is more convenient than using a command line.
Install SQL Server 2012 Express LocalDB ?
First let us know: If you have installed Visual Studio 2012 or 2013, normally you do NOT have to install SQL Server Express LocalDB separately because “In Visual Studio 2013 (and in 2012), LocalDB is installed by default with Visual Studio.” (from here)
SQL Server 2008 R2 Remote Connection
We had a post about Remote Connection for SQL Server 2008 R2 Express, but this time we work on a SQL Server 2008 R2 version, which is not an free express version.
SQL Server Install Locations
When we install SQL Server database such as SQL Server 2008 R2, maybe we want the data to be stored on another driver other than C: driver;
SQL Server Compact Supported Collations
Sometimes we have to search what Collation is supported by SQL Server, for example, if we know our computer system is English Windows edition , and English Visual Studio, so what the collation exactly is supported by default when you directly add a SQL Server file such as a SQL Server Compact 4.0 file ?
Linq To Objects vs Linq To Entities vs Entity Framework
There are some articles in the internet confused the concepts among Linq to Objects, Linq to Entities and even ADO.NET Entity Framework, they often mentioned Linq To Objects and Linq to Entity or Entity Framwork are the same ting. But they ARE NOT the same.
Select Last N Rows In A SQL Server Data Table
How to select last 5 or 10 or … rows in a SQL Server data table ?
Update a Table using the Data from Another Table
There are lots of ways to update a table data, here we have one example as the following:
Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand
There was a coder wrote the following code about a SQL Server saving operation:
Develop App Based On MySQL Using C#
Most of .net developers develop Windows applications using SQL Server database, but how about some cases that use MySQL?
Unable to find the requested .Net Framework Data Provider. It may not be installed.
We have a small MVC project, once a time we got the following error message in a popup window:
Update data with If exists in SQL Server Stored Procedure
There is a table structure here:
Grant Permissions on Stored Procedure
After you finished your Stored Procedures, you have to know you should grant permissions to database users, otherwise, when you deploy your application, you might find your stored procedures can not work due to permissions issues.
Select Data By Page in SQL Server 2008 Side
When we have huge data and we need to display data in client side page by page, the best way might be paging data in SQL Server side, otherwise the huge data retrieving will be ‘dead’ in your client side.
Install SQL Server 2008 Management Studio Express
For Microsoft languages developer, SQL Server 2005 / 2008 Management Studio Express is a required database management tool.
SQL Server DateTime to String
We have already posted SQL DateTime Operations. Here we need another sample which is about how we should compare a SQL Server DateTime and a C# DateTime String:
Stored Procedures Permissions Management
Simply writing stored procedures isn't enough to adequately secure your application. You should also consider the following potential security holes.
SQL DateTime Operations
SQL DateTime Operations:
CREATE VIEW must be the only statement in a batch?
In SQL Server, when you try to input a “Create View” sentence in a Stored Procedure. you might get the following error:
Show enum descript in sql SELECT sentense
We have a sql select as the following:
Clear ID counter after delete data table
If you have auto increase ID column in your SQL Server table, and if you want to clear the automatically counter:
Can not add a Non-Nullable field in your data table?
Maybe you got error when you try to update your database SQL Server such as add a Non-Nullable field.
SQL Server Restricted User ?
Sometimes you might find your SQL Server database is in “Restricted User” mode: like following:
How to import SQL Server 2005 Tables into Microsoft Visio 2007 (2) ?
We have already discussed "How to import SQL Server 2005 Tables into Microsoft Visio 2007 (1) ?", Now we continue the part 2:
Here are some code to resolve:
Keeping Identity Values When Importing Data in SQL Server 2005
If you have data tables which are set identity columns, you have to carefully when you migrate your database, or import / outport data. The point is: How to Keeping Identity Values When Importing Data in SQL Server 2005 ?
Primary Key vs Uniqueindentifier vs Unique Key in SQL Server
- Primary key – Only one Identity column – Can't be null
Invalid operator for data type. Operator equals add, type equals bit
When I wrote a sql server stored procedure, got a error message about bit data type when I tried to run this script:
nchar vs nvarchar (Transact SQL)
Both of nchar and nvarchar are character data types that are either fixed-length, nchar, or variable-length, nvarchar, Unicode data and use the UNICODE UCS-2 character set.
Set Port and Firewall to enable remote connect to SQL Server 2005 or 2008 Express Database
After 2 articles Remote connect to SQL Server 2005 Express or SQL Server 2005 and Change SQL Server or SQL Server Express Authentication Mode, the SQL Server remote connection still have more stuff to talk about.
Remote connect to SQL Server 2005 Express or SQL Server 2005
Microsoft SQL Server 2005 or Microsoft SQL Server 2005 Express do not allow remote access by default. If you want to remote connect or use another computer in your LAN, you have to configure on your SQL Server 2005 or SQL Server 2005 Express.