Showing posts with label MSSQL. Show all posts
Showing posts with label MSSQL. Show all posts

Wednesday, 11 April 2018

How to find table row count?

--Use below query to find table row count
select so.name,sp.rows from sys.objects so inner join sys.partitions sp
on so.object_id = sp.object_id
where so.type in ('TF','U','V')
and sp.index_id <= 1
order by so.name

Tuesday, 10 October 2017

How to download SQL Server 2016 / 2017 Free

How to download SQL Server 2016 / 2017 Free:

It's simple please go through below link to download free, nowadays Microsoft giving Developer edition free download, because they love developers and you get all feature whatever you get in the enterprise version, soo cool right, but only one catch you can't use developer for your production environment.

Please find the difference in below table.

https://www.microsoft.com/en-us/sql-server/sql-server-downloads



Features SQL Server 2016 Enterprise SQL Server 2016 Standard SQL Server 2016 Express SQL Server 2016 Developer
Maximum number of cores Unlimited 24 Cores 4 Cores Unlimited

Maximum memory utilized
per instance
Operating system max 128 GB 1 GB Operating system max

Maximum size
524 PB 524 PB 10 GB 524 PB

Production use rights
Yes Yes Yes No

Basic OLTP
Yes Yes Yes Yes

Manageability: Management Studio, policy-based management
Yes Yes Yes Yes

Basic high availability: 2-node single
database failover, non-readable secondary
Yes Yes NO Yes

Enterprise data management: Master Data Services, Data Quality Services
Yes NO NO Yes

Advanced OLTP: In-memory OLTP, operational analytics
Yes NO NO Yes

Advanced High Availability: Always On Availability Groups, multi-database failover, readable secondaries
Yes NO NO Yes

Basic security: Row-level security, data masking, basic auditing, separation of duties
Yes Yes NO Yes

Advanced security: Transparent database encryption, Always Encrypted
Yes No NO Yes

Advanced data integration: Fuzzy grouping and lookups, change data capture
Yes NO NO Yes

Data warehousing: In-Memory Columnstore, partitioning
Yes No NO Yes

PolyBase2
Yes Yes NO Yes

Maximum memory utilized per
instance of Analysis Services
Operating system max Tabular: 16 GB
MOLAP: 64 GB
No NO

Maximum memory utilized per
instance of Reporting Services
Operating system max 64 GB Express with Advanced
Services: 4 GB
NO

Programmability and developer tools: T-SQL, CLR, Data Types, FileTable, JSON
Yes Yes Yes Yes

Basic reporting and analytics
Yes Yes No Yes


Basic data integration: SQL Server Integration Services, built-in connectors
Yes Yes No Yes

Basic corporate business intelligence: Basic multi-dimensional models, basic tabular model, in-memory storage mode
Yes Yes No Yes

Mobile reports and KPIs
Yes No NO Yes

Advanced corporate business intelligence: Advanced multi-dimensional models, advanced tabular model, DirectQuery storage mode, advanced data mining
Yes NO NO Yes

Basic R integration: Connectivity to R open, limited parallelism
Yes Yes Yes Yes

Advanced R integration: Full parallelism ScaleR
Yes NO NO Yes

Hybrid cloud
Stretch Database
Yes Yes Yes Yes

If you have any questions, please comment below, I will try to reply back ASAP


Wednesday, 20 September 2017

Create Multiple Tempdbs based on Logical CPUs

  1. 1. Use below script to file current tempdb files 

select DB_NAME(mf.database_id) database_name 
, mf.name logical_name, mf.file_id 
, CONVERT (DECIMAL (20,2) 
, (CONVERT(DECIMAL, size)/128)) as [file_size_MB] 
, CASE mf.is_percent_growth 
WHEN 1 THEN 'Yes' 
ELSE 'No' 
END AS [is_percent_growth] 
, CASE mf.is_percent_growth 
WHEN 1 THEN CONVERT(VARCHAR, mf.growth) + '%' 
WHEN 0 THEN CONVERT(VARCHAR, mf.growth/128) + ' MB' 
END AS [growth_in_increment_of] 
, CASE mf.is_percent_growth 
WHEN 1 THEN CONVERT(DECIMAL(20,2) 
,(((CONVERT(DECIMAL, size)*growth)/100)*8)/1024) 
WHEN 0 THEN CONVERT(DECIMAL(20,2) 
, (CONVERT(DECIMAL, growth)/128)) 
END AS [next_auto_growth_size_MB] 
, physical_name from sys.master_files mf 
where database_id =2 and type_desc= 'rows' 

  1. 2. Use below script to find number of logical CPUS 

SELECT cpu_count AS logicalCPUs FROM sys.dm_os_sys_info 

  1. 3. Use below Alter DB command to add more tempdb files 

ALTER DATABASE tempdb ADD FILE ( NAME = N'tempdev2', 
FILENAME = N'F:\Data\tempdev2.ndf' , SIZE =8MB , FILEGROWTH = 64MB) --<<--Update the data file location/Size/AutoGrowth 
GO

How to find table row count?

--Use below query to find table row count select so.name,sp.rows from sys.objects so inner join sys.partitions sp on so.object_id = sp.obj...