Migrate SQLite to MySQL

I’m developing a huge app made with Xamarin Forms in my company. A problem was to create all tables in the device with SQLite to the main database MySql. I found a way to create all tables quickly with a tool called SQLite to MySQL. SQLite-to-MySQL is a powerful and reliable tool to convert SQLite databases to MySQL, MariaDB or Percona format. The program has high performance due to direct connection to source and destination databases (it does not use ODBC or any other middleware software). Command line support allows…

Announcing SQL Server on Linux

It’s been an incredible year for the data business at Microsoft and an incredible year for data across the industry. This Thursday at our Data Driven event in New York, we will kick off a wave of launch activities for SQL Server 2016 with general availability later this year. This is the most significant release of SQL Server that we have ever done, and brings with it some fantastic new capabilities. SQL Server 2016 delivers: Groundbreaking security encryption capabilities that enable data to always be encrypted at rest, in motion…

How to use REPLACE() within NTEXT columns in SQL Server

SQL has an incredibly useful function, REPLACE(), which replaces all occurrences of a specified string with another string, returning a new string. It works great with all forms of NCHAR and NVARCHAR fields. It does not, however, work with NTEXT fields. Fear not — there’s an easy workaround, thanks to type-casting and SQL 2005’s NVARCHAR(max) datatype. Here’s the process in an nutshell. Cast the NTEXT field to the NVARCHAR(max) datatype using the CAST function. Perform your REPLACE on the output of #1. Cast the output of #2 back to NTEXT.…

How can I know when SQL Full Text Index Population is finished?

When you execute some queries on your SQL Server, are you sure the catalog is being imported? With this simple script you can know which is the Index status. DECLARE @CatalogName VARCHAR(MAX) SET @CatalogName = ‘TEST_FullIndex’ SELECT FULLTEXTCATALOGPROPERTY(@CatalogName,’ItemCount’) as NumberOfItems, FULLTEXTCATALOGPROPERTY(@CatalogName,’ImportStatus’) as ImportStatus, DATEADD(ss, FULLTEXTCATALOGPROPERTY(@CatalogName, ‘PopulateCompletionAge’), ‘1/1/1990′) AS LastPopulated, (SELECT CASE FULLTEXTCATALOGPROPERTY(@CatalogName,’PopulateStatus’) WHEN 0 THEN ‘Idle’ WHEN 1 THEN ‘Full Population In Progress’ WHEN 2 THEN ‘Paused’ WHEN 3 THEN ‘Throttled’ WHEN 4 THEN ‘Recovering’ WHEN 5 THEN ‘Shutdown’ WHEN 6 THEN ‘Incremental Population In Progress’ WHEN 7 THEN ‘Building…

How To Enable SQL Full Text Indexing

The following steps will tell you if your database version supports full text searching and if so how to enable it. Open SQL server management console Right click on the database and select properties On the left select files If “Full-Text Indexing” is greyed out it means that full-text indexing is not enabled. NOTE: If you are using SQL Server 2012 Please see the SQL Server 2012 notes at the bottom of this article. How to enable Full Text Searching Click on the New Query button top left of the…

How to remove HTML tags from data with SQL

The purpose of this article is to provide a way of cleaning up of HTML tags within the data. When we use various styles or tabular format data in UI using Rich Text Editor/ Rad Grid etc, it will save data in database with HTML tags. When you save in database this kind of field you have: An HTML element starts with a start tag (<p>) and ends with end tag (<p/>) and everything between Start tag and End tag is HTML element. e.g. <b>Following are the popular databases: <br…

SQL SERVER – Find Current Location of Data and Log File of All the Database

As I am doing lots of experiments on my SQL Server test box, I sometime gets too many files in SQL Server data installation folder – the place where I have all the .mdf and .ldf files are stored. I often go to that folder and clean up all unnecessary files I have left there taking up my hard drive space.  I run following query to find out which .mdf and .ldf files are used and delete all other files. If your SQL Server is up and running OS will…

Print a table structure in SQL Server

I was wondering how it’s possible to get the structure of one or more table(s) in a database, using possibly a SELECT; I need to retrieve the composition of the DB I’m working onto to attach it in some docs about the webapp I’m currently developing. SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.COLUMNS ORDER BY TABLE_NAME

How to truncate log file in SQL Server

In SQL Server data is stored using two physical files: (.mdf) extension which contains the data. (.ldf) extension which contains log. Log file size increases very rapidly and depend on the operation performed on the data. After a long time period this file becomes too large. When log file is too large it takes time to perform some operations like (attach, de-attach, backup, restore… etc ). Step 1. Copy/type the below given SQL. Step 2. Change @DBName to <Database Name>, @DBName_log to <Log File Name> Step 3. Execute the SQL.…

Download ReportViewer 2010, ReportViewer 11 and SQLSysClrTypes

Have you tried to install ReportViewer on a server? If you as me receive a similar error, I have a solution. When you have to install the Report Viewer on a server, it’s quite difficult to find the install file and a reference for Report Viewer 11 (SQL System Clear Tyle). Here you can download the last ReportViewer with its dependencies. SQLSysClrTypes.zip (1.4MB)ReportViewer.zip (6.1MB)ReportViewer2010.zip (4.5MB)

Linqer (SQL to Linq converter)

Linqer is a SQL to LINQ conversion tool. It helps learning LINQ and convert existing SQL statements. Not every SQL statement can be converted to LINQ, but Linqer covers many different types of SQL expressions. Linqer supports both .NET languages – C# and Visual Basic. Because LINQ is a part of the C# and VB languages, it is sensitive to data type conversion. Linqer performs required type castings in the produced LINQ statements. It can convert the most usable SQL Server functions. The full list of supported MSSQL functions can…

From Installation to Advanced Configuration: Setting Up Serilog for C# Success

Logging and road

In the ever-evolving landscape of software development, effective logging is crucial for maintaining robust and reliable applications. Serilog has emerged as a leading tool for C# developers, offering a flexible and powerful logging solution tailored to modern needs. This comprehensive guide will walk you through the installation and advanced configuration of Serilog in your C# projects, ensuring that you harness its full potential. From setting up various sinks for diverse output channels to integrating custom logging classes that capture detailed runtime data, you’ll discover best practices for enhancing application maintainability…