[Solved] Why we need advanced versions in SQL Server and explain specific features it included with simple example

Odd question, odd answer : Obsolescence By the way, if you wish to ask for support for unsupported solutions good luck. Here is the official Microsoft post on SQL Server versions supported. Another reason, is the inter-compatibility between application versions and maintenance cost. By the way, updating products allow flaws to be fixed, security flaws … Read more

[Solved] SQL Print the name of all Employees together with the name of their supervisor

An inner join should do it. Here’s the syntax, but you’ll have to apply it to your database: SELECT c.name, o.name FROM cats c INNER JOIN owners o ON c.owner_id = o.id “cats c” basically means “Cats table, which I’m nicknaming c.” “owners o” basically means “Owners table, which I’m nicknaming o.” In your select, … Read more

[Solved] . It’s working fine when I pass 10-15 input but taking more than 5 minutes for 30 input. I need to make it work for 100 inputs

. It’s working fine when I pass 10-15 input but taking more than 5 minutes for 30 input. I need to make it work for 100 inputs solved . It’s working fine when I pass 10-15 input but taking more than 5 minutes for 30 input. I need to make it work for 100 inputs

[Solved] Extract month and day from a field in sql

If your filed is a Date or DateTime, I would use the function DATEPART. For example, this gets the current year: DATEPART(year, GETDATE()) View the msdn page for the full documentation. If your field is text, use CONVERT to convert your field to a DATE, then use the first method with the converted date as … Read more

[Solved] Group by and calculation from value on the next row

You can easily calculate the % difference using lag() select name, date, number, Cast(((number * 1.0) – Lag(number,1) over(partition by name order by date))/ Lag(number,1) over(partition by name order by date) * 100 as int) from table solved Group by and calculation from value on the next row

[Solved] Create hierarchical data from 2 tables

Has nothing to do with recursion. Basically you can get what you want with UNION SELECT ProdId as MarkerId, ProdName as MarkerName, NULL as MarkerParentId from t1 UNION ALL SELECT OrdId as MarkerId, OrdName as MarkerName, ProdId MarkerParentId from t2 ORDER BY MarkerId, MarkerParentId 3 solved Create hierarchical data from 2 tables

[Solved] SQL query to get list of months start from current month

look at this query. it’s just for demonstration, DECLARE @YEAR INT SET @YEAR = (SELECT YEAR(GETDATE())) DECLARE @MONTH INT SET @MONTH = (SELECT MONTH(GETDATE())) DECLARE @DT TABLE(ID INT, MONTHNAME NVARCHAR(20)) INSERT INTO @DT SELECT NUMBER AS ID, DATENAME(MONTH, CAST(@YEAR*100+NUMBER AS VARCHAR) + ’01’) AS MONTHNAME FROM MASTER.DBO.SPT_VALUES WHERE TYPE = ‘P’ AND NUMBER BETWEEN @MONTH … Read more

[Solved] What else can SQL Server Management Studio do? [closed]

SQL Server Management Studio includes the following general features: Supports most administrative tasks for SQL Server. A single, integrated environment for SQL Server Database Engine management and authoring. Dialogs for managing objects in the SQL Server Database Engine, Analysis Services, and Reporting Services, that allows you to execute your actions immediately, send them to a … Read more