How to quickly generate SELECT statement with all columns for a table in DataGrip?

In DataGrip, as in other IntelliJ-based IDEs, everything is about source editing. What you want can be achieved this way: Open console Start typing sel, you’ll get completion popup (if not, hit Ctrl+Space) Choose sel here, which is live template for SELECT statement SELECT statement will be generated, asking for table name and column list … Read more

Better way for Getting Total Count along with Paging in SQL Server 2012

If we’re allowed to change the contract, you can have: SELECT CSTNO, CSTABBR,COUNT(*) OVER () as TotalCount FROM DBATABC WHERE CSTABBR LIKE ‘A%’ ORDER BY CSTNO OFFSET ( @OffSetRowNo-1 ) * @FetchRowNo ROWS FETCH NEXT @FetchRowNo ROWS ONLY And now the total will be available as a separate column in the result set. Unfortunately, there’s … Read more

Table Value optional parameter

Table-Valued parameters always have an implicit value of an empty table. So you can actually call that procedure without any parameters and it would execute but the table would be empty. So it doesn’t really make sense to label a table-value parameter with a default value. Remove the “=null”, check the table contents, and you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)