Skip to main content

Posts

5 Important mySQL Development scripts

During database review most useful object I used information_ schema and show tables. Now I feel ease to work on mysql, either from command line or most popular tool workbench.  Since 2014 mysql added into my skill set and till now 3-4 projects.  Last year I have posted   5-important-shortcut-and-tips-to-work on workbench and today I am sharing  5 more commands what I am using for development and review on mysql database projects. 1.        How to insert or populate data in one table from another table? 2.        How to update one table from another table? 3.        How to create and use temporary table? 4.        How to Check Table Property from command line? 5.        How to check all indexes from one table? How to insert or populate data in one table  from another table? insert into user2  SELECT * FROM setting.user; How to update one table from another table? UPDATE temp p, word pp SET pp.name= p.name, pp.describe = p.describe WHERE pp.id = p.id;

How to export performance metadata and statistics

Performance of query execution (stored Procedure or Ad-hoc query) is depends on Execution Plan and execution plans depend on Statistics-histogram . We already know Query Statistics is metadata of database engine which depend on data. Every insert-update-delete changes its stats. SQL server allowing us to export and copy to another server. So we can use it to sync the performance of server during quality or testing of procedures and queries. Step Connect to Production Server and right click on database. In the list just choose Generate Script. Now click on next and Choose Advance option button. Then select script statistics and then Next and Finish. This will generate Script just copy these script and run on Quality server/Testing Server Database.   Happy Reading...

Csharpcorner Annual Conference 2015

Hi friends, how are you? Hope you are doing well, as always I am cool. It was 2 nd time when I didn’t missed Csharpcorner Annual Conference . Rain could not stop my 3 months waiting, yeah… heavy rain in NCR on 4 th April . Organizer Mind Crackers and  sponsored   Infralogistics , Aspose , MCN Solution and Plural Sight , done well in this year. Microsoft were technical partner of this event. I reached on time with my colleague @ Country Inn Sahibabad, Ghaziabad, UP. The main highlights were the no of attendees it was about 1200 including MVPs, 20 most popular speakers and 28 different sessions on two different tracks (Grand Ball Room for Technology and Majestic for Platform). Sumit jolly started event as host and later Mahesh Chand sir keep the Keynotes in front of us who is the owner-director of CSharpcorner community. The entire community is debtor of him because his effort helping us. He explain what New Technology came in 2014. He addressed the community how he started fro

Join vs Correlated Sub-query

Not always but I observed simple join is much better than Correlated sub-query. So plz avoid to use it, if we have option than .... today i am sharing how a simple join is better than correlated sub query. . correlated sub-query in columns select   candidate_id,last_name,first_name,client_id, (select name from client_master where client_id=candidate_master.client_id) as cl_name  from candidate_master

How to Create Read-Only User in MySQL using workbench

Friends, Till now I haven’t got chance to vote in any election for PM or CM. This month everywhere talking about elections and here I am busy with my work connect-share-discover with database and applications..  Today I want to share How to Create Read-Only User in MySQL using workbench. First Go to Users and Privileges option from Workbench Managements Tab. Click on Add account and give account name and their respective password, after that apply. In Users and Privileges box there are 2 other tabs, Administrative Roles and schema privileges. Administrative Roles is Similar to Fixed Server roles of SQL Server. Schema privileges is schema level authorization process. Select Schema privileges and click on Add Entry. Then a Dialog box will come with schema available in server. Now select any schema which privilege we have to configure. After that give the appropriate rights which we have to give. As I have selected on select. Finally click on Apply.

Dont worry if SSMS not support attaching FILESTREAM enabled databases

SQL Server 2005 introduced the unstructured data types VARCHAR (MAX), NVARCHAR (MAX) and VARBINARY (MAX). And later on File stream features came with 2008. We are using SQL Server version 2012 and unfortunately I would like to say to Microsoft doesn’t given option to attach File-stream Enabled Database from SSMS. Mostly this requires when trying to migrate DB or system or doing some DR activity or maintenance activity. If you will try to attach from SSMS then it may give some errors like below … TITLE: Microsoft SQL Server Management Studio ------------------------------ An error occurred when attaching the database(s).  Click the hyperlink in the Message column for details. ------------------------------ BUTTONS: OK ------------------------------   But don’t worry just try below query to re-attach db.. USE [master] GO CREATE DATABASE <DBNAME> ON ( FILENAME = N'LOCATION\name.mdf' ), ( FILENAME = N'Location\name.ldf&#