Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Databases Programming Interviews:BtrieveClipperData ModelingData StructuresDatabase AdministrationDatabase Administrator (DBA)Database AnalystDatabase DeveloperDB DevelopmentEDI/Data Integration ExpertFirebirdHierarchicalIBM DB2InformixJava DatabaseMariaDBMicrosoft Access DeveloperMongoDBMS SQL ServerMySQL ProgrammingNetworkNoSQLObject RelationalPostgrePostgreSQLProgressRDBMSRelationalSQLSQL AdministratorSQL and PL/SQLSQL Notification ServicesSQL server 2008SSRSStored ProcedureSybaseTeradata
Copyright © 2018. All Rights Reserved
MS SQL Server Interview Question:
How Many Categories of Functions based Their Return Modes?
Submitted by: AdministratorSQL Server supports 2 categories of user defined functions based on their return modes:
1. Scalar-valued Functions - A function that returns a single value. Scalar-valued functions can be used in scalar expressions. Below are some scalar-valued functions:
PRINT GETDATE();
GO
May 19 2007 1:26PM
PRINT 'URL reversed: '+REVERSE('globalguideline.com');
GO
URL reversed: moc.enilediuglabolg
2. Table-valued Functions - A function that returns data in rows and columns like a table. Table-valued functions can be used in table expressions like the FROM clause of SELECT statements Below are some scalar-valued functions:
SELECT * FROM fn_helpcollations() WHERE name LIKE 'French_CI%'
GO
name
-------------------
French_CI_AI
French_CI_AI_WS
French_CI_AI_KS
French_CI_AI_KS_WS
French_CI_AS
French_CI_AS_WS
French_CI_AS_KS
French_CI_AS_KS_WS
(8 row(s) affected)
Submitted by: Administrator
1. Scalar-valued Functions - A function that returns a single value. Scalar-valued functions can be used in scalar expressions. Below are some scalar-valued functions:
PRINT GETDATE();
GO
May 19 2007 1:26PM
PRINT 'URL reversed: '+REVERSE('globalguideline.com');
GO
URL reversed: moc.enilediuglabolg
2. Table-valued Functions - A function that returns data in rows and columns like a table. Table-valued functions can be used in table expressions like the FROM clause of SELECT statements Below are some scalar-valued functions:
SELECT * FROM fn_helpcollations() WHERE name LIKE 'French_CI%'
GO
name
-------------------
French_CI_AI
French_CI_AI_WS
French_CI_AI_KS
French_CI_AI_KS_WS
French_CI_AS
French_CI_AS_WS
French_CI_AS_KS
French_CI_AS_KS_WS
(8 row(s) affected)
Submitted by: Administrator
SELECT i.index_id, i.name, s.avg_fragmentation_in_percent
FROM sys.dm_db_index_physical_stats (
DB_ID(N'GlobalGuideLineDatabase'),
OBJECT_ID(N'ggl_links_indexed'),
DEFAULT, DEFAULT, DEFAULT) s, sys.indexes i
WHERE s.object_id = i.object_id
AND s.index_id = i.index_id;
GO
index_id name avg_fragmentation_in_percent
0 NULL 0.574712643678161
2 ggl_links_url 0
3 ggl_links_counts 0
Submitted by: Administrator
FROM sys.dm_db_index_physical_stats (
DB_ID(N'GlobalGuideLineDatabase'),
OBJECT_ID(N'ggl_links_indexed'),
DEFAULT, DEFAULT, DEFAULT) s, sys.indexes i
WHERE s.object_id = i.object_id
AND s.index_id = i.index_id;
GO
index_id name avg_fragmentation_in_percent
0 NULL 0.574712643678161
2 ggl_links_url 0
3 ggl_links_counts 0
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.