Hello everyone, I am going to share an interesting
and very challenging task.
Today's I execute a SQL Script in my SQL Server
2012. This SQL script have data around 5GB. Actually, script contain the schema and
data both. When I executing this script in the Transact-SQL, I getting an error.
I tried so may type of mechanism to resolve and
now, I finally resolved this issue.
Steps
are as given below.
1.
Open the cmd.exe as Administrator.
2.
Create the Documents directory.
3.
Put your SQL Script file in the documents folder.
4.
Type the query with sqlcmd, server name,
database name and script file name as like below T-SQL query.
Transact-SQL
command Query
sqlcmd -S server-name -d database-name
-i script-file-name.sql
My Transact-SQL command Query
server-name = > VIASERVER
database-name => Test
script-file-name => xyz.sql
The
SQLCMD used Utility as given below.
1.
The sqlcmd is use to provide the
connectivity with MSSQL Server and sqlcmd commands must be the first statement
on a line.
2.
The (-S) identifies the instance of
MSSQL Server.
3.
The (-d) identifies the database
name.
4.
The (-i) identifies the sql script
file.
The solution of this issues as given below steps and video.
The reference video for the same as given below.
For more reference links.
I think It might help you! Thank you!