<< < 11 12 13 14 15 16 17 18 19 20 > >>   ∑:464  Sort:Date

Primary Key - Default Indexes of Tables in SQL Server
Is the PRIMARY KEY Column of a Table an Index in SQL Server? If you define a primary key on a table, an index for the primary key column will be created by default. The tutorial exercise below shows you the index created as part of the primary key column of "fyi_links": USE FyiCenterData; GO -- Drop...
2016-11-13, 1353🔥, 0💬

Counting Groups Returned with the GROUP BY Clause in SQL Server
How To Count Groups Returned with the GROUP BY Clause in SQL Server? If you use the COUNT(*) function on groups returned with the GROUP BY clause, it will count the number of rows within each group, not the number of groups. If you want to count the number of groups, you can put the GROUP BY query i...
2016-10-29, 1352🔥, 0💬

Using Subqueries with the EXISTS Operators in SQL Server
How To Use Subqueries with the EXISTS Operators in SQL Server? A subquery can be used with the EXISTS operator as "EXISTS (subquery)", which returns true if the subquery returns one or more rows. The following statement is a good example of "EXISTS (subquery)". It returns rows from fyi_links table t...
2016-10-29, 1352🔥, 0💬

Who Is the Owner of a Schema in SQL Server
Who Is the Owner of a Schema in SQL Server? When you create a schema in a database, SQL Server will assign a owner (a database user) to this schema. If your login name is mapped to the owner of a schema at the database level, you have the full permission on all objects in this schema. The following ...
2016-10-22, 1351🔥, 0💬

"DROP FUNCTION" - Dropping an Existing User Defined Function in SQL Server
How To Drop an Existing User Defined Function in SQL Server Transact-SQL? If you have an existing user defined function that you don't want to use it anymore, you should delete it from the SQL Server by using the "DROP FUNCTION" statement as shown in the tutorial example below: USE FyiCenterData; GO...
2016-12-24, 1350🔥, 0💬

Using Group Functions in the ORDER BY Clause in SQL Server
Can Group Functions Be Used in the ORDER BY Clause in SQL Server? If the query output is aggregated as groups, you can sort the groups by using group functions in the ORDER BY clause. The following statement returns the maximum "counts" in each group, determined by a unique combination of tag and ye...
2016-10-25, 1346🔥, 0💬

Writing Inner Joins with the WHERE Clause in SQL Server
How To Write an Inner Join with the WHERE Clause in SQL Server? If you don't want to use the INNER JOIN ... ON clause to write an inner join, you can put the join condition in the WHERE clause as shown in the following query example: SELECT l.id, l.url, r.comment FROM fyi_links l, fyi_rates r WHERE ...
2016-10-29, 1345🔥, 0💬

SQL Server Connection Tutorials
Where to find SQL Server Connection tutorials? I am having trouble to connect to my SQL Server. Here is a collection of tutorials, tips and FAQs on how to connect your client tools and client application programs to SQL server. SQL Server Connection Concepts SQL Server Connection Protocols SQL Serve...
2023-12-30, 1340🔥, 0💬

Accessing a Schema Not Owned by You in SQL Server
What Happens If You Are Trying to Access a Schema Not Owned by You in SQL Server? In general, if you are trying to access an object in schema owned by another database user, you will get a "permission denied" error, unless that you have been granted access permission to that object explicitly. Here ...
2016-10-22, 1339🔥, 0💬

LIKE - Matching a Pattern in a Character String in SQL Server
What To Perform Pattern Match with the LIKE Operator in SQL Server Transact-SQL? Pattern match is a very important operation for search records base on character string columns. SQL Server 2005 offers the LIKE operator to perform pattern match operations in two formats: target_string LIKE pattern --...
2017-01-21, 1338🔥, 0💬

Running SQL Server 2005 Books Online on Your Local System in SQL Server
How to run SQL Server 2005 Books Online on your local system in SQL Server? SQL Server 2005 Books Online can be accessed by a Web browser over the Internet. But you can also download it and read it on your local system. If you have downloaded and installed SQL Server 2005 Books Online package, you f...
2016-12-04, 1336🔥, 0💬

SINGLE_USER/MULTI_USER - Database User Access Options in SQL Server
How to set database to be SINGLE_USER in SQL Server? Databases in SQL Server have three user access options: MULTI_USER - All users that have the appropriate permissions to connect to the database are allowed. This is the default. SINGLE_USER - One user at a time is allowed to connect to the databas...
2016-11-20, 1335🔥, 0💬

IN - Testing Values Returned by a Subquery in SQL Server
How To Test Values Returned by a Subquery with the IN Operator in SQL Server Transact-SQL? Normally, the comparison operator IN is used against a list of specified values as in the format of: "test_value IN (value_1, value_2, ..., value_n)". But you can also replace the list of values by a subquery ...
2017-01-21, 1334🔥, 0💬

DROP INDEX - Removing Existing Indexes in SQL Server
How To Drop Existing Indexes in SQL Server? For some reason, if you want remove an existing index, you can use the DROP INDEX statement with following syntax: CREATE INDEX table_name.index_name The tutorial exercise below shows you how to remove the index "fyi_links_id": USE FyiCenterData; GO SELECT...
2016-11-15, 1334🔥, 0💬

Creating and Managing Schemas in SQL Server
Where to find answers to frequently asked questions on Creating and Managing Schemas in SQL Server? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Creating and Managing Schemas in SQL Server. Clear answers are provided with tutorial exercises on ...
2016-10-22, 1333🔥, 0💬

Using Values from Other Tables in UPDATE Statements in SQL Server
How To Use Values from Other Tables in UPDATE Statements in SQL Server? If you want to update values in one table with values from another table, you can use a subquery as an expression in the SET clause. The subquery should return only one row for each row in the update table that matches the WHERE...
2016-11-02, 1324🔥, 0💬

NULL Values Involved in String Operations in SQL Server
What Happens If NULL Values Are Involved in String Operations in SQL Server Transact-SQL? If NULL values are involved in string operations, the result will be string NULL values. The following tutorial script shows you some good examples: SELECT 'FyiCenter'+NULL; GO ---------- NULL SELECT LEN(NULL);...
2017-02-05, 1320🔥, 0💬

Creating a Simple Table to Test Triggers in SQL Server
How To Create a Simple Table to Test Triggers in SQL Server? If you want to follow other tutorial examples included in this collection, you need to run this SQL script to create a simple table called fyi_users: USE FyiCenterData; GO DROP TABLE fyi_users; GO CREATE TABLE fyi_users ( id INTEGER IDENTI...
2016-10-25, 1320🔥, 0💬

Rebuilding All Indexes on One Table in SQL Server
How To Rebuild All Indexes on a Single Table in SQL Server? If you have several indexes on a single table and want to rebuild all of them, you may use the "ALTER INDEX ALL ON table_name REBUILD" statement as shown in the tutorial exercise below: USE FyiCenterData; GO UPDATE fyi_links_indexed SET url...
2016-11-08, 1317🔥, 0💬

Filtering Out Duplications in the Returning Rows in SQL Server
How To Filter Out Duplications in the Returning Rows in SQL Server? If there are duplications in the returning rows, and you want to remove the duplications, you can use the keyword DISTINCT in the SELECT clause. The DISTINCT applies to the combination of all data fields specified in the SELECT clau...
2016-10-26, 1317🔥, 0💬

Group Functions in Query Statements in SQL Server
What Are Group Functions in Query Statements in SQL Server? Group functions are functions applied to a group of rows. Examples of group functions are: COUNT(*) - Returns the number of rows in the group. MIN(exp) - Returns the minimum value of the expression evaluated on each row of the group. MAX(ex...
2016-10-25, 1315🔥, 0💬

What Are Triggers in SQL Server
What Are Triggers in SQL Server? A trigger is a special kind of stored procedure that automatically executes when an event occurs in the database server. A trigger is really an event handler. SQL Server allows users to create triggers (event handlers) for 3 types of events: DML Event - Occurs when a...
2016-10-25, 1309🔥, 0💬

"DROP TABLE" - Deleting Existing Tables in SQL Server
How To Drop an Existing Table with "DROP TABLE" Statements in SQL Server? If you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below: SELECT * FROM tipBackup GO id subject description create_date 1 Learn SQL Visit dev.fyice...
2016-11-15, 1308🔥, 0💬

"CREATE TRIGGER" - Creating a DML Trigger in SQL Server
How To Create a DML Trigger using CREATE TRIGGER Statements in SQL Server? A DML trigger is a trigger declared to handle a DML event, which occurs when an INSERT, UPDATE or DELETE statement is executed. If you want to create a DML trigger, you should use the "CREATE TRIGGER" statement in the followi...
2016-10-25, 1308🔥, 0💬

<< < 11 12 13 14 15 16 17 18 19 20 > >>   ∑:464  Sort:Date