SQL Server date function with example

I enjoy writing T-SQL scripts, function and stored procedure for business but while working with SQL server date function it gets tricky, just keep it simple. Make sure that date column does not have time included. If it is include remove time from date using convert function. Whenever you insert date in table verify that ...

SQL Server interview questions and answers

SQL server interviews questions and answer, this will help you to prepare for SQL Server interviews. Sharing the frequently asked interview questions related sql server to crack the interviews. How many sql server version do you support ? Answer -> Sql server version like sql server 2008, 2012,2014 and 2016. Latest is SQL Server 2017 ...

SQL Server 2014 download free – Express edition

MS SQL Server 2014 is free downloadable software, available on Microsoft official website. Anyone can download SQL Server 2014 free, this is express edition which is suitable for learning and small scale projects. Microsoft has done major changes in SQL Server database engine and added new features to improve query performance in SQL Server 2014. ...

SQLCMD utility to connect SQL Server using command line

Is it possible to connect SQL server with some other tools ? Answer is yes, SQLCMD is the command line tool used to connect SQL Server. SQLCMD – Simple tool to execute t-sql statment, stored procedures and DML operations. SQLCMD works same as SSMS but without GUI, means you can do all stuff that you ...

SQL Server – How to load flat file into table – Using BULK INSERT

As SQL Server DBA, you gets request to load flat file data in sql server table, here is the small example of loading flat file or comma separated file data into table using BULK INSERT method. How to load flat file into table – Using BULK INSERT To understand this method, first we will create ...

SQL Server – Database Endpoint not working after server restart

Issue : After window server restarted database mirroring is stop working, Mirroring endpoint was broken and getting connection handshake failed. Troubleshooting checklist Checked SQL Server error log on principal server Database Mirroring login attempt failed with error: ‘Connection handshake failed. The certificate used by this endpoint was not found: Certificate expired. Use DBCC CHECKDB in ...

SQL Server – Configure tempdb to improve performance

Sometimes you face problem with tempdb contention due to complex queries and sorting issue, It advisable to optimize your tempdb after SQL server installation. It is also included in post installation and configuration best practice. you should create multiple copy of tempdb data files matching to number of logical processors to reduce tempdb contention problem Tempdb ...

Install Upgrade advisor 2014 – Before database upgrade 1

Database upgrade – Install Upgrade Advisor SQL Server upgrade Advisor tool helps you to analyze sql server component installed in your environment before upgrading to next version of SQL Server also generates the report that helps you to identify the issues in existing environment that can be fix either before or after upgrade. Prerequisites for ...

SQL Server – Create table statement and sql syntax

Database table is used to store data in column and rows format. Each table has its own name. Create Table Statement Using create table sql statement you can create a table inside your database. Note: Maximum number of column in table is 1024 CREATE TABLE table_name ( column_name datatype(size), column_name datatype(size), column_name datatype(size)…. ) Here, ...

SQL Server Date functions – How to use in query

SQL Server Date Functions While working with SQL Server Date function and to keep it simple, make sure that date column does not have time portion. Whenever you insert date in table verify that datatype of column should match with date format. SQL Server Functions helps you to convert date and time values to other date ...