- .Net Errors (3)
- .Net Question (10)
- 3 – Tier Architecture (2)
- AJAX (2)
- ASP.Net (60)
- ASP.Net – SQL Server (7)
- ASP.Net Controls (16)
- ASP.Net Example (102)
- ASP.Net Objects (4)
- Blog (1)
- Blogger (1)
- C Program (82)
- FileUpload (2)
- JQuery (7)
- PHP (1)
- PROJECT (10)
- SQL (21)
- SQL Function (8)
- SQL-SERVER (24)
- Validation Control (7)
- Web Server (3)
- Windows Application (8)
Category Archives: SQL-SERVER
Create New database in sql server management studio 2008. create table in sql database in sql server management studio 2008.
create and copy new table from an existing table in sql server management studio. How to copy all the columns with data from one table to another table in sql server management studio 2008.
Database Connectivity between ASP.Net and SQL-Server
There are many method to make connection between ASP.Net and SQL-Server.
1. Connection using TableAdapter and StoredProcedure thought Wizards.
2. Connection using SQLCommand and SQLDataAdapter using StoredProcedure .
3. Connection using SQLDataAdapter and SQLConnection writing query in webpage.
STEP 1 – Open the SQL-Server and Create New Database for connectivity.
Now Create New Table “UserMst” in Database Example.
STEP 2 – Create Stored Procedure for Select Data.
Fiil up the Record in Created Table named UserMst
How to Create Stored Procedure in SQL-Server?
Stored Procedure is write SQL Query in Specific format in SQL Server and call them from your application, instead of writing queries inside your program code.
Stored Procedures are precompiled Transact-SQL statements which is stored in a SQL Server database.
Stored procedure is a simple SQL Statement, which is precompiled.
STEP 1 – Open the SQL Server management studi0
STEP 2 – Create a New Database
STEP 3 – Expand the DataBase name, Select the Programmability folder —> Stored Procedure.
Here, we will learn how to create XML using Query:
Here SQL statement “FOR XML RAW” creates one XML node for every corresponding row in database and columns will be created as attributes of that XML node. Results:
XML RAW (
SQL ELEMENTS create Elements instead of Attributes in xml
XML RAW (
- The field must be unique within it’s Column.
- A Combination of unique & not null.
- A table has Only one Primary Key.
- Define relationship between two Table.
- Either one to one, one to many, many to many
- A table may have more than one combination of columns that could uniquely identify the rows in a Table, each combination is a Candidate Key.
- A candidate Key is one that can identify each rows of a table uniquely.
What is Stored Procedure in SQL-Server?
- Stored Procedure is write SQL Query in Specific format in SQL Server and call them from your application, instead of writing queries inside your program code.
- Stored Procedures are precompiled Transact-SQL statements which is stored in a SQL Server database.
- Stored procedure is a simple SQL Statement, which is precompiled.
- SP Increase the performance of your application.
Create a Stored Procedure in SQL-Server
CREATE PROCEDURE [STUDENT_SELECT]
//here is your parameter for insert/update/delete purpose.
SELECT * FROM STUDENTMST
- SQL stands for Structured Query Language.
- SQL is a globally accepted standard language that is used to handle database related activities for creating database schemas, updating/inserting/deleting of data, retrievieng data, and managing user roles and database activities.
- SQL is used to communicate with a database.
- it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database.
Create a Table in SQL
- Below is the code / syntax to create a table in SQL,
The SQL syntax for CREATE TABLE isCREATE TABLE “Table_Name”(“column 1″ “datatype_for_column_1″,
“column 2″ “datatype_for_column_2″,
- Create Table for Student, the Table name StudentMst with below Column.
CREATE TABLE StudentMst
CREATE TABLE StudentMst
- If you want to specify the Default values for some column then,
Address char(50) default ‘Meera Academy’,
City char(50) default ‘Modasa’,
Data Definition Language (DDL)
- DDL stands for Data Definition Language.
- DDL statements are used to define the database structure or schema.
- It is used to create and modify the structure of database objects in database.
CREATE, ALTER, DROP statements
- For creating databases & database objects.
Syntax for creating database:
CREATE DATABASE DataBaseName
Create DataBase Students
Syntax for creating Table:
CREATE TABLE StudentsMst
– For altering/modifying the exsisting tables.
Syntax for Altering/Adding columns:
Alter Table TableName Add Column1 datatype,Column2 datatype,…..
Alter Table StudentsMst Add DateOfBirth datetime,SchoolName varchar(300)