New answers tagged

2 votes

Is there any way to send SMS without OLE Automation?

Is there any way to send SMS without OLE Automation? You can write your own C# solution using CLR and deploy it to SQL Server, such as a CLR procedure. Doing so will allow you to (either directly or ...
J.D.'s user avatar
  • 37.2k
-1 votes

size of a primary key and foreign key

create Table Table1 ( id int identity(1,1), User_id as 'ABC'+Right('0000'+cast(id as varchar(20)),20) persisted Unique, Salary int ); sp_help Table1 -- here is check Length of User_id & give that ...
Hemali Agrawal's user avatar
-1 votes

Using Cursor to loop through a Table variable in SQL Server

You can using like this DECLARE @myTableVariable TABLE (id INT) insert into @myTableVariable values(1),(2),(3) declare @id INT = 0; DECLARE cur CURSOR FOR SELECT id FROM @myTableVariable OPEN cur ...
Thuan Tran's user avatar
0 votes

Tracking stored procedure usage

I just use the userconfigurables objets : Place this code in firts line of your procedure : DECLARE @procevent sysname = (SELECT name FROM sys.objects WHERE object_id = @@PROCID); EXEC ...
SQLpro's user avatar
  • 489
0 votes

Tracking stored procedure usage

I use the two queries below to track SP execution times. When run via an agent job at the proper intervals this captures all executions in a single table before items are removed from the cache. You ...
Doug Kapell's user avatar

Top 50 recent answers are included