SQL and databases

Conditions IF ELSE in Transact SQL

In this post I will write about SQL conditions. It seems to me that construction “IF … ELSE” you can find in any language. Transact SQL is not exclusion. Let’s see IF … ELSE in action on the sample below. Read more»

SQL and databases

Convert datetime columns in Transact SQL

There are two functions for converting SQL data types from one to another. They are CAST and CONVERT. The second function is the best solution for converting datetime to format you need. Read more»

SQL and databases

Microsoft SQL Server. Copy table from one database to another

There are several ways to make a copy of database table in MS SQL Server. I write down some ways to make a copy of table. Which way to choose is your choice according to table structure, indexes and your wish to make something manually. Read more»

SQL and databases

MSSQL: WHERE LIKE equivalent for DateTime

I don’t often use SQL queries but sometimes I have to. And every time it’s the same – I use search engines to find documentation, especially about work with datetime fields. During these readings I found out at least 3 ways to select records with date I need. Read more»

SQL and databases

Allow execution of Stored Procedures in MS SQL server

It’s good to be dbowner in MS SQL server, but it’s easy to forget about permissions for other users. I created a procedure and tried to execute it from technical account. And I’ve got the error that user can not execute procedures. Read more»

SQL and databases

MS SQL. Add autoincrement field

Field with autoincrement is very useful thing and it’s often used in MySQL. In MSSQL you can also need to use this tool. There are two ways to do it. Read more»

SQL and databases

SQL error “SSIS Error Code DTS_E_PRODUCTLEVELTOLOW” fix

On test environment I have executed an SQL Server Integration Services Package and I’va got the error: SSIS Error Code DTS_E_PRODUCTLEVELTOLOW. The component “Lookup My Cities” (64) cannot run on installed (64-bit) of Integration Services. It requires Standard Edition (64-bit) or higher. End Error As it turned out, service SQL Server Integration Services wasn’t installed […] Read more»

SQL and databases

How to Shrink Your MS SQL Database Log File

Transaction Log is a weak place in SQL server for HDD, especially if it’s a test area and you don’t make every day back up of your databases. While creating back up transaction logs are shrinking. Read more»

SQL and databases

Real-time statistics of SharePoint sites via SQL-request

There’s a table in SharePoint content database where all the events are written in case if audit is turned on. But SharePoint doesn’t display real-time statistic about users on site, it gives you statistic only on the next day. Read more»

SQL and databases

SELECT from table WHERE items IN (@variable)

You need to make query like “SELECT * from tbl WHERE items IN (‘item1’, ‘item2’, ‘item3’, ‘item4’)” and you want to send items to IN clause as variable. It’s nice when, for example, you want to execute Stored procedure or, as in example below, use INSERT … SELECT construction. Then you need to make a […] Read more»

SQL and databases

Popular Posts