<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   ∑:464  Sort:Date

"sp_rename ... 'COLUMN'" - Renaming an Existing Column in SQL Server
How to rename an existing column with the "sp_rename" stored procedure in SQL Server? If you have an existing column in a table and you want to change the column name, you can use the "sp_rename ... 'COLUMN'" stored procedure. "sp_rename" allows you to change names of COLUMN, DATABASE, INDEX, USERDA...
2016-11-17, 2112🔥, 0💬

"sp_columns" - Getting a List of Columns in a View in SQL Server
How To Get a List of Columns in a View using the "sp_columns" Stored Procedure in SQL Server? If you have an existing table, but you don't remember what are the columns defined in the view, you can use the "sp_columns" stored procedure to get a list of all columns of the specified view. The followin...
2016-11-05, 2110🔥, 0💬

"sys.columns" - Getting a List of Columns in a Table in SQL Server
How To Get a List of Columns using the "sys.columns" View in SQL Server? If you have an existing table, but you don't remember what are the columns defined in the table, you can use the "sys.columns" system view to get a list of all columns of all tables in the current database. In order to a list o...
2016-11-17, 2108🔥, 0💬

sys.sql_modules - Getting Trigger Definitions Back in SQL Server
How To Get the Definition of a Trigger Back in SQL Server? If you want get the definition of an existing trigger back from the SQL Server, you can use the catalog view called sys.sql_modules, which stores definitions of views, stored procedures, and triggers. The sys.sql_modules holds trigger defini...
2016-10-24, 2105🔥, 0💬

Versions of SQL Server Transact-SQL
How do I tell what version of Transact-SQL my SQL Server is using? The Transact-SQL version is the same as the SQL Server. You can determine the SQL Server version using the following Transact-SQL statement: SELECT @@version ------------------------------ ------------------------------ ------------Mi...
2017-06-16, 2102🔥, 0💬

BREAK of Loop Statement in SQL Server Transact-SQL
How to break a WHILE look statement in SQL Server Transact-SQL? How to use BREAK statements? You can use the BREAK statement to break a WHILE loop inside the statement block in Transact-SQL using this syntax: WHILE condition BEGIN statement_1 statement_2 ... BREAK; statement_n ... END When a BREAK s...
2017-01-11, 2098🔥, 0💬

Converting Binary Strings into Character Strings in SQL Server
Can Binary Strings Be Converted into Character Strings in SQL Server Transact-SQL? Binary strings and character strings are convertible. But there are several rules you need to remember: Binary strings can be converted implicitly to character strings by assignment operations. Binary strings can not ...
2017-02-28, 2086🔥, 0💬

Date/Time Operations and Functions in SQL Server Transact-SQL
Where to find answers to frequently asked questions on Date/Time Operations and Functions in SQL Server Transact-SQL? Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on Date/Time Operations and Functions in SQL Server Transact-SQL. Clear answers are ...
2017-02-25, 2085🔥, 0💬

"ALTER INDEX ... REBUILD" - Defragmenting Indexes in SQL Server
How To Rebuild Indexes with ALTER INDEX ... REBUILD in SQL Server? When an index is defragmented to a large percentage, like &gt; 30%, you can use the "ALTER INDEX ... REBUILD" statement to rebuild the index. Here is a tutorial exercise on rebuilding indexes: USE FyiCenterData; GO UPDATE fyi_lin...
2016-11-08, 2081🔥, 0💬

Creating a Large Table with Random Data for Indexes in SQL Server
How To Create a Large Table with Random Data for Index Testing in SQL Server? If you want to see how index can be used to improve data search performance, you have to build some large tables, which requires large amount of random data. This tutorial exercise helps you to build a large table with pur...
2016-11-13, 2055🔥, 0💬

"SELECT ... INTO" - Creating New Tables With Queries in SQL Server
How to create new tables with "SELECT ... INTO" statements in SQL Server? Let's say you have a table with many data rows, now you want to create a backup copy of this table of all rows or a subset of them, you can use the "SELECT ... INTO" statement. The tutorial script below gives you a good exampl...
2016-11-17, 2045🔥, 0💬

"sys.objects" - Listing All Objects in a Given Schema in SQL Server
How To List All Objects in a Given Schema in SQL Server? If you are wonder what objects are stored in a given schema as an object container, you can use view "sys.objects" to get a list of all objects in a schema. The tutorial exercise shows you how to list all objects in schema "fyi" and "dbo": -- ...
2016-10-22, 2044🔥, 0💬

Generating CREATE PROCEDURE Scripts on Existing Stored Procedures in SQL Server
How To Generate CREATE PROCEDURE Script on an Existing Stored Procedure in SQL Server Transact-SQL? If you want to know how an existing stored procedure was created, you can use SQL Server Management Studio to automatically generate a "CREATE PROCEDURE" script The following tutorial shows you how to...
2017-01-05, 2036🔥, 0💬

"DISABLE TRIGGER" - Disabling Triggers in SQL Server
How To Disable Triggers using "DISABLE TRIGGER" in SQL Server? If want to stop the execution of an existing trigger temporarily, you can use the "DISABLE TRIGGER" statement to disable it. The disabled trigger will be kept in the database. If you want to resume the execution of a disabled trigger, yo...
2016-10-24, 2011🔥, 0💬

sys.views - List of Existing Views in SQL Server
How To See Existing Views in SQL Server? If you want to know how many views you have created in a database, you use the system view called sys.views to get a list of views defined in the current database. The tutorial exercise shows you how many views in database FyiCenterData: USE FyiCenterData; GO...
2016-11-05, 2006🔥, 0💬

What Causes Index Fragmentation in SQL Server
What Causes Index Fragmentation in SQL Server? Index fragmentation is usually caused by deleting of existing rows or updating existing values of the indexed column. Inserting new rows should not cause any index fragmentation. This tutorial exercise shows you how update statements of 50000 rows on th...
2016-11-08, 2001🔥, 0💬

Selecting Some Specific Columns from a Table in SQL Server
How To Select Some Specific Columns from a Table in a Query in SQL Server? If you want explicitly tell the query to return some specific columns, you can specify the column names in the SELECT clause. The following select statement returns only three columns, "id", "created" and "url" from the table...
2016-10-26, 1998🔥, 0💬

sys.sql_modules - Getting View Definitions Back in SQL Server
How To Get the Definition of a View Out of the SQL Server in SQL Server? If you want get the definition of an existing view back from the SQL Server, you can use the system view called sys.sql_modules, which stores definitions of views and procedures. The sys.sql_modules holds view definitions ident...
2016-11-05, 1996🔥, 0💬

"DROP USER" - Deleting a Database User in SQL Server
How To Delete an Existing Database User in SQL Server? If you don't want to keep a database user any more, you should delete the user by using the "DROP USER" statement. This tutorial exercise shows how to delete "Dba_User": -- Login with "sa" USE FyiCenterData; GO DROP USER Dba_User; GO -- List all...
2022-01-24, 1988🔥, 0💬

Data Literals in SQL Server Transact-SQL
Where to find answers to frequently asked questions on data literals in Microsoft SQL Server Transact-SQL? I am new to Transact-SQL and SQL Server. Here is a list of frequently asked questions and their answers compiled by FYIcenter.com team on data literals in Microsoft SQL Server Transact-SQL: Con...
2017-05-20, 1987🔥, 0💬

"RIGHT OUTER JOIN ... ON" - Writing Queries with Right Outer Joins in SQL Server
How To Write a Query with a Right Outer Join in SQL Server? If you want to query from two tables with a right outer join, you can use the RIGHT OUTER JOIN ... ON clause in the FROM clause. The following query returns output with a right outer join from two tables: fyi_links and fyi_rates. The join c...
2016-10-30, 1984🔥, 0💬

DML (Data Manipulation Language_Statements in SQL Server
What Are DML (Data Manipulation Language) Statements in SQL Server? DML (Data Manipulation Language) statements are statements to change data values in database tables. The are 3 primary DML statements: INSERT - Inserting new rows into database tables. For example "INSERT INTO fyi_links VALUES (101,...
2016-11-03, 1946🔥, 0💬

OUTPUT - Defining Output Parameters in Stored Procedures in SQL Server
How To Define Output Parameters in Stored Procedures in SQL Server Transact-SQL? Sometime a stored procedure not only want to take input values from the calling statement batch, but it also want to send output values back to the calling statement batch. This can be done by defining output parameters...
2016-12-28, 1943🔥, 0💬

Overflow Errors on Converting Big Values to NUMERIC in SQL Server
What Happens When Converting Big Values to NUMERIC Data Types in SQL Server Transact-SQL? If you are converting a numeric expression to a NUMERIC data type and the value is too big for the storage size, you will get an arithmetic overflow error as shown in the following examples: -- Overflow error o...
2017-03-22, 1941🔥, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   ∑:464  Sort:Date