Hiển thị các bài đăng có nhãn SQL SERVER. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn SQL SERVER. Hiển thị tất cả bài đăng

Thứ Hai, 19 tháng 5, 2014

How to run a stored procedure in sql server every hour

How to run a stored procedure in sql server every hour

Following step bellow:

In SQL Server Management Studio navigate to SQL Server Agent-->Jobs Right click on the Job Folder and select new job

On the dialog that pops up, give the job a name click on steps, then on new, you will see a dialog like the following, pick correct DB and type your proc name


after that click on schedule, pick new and you will see something like the image below, fill all the stuff you need and click ok, click ok on the job and you should be set



Read More

Chủ Nhật, 18 tháng 5, 2014

SQL SERVER – Find Row Count in Table – Find Largest Table in Database

SQL SERVER – Find Row Count in Table – Find Largest Table in Database

How many rows are there in any particular table?
This script will gives row number for every table in database.

USE AdventureWorks
GO
SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_count
FROM sys.dm_db_partition_stats st
WHERE index_id < 2
ORDER BY st.row_count DESC
GO


Read More