|
|
-
Nakul Vachhrajani Commented 3 Months ago through Ask | 10 Points
You have not mentioned the SQL Server version which you are using and therefore, I am assuming that you are using at least SQL Server 2008. The following code snippet will need to be modified if it needs to be used for SQL Server 2005 or below:
U...
|
-
Nakul Vachhrajani Commented 3 Months ago through Ask | 10 Points
If I have understood your question correctly, a simple ORDER BY would suffice - no need of an aggregation.
USE tempdb;
GO
--Test Table
DECLARE @countryTable TABLE (CountryName VARCHAR(20), CountryPopulation DECIMAL(20,8));
...
|
-
Nakul Vachhrajani Commented 3 Months ago through Ask | 10 Points
Are you looking for something like this?
USE AdventureWorks2008R2 ;
GO
SELECT isc.TABLE_SCHEMA,
isc.TABLE_NAME,
COUNT(isc.COLUMN_NAME) AS NumberOfColumnsInTable
FROM INFORMATION_SCHEMA.COLUMNS AS isc
...
|
-
Nakul Vachhrajani Commented 3 Months ago through Ask | 10 Points
No, downward restore of a database backup is not possible. This is true even for different builds within the same release of SQL Server, i.e. SQL Server 2012 SP1 backup cannot be restored on SQL Server 2012 RTM.
This is because the internal structure...
|
-
Nakul Vachhrajani Posted 3 Months ago through Ask | 10 Points
One of the regular visitors of this site sent me the following question, which I believe is an ideal candidate for this module.
Can we restore Sql server 2012 backup on Sql server 2008 R2 ? If not, What is the solution for this?...
|
-
Nakul Vachhrajani Commented 4 Months ago through Ask | 10 Points
Of course. You can use temporary tables or table variables with this. The change would be that you would first INSERT the results of the CTE query into the temporary object and then join your parent table with it - rest all would remain the same....
|
-
Nakul Vachhrajani Commented 4 Months ago through Ask | 10 Points
Here you go - If the query below is useful, please mark this as the answer so that the thread can be closed.
USE tempdb;
GO
DECLARE @checkMaxYear TABLE (RecId INT, RecYear INT);
INSERT INTO @checkMaxYear (RecId, RecYear...
|
-
Nakul Vachhrajani Commented 5 Months ago through Ask | 10 Points
Hello, Alok!
That's a good question and confusing. However, hardware requirements depend on a number of parameters including (but not limited to) the following:
- Number and nature of the transactions on the databases
- Nature of the transact...
|
-
Nakul Vachhrajani Commented 6 Months ago through Ask | 10 Points
Hello, Alpesh!
Read-write table-valued parameters are not supported currently by SQL Server. You can read an interesting synopsis on this here: [http://www.sommarskog.se/tableparam.html][1]. To achieve the same requirement as what you are looking for...
|
-
Nakul Vachhrajani Commented 6 Months ago through Ask | 10 Points
Hello, Ramkoti!
As mentioned by Mike, the option cannot be disabled. What can be done, however is to write a DDL trigger that would throw an error and at least warn the user that the database just went offline. Here's something I wrote up quickly to ...
|