SlideShare una empresa de Scribd logo
1 de 31
Presentation
on
Query Analyser , SQL Server Groups,
Transact –SQL
Query Analyzer
SQL Server Query Analyzer is a graphical user interface for
designing and testing Transact-SQL statements, batches,
and scripts interactively. It can be called from SQL Server
Enterprise Manager. You can merge data from SQL 2000
databases, AS/400 tables or other DBMS using Distributed
Query architecture.
Microsoft SQL Server 2000 SQL Query Analyzer is a graphical
tool that allows you to:
 Create queries and other SQL scripts and execute them
against SQL Server databases. (Query window)
 Quickly create commonly used database objects from
predefined scripts. (Templates)
 Locate objects within databases (object search feature), or
view and work with objects. (Object Browser)
 Execute stored procedures without knowing the parameters.
(Object Browser procedure execution feature)
 Debug stored procedures. (T-SQL Debugger)
 Debug query performance problems. (Show Execution Plan)
Accessing Sql Query Analyzer
You can open Query Analyzer from Enterprise Manager by
clicking Tools > Query Analyzer.
SQL Query Analyzer looks like this:
Query Menu Items
The Query menu items are grouped into several sections
because they encompass different kinds of activities. .
Several items, such as changing database context and
parsing/executing queries, are also represented by default
toolbar buttons
Connection Properties
Execution Plans
Displaying the execution plan shows you how SQL Server
proposes to execute a specific query. There are usually a
number of different ways that the desired results of a query
can be achieved The execution plan shows you the decision
that SQL Server has made about how to run the query most
efficiently.
Select * from Users u, Departments d where u.DepartmentId= d.Id;
Tools Menu Items
The Tools menu contains three groupings, one for the
Object Browser and Object Search, one for managing
statistics and indexes, and one for setting options and
customizing
Object Browser
 SQL Query Analyzer also has an "Object Browser" that
you can use to browse and edit tables, views, and stored
procedures. The Object Browser also displays a list of
common SQL Server functions and their parameters.
 To open the Object Browser, press F8. Alternatively, you
can click the Object Browser icon on the toolbar.
Another way of showing the Object Browser is to goTools
> Object Browser > Show/hide. The Object Browser
displays to the left of your workspace.
Object Browser
Writing Queries
You are now ready to write SQL queries against your
database. You can use this interface to create database
objects (such as databases, tables, views etc), insert data
into a database table, select data, update data, delete data.
The Edit Menu Items
The Edit menu items contain the usual commands for
cutting, copying, pasting, finding, and replacing text
strings. The Undo command will undo typing, one letter at
a time. All actions have keyboard shortcut keys assigned,
which are displayed in the right column of the menu list.
Templates
The Edit|Insert Template command displays a list of built-in
templates that ship with SQL Server 2000
Double-click the category you’re interested in to display a
list of individual templates.
Click Open when you’ve selected the desired template. This
displays the template file in the SQL pane of the Query
Analyzer.
SQL Server Groups
You use SQL Server groups to organize sets of computers
running SQL Server. You can organize these groups by, say,
function or department. You can even create subgroups
within a group. In SQL Server Management Studio, you use
the Registered Servers view to work with server groups.
The top-level groups are already created for you, based on
the SQL Server instances.
Registering SQL Server Group
1.On the File menu, click New SQL Server Registration.
The Register SQL Server wizard is displayed.
.
2.Click Next
3.In Available servers, type or select the name of the SQL
Server instance that you want to register, then click Add.
If you want to remove a SQL Server instance from the list,
in Added servers, select the name of the instance and click
Remove.
4. When you have added all the instances that you want to
register to the Added servers list, click Next.
5.Select the authentication method, and for SQL Server
authentication enter the Login name and Password.
For SQL Server authentication, you can select the Prompt
for the SQL Server account information when connecting
check box. If you select this option, SQL Backup will not
connect to the SQL Server automatically; you will have to
connect manually by right-clicking on the SQL Server
instance in the servers pane, and clicking Connect. A dialog
box will then be displayed for you enter the authentication
details.
6. Select the group to which you want to add the server.
Click Next.
9. SQL Backup registers the SQL Server instances. This
may take a few minutes.
To check the authentication details for a SQL Server, click
the SQL Server instance and then click Properties. You can
then enter the details and test them. Note that to change
the details for registration, you must re-enter the details in
the authentication page of the wizard.
Click Finish.
T-SQL
Transact-SQL is central to the use of Microsoft SQL Server.
All applications that communicate with SQL Server do so by
sending Transact-SQL statements to the server, regardless
of an application's user interface.
Cursor
A cursor is a pointer to a set of records returned by a SQL
statement. It enables you to take a set of records and deal
with it on a row-by-row basis.
Defining and Using Cursors
Step 1: Declare cursor:
To use a cursor you need to first declare it. This provides
definitions and characteristics of the record set for which
the cursor will be used.
 Declare cursorname Cursor
 Read_Only
 For SQL statement
Ex: Declare ACustomer Cursor
Read_Only
For select * from customer where rating=‘a’
Step 2: Open cursor:
After declaring, cursor must be opened before it can be
used in your procedure or batch code.
OPEN cursorname
Example: Open Acustomer
Step 3: Fetch data into variables:
This command is used to extract the data from the cursor.
FETCH Next From cursorname into list of local variables
Example: Fetch Next ACustomer into @CustID,
@CustName, @CustCity, @CustRating
Use @@Fetch_Status to test if record exist. If
@@Fetch_Status = 0, fetching is successful
Step 4: CLOSE cursorname
The CLOSE command is used to free the current result
set and locks.
Step 5: Deallocate cursor
DEALLOCATE command is used to remove the cursor
reference.
deallocate Acustomer
THANKYOU

Más contenido relacionado

La actualidad más candente

4) databases
4) databases4) databases
4) databasestechbed
 
CaseStudy-MohammedImranAlam-Xcelsius
CaseStudy-MohammedImranAlam-XcelsiusCaseStudy-MohammedImranAlam-Xcelsius
CaseStudy-MohammedImranAlam-XcelsiusMohammed Imran Alam
 
MorphX Development
MorphX DevelopmentMorphX Development
MorphX Developmentlogendran
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scenequest2900
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsAhsanul Karim
 
Introduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingIntroduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingGurpreet singh
 
Murach: How to use Entity Framework EF Core
Murach: How to use Entity Framework EF  CoreMurach: How to use Entity Framework EF  Core
Murach: How to use Entity Framework EF CoreMahmoudOHassouna
 
Classic asp , VB.net insert update delete crud
Classic asp , VB.net insert update delete crudClassic asp , VB.net insert update delete crud
Classic asp , VB.net insert update delete crudParakram Chavda
 
Difference between microsoft excel 2007
Difference between microsoft excel 2007Difference between microsoft excel 2007
Difference between microsoft excel 2007nivlayalat
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Aeric Poon
 
Android sq lite database tutorial
Android sq lite database tutorialAndroid sq lite database tutorial
Android sq lite database tutorialmaamir farooq
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorialonlinetrainingplacements
 
Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)magupta26
 
Automating reports with ssrs subscriptions
Automating reports with ssrs subscriptionsAutomating reports with ssrs subscriptions
Automating reports with ssrs subscriptionsKashikar R
 
WSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparxWSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparxFrank Ning
 

La actualidad más candente (19)

4) databases
4) databases4) databases
4) databases
 
CaseStudy-MohammedImranAlam-Xcelsius
CaseStudy-MohammedImranAlam-XcelsiusCaseStudy-MohammedImranAlam-Xcelsius
CaseStudy-MohammedImranAlam-Xcelsius
 
MorphX Development
MorphX DevelopmentMorphX Development
MorphX Development
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scene
 
Module05
Module05Module05
Module05
 
Day 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViewsDay 8: Dealing with Lists and ListViews
Day 8: Dealing with Lists and ListViews
 
Introduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP ReportingIntroduction to Oracle Fusion BIP Reporting
Introduction to Oracle Fusion BIP Reporting
 
Murach: How to use Entity Framework EF Core
Murach: How to use Entity Framework EF  CoreMurach: How to use Entity Framework EF  Core
Murach: How to use Entity Framework EF Core
 
Classic asp , VB.net insert update delete crud
Classic asp , VB.net insert update delete crudClassic asp , VB.net insert update delete crud
Classic asp , VB.net insert update delete crud
 
Difference between microsoft excel 2007
Difference between microsoft excel 2007Difference between microsoft excel 2007
Difference between microsoft excel 2007
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
 
Android sq lite database tutorial
Android sq lite database tutorialAndroid sq lite database tutorial
Android sq lite database tutorial
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorial
 
Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)Oracle Forms Tutorial (www.aboutoracleapps.com)
Oracle Forms Tutorial (www.aboutoracleapps.com)
 
Automating reports with ssrs subscriptions
Automating reports with ssrs subscriptionsAutomating reports with ssrs subscriptions
Automating reports with ssrs subscriptions
 
Oracle SQL Part 2
Oracle SQL Part 2Oracle SQL Part 2
Oracle SQL Part 2
 
WSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparxWSDL-Design-and-Generation-in-EASparx
WSDL-Design-and-Generation-in-EASparx
 
forms builder
forms builderforms builder
forms builder
 
@Prompt
@Prompt@Prompt
@Prompt
 

Similar a Query Analyser , SQL Server Groups, Transact –SQL

MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining toolsMS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining toolsDataminingTools Inc
 
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining toolsMS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining toolssqlserver content
 
Sql server lesson2
Sql server lesson2Sql server lesson2
Sql server lesson2Ala Qunaibi
 
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft Private Cloud
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAConcentrated Technology
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statementsSteve Xu
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8kaashiv1
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL IISankhya_Analytics
 
Access tips access and sql part 4 building select queries on-the-fly
Access tips  access and sql part 4  building select queries on-the-flyAccess tips  access and sql part 4  building select queries on-the-fly
Access tips access and sql part 4 building select queries on-the-flyquest2900
 
Project Server 2010 and Sharepoint 2010 integration with BI
Project Server 2010 and Sharepoint 2010 integration with BIProject Server 2010 and Sharepoint 2010 integration with BI
Project Server 2010 and Sharepoint 2010 integration with BIparallelminder
 
New features of sql server 2005
New features of sql server 2005New features of sql server 2005
New features of sql server 2005Govind Raj
 
Oracle application express
Oracle application expressOracle application express
Oracle application expressAbhinaw Kumar
 
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3Naji El Kotob
 
Sql interview question part 7
Sql interview question part 7Sql interview question part 7
Sql interview question part 7kaashiv1
 
Oracle application express ppt
Oracle application express pptOracle application express ppt
Oracle application express pptAbhinaw Kumar
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005rainynovember12
 

Similar a Query Analyser , SQL Server Groups, Transact –SQL (20)

MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining toolsMS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining tools
 
MS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining toolsMS SQL SERVER: Using the data mining tools
MS SQL SERVER: Using the data mining tools
 
Sql server lesson2
Sql server lesson2Sql server lesson2
Sql server lesson2
 
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
 
Ebook8
Ebook8Ebook8
Ebook8
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
 
Access tips access and sql part 4 building select queries on-the-fly
Access tips  access and sql part 4  building select queries on-the-flyAccess tips  access and sql part 4  building select queries on-the-fly
Access tips access and sql part 4 building select queries on-the-fly
 
Project Server 2010 and Sharepoint 2010 integration with BI
Project Server 2010 and Sharepoint 2010 integration with BIProject Server 2010 and Sharepoint 2010 integration with BI
Project Server 2010 and Sharepoint 2010 integration with BI
 
New features of sql server 2005
New features of sql server 2005New features of sql server 2005
New features of sql server 2005
 
REPORT ON (1)
REPORT ON (1)REPORT ON (1)
REPORT ON (1)
 
Oracle application express
Oracle application expressOracle application express
Oracle application express
 
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
Microsoft SQL Server 2012 Components and Tools (Quick Overview) - Rev 1.3
 
Ebook7
Ebook7Ebook7
Ebook7
 
Sql interview question part 7
Sql interview question part 7Sql interview question part 7
Sql interview question part 7
 
Oracle application express ppt
Oracle application express pptOracle application express ppt
Oracle application express ppt
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Query Analyser , SQL Server Groups, Transact –SQL

  • 1. Presentation on Query Analyser , SQL Server Groups, Transact –SQL
  • 2. Query Analyzer SQL Server Query Analyzer is a graphical user interface for designing and testing Transact-SQL statements, batches, and scripts interactively. It can be called from SQL Server Enterprise Manager. You can merge data from SQL 2000 databases, AS/400 tables or other DBMS using Distributed Query architecture.
  • 3. Microsoft SQL Server 2000 SQL Query Analyzer is a graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)  Quickly create commonly used database objects from predefined scripts. (Templates)  Locate objects within databases (object search feature), or view and work with objects. (Object Browser)  Execute stored procedures without knowing the parameters. (Object Browser procedure execution feature)  Debug stored procedures. (T-SQL Debugger)  Debug query performance problems. (Show Execution Plan)
  • 4. Accessing Sql Query Analyzer You can open Query Analyzer from Enterprise Manager by clicking Tools > Query Analyzer.
  • 5. SQL Query Analyzer looks like this:
  • 6. Query Menu Items The Query menu items are grouped into several sections because they encompass different kinds of activities. . Several items, such as changing database context and parsing/executing queries, are also represented by default toolbar buttons
  • 8. Execution Plans Displaying the execution plan shows you how SQL Server proposes to execute a specific query. There are usually a number of different ways that the desired results of a query can be achieved The execution plan shows you the decision that SQL Server has made about how to run the query most efficiently.
  • 9. Select * from Users u, Departments d where u.DepartmentId= d.Id;
  • 10. Tools Menu Items The Tools menu contains three groupings, one for the Object Browser and Object Search, one for managing statistics and indexes, and one for setting options and customizing
  • 11. Object Browser  SQL Query Analyzer also has an "Object Browser" that you can use to browse and edit tables, views, and stored procedures. The Object Browser also displays a list of common SQL Server functions and their parameters.  To open the Object Browser, press F8. Alternatively, you can click the Object Browser icon on the toolbar. Another way of showing the Object Browser is to goTools > Object Browser > Show/hide. The Object Browser displays to the left of your workspace.
  • 13. Writing Queries You are now ready to write SQL queries against your database. You can use this interface to create database objects (such as databases, tables, views etc), insert data into a database table, select data, update data, delete data.
  • 14. The Edit Menu Items The Edit menu items contain the usual commands for cutting, copying, pasting, finding, and replacing text strings. The Undo command will undo typing, one letter at a time. All actions have keyboard shortcut keys assigned, which are displayed in the right column of the menu list.
  • 15. Templates The Edit|Insert Template command displays a list of built-in templates that ship with SQL Server 2000
  • 16. Double-click the category you’re interested in to display a list of individual templates.
  • 17. Click Open when you’ve selected the desired template. This displays the template file in the SQL pane of the Query Analyzer.
  • 18. SQL Server Groups You use SQL Server groups to organize sets of computers running SQL Server. You can organize these groups by, say, function or department. You can even create subgroups within a group. In SQL Server Management Studio, you use the Registered Servers view to work with server groups. The top-level groups are already created for you, based on the SQL Server instances.
  • 19. Registering SQL Server Group 1.On the File menu, click New SQL Server Registration. The Register SQL Server wizard is displayed. .
  • 21. 3.In Available servers, type or select the name of the SQL Server instance that you want to register, then click Add. If you want to remove a SQL Server instance from the list, in Added servers, select the name of the instance and click Remove. 4. When you have added all the instances that you want to register to the Added servers list, click Next.
  • 22. 5.Select the authentication method, and for SQL Server authentication enter the Login name and Password. For SQL Server authentication, you can select the Prompt for the SQL Server account information when connecting check box. If you select this option, SQL Backup will not connect to the SQL Server automatically; you will have to connect manually by right-clicking on the SQL Server instance in the servers pane, and clicking Connect. A dialog box will then be displayed for you enter the authentication details.
  • 23. 6. Select the group to which you want to add the server. Click Next.
  • 24. 9. SQL Backup registers the SQL Server instances. This may take a few minutes. To check the authentication details for a SQL Server, click the SQL Server instance and then click Properties. You can then enter the details and test them. Note that to change the details for registration, you must re-enter the details in the authentication page of the wizard. Click Finish.
  • 25. T-SQL Transact-SQL is central to the use of Microsoft SQL Server. All applications that communicate with SQL Server do so by sending Transact-SQL statements to the server, regardless of an application's user interface.
  • 26. Cursor A cursor is a pointer to a set of records returned by a SQL statement. It enables you to take a set of records and deal with it on a row-by-row basis.
  • 27. Defining and Using Cursors Step 1: Declare cursor: To use a cursor you need to first declare it. This provides definitions and characteristics of the record set for which the cursor will be used.  Declare cursorname Cursor  Read_Only  For SQL statement Ex: Declare ACustomer Cursor Read_Only For select * from customer where rating=‘a’
  • 28. Step 2: Open cursor: After declaring, cursor must be opened before it can be used in your procedure or batch code. OPEN cursorname Example: Open Acustomer
  • 29. Step 3: Fetch data into variables: This command is used to extract the data from the cursor. FETCH Next From cursorname into list of local variables Example: Fetch Next ACustomer into @CustID, @CustName, @CustCity, @CustRating Use @@Fetch_Status to test if record exist. If @@Fetch_Status = 0, fetching is successful
  • 30. Step 4: CLOSE cursorname The CLOSE command is used to free the current result set and locks. Step 5: Deallocate cursor DEALLOCATE command is used to remove the cursor reference. deallocate Acustomer