Proc 1, sp_Counter:
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'sp_Counter'
AND type = 'P')
DROP PROCEDURE sp_Counter
GO
Create PROCEDURE sp_Counter
@cTableName varchar(50)
AS
Declare @cSQL varchar(1000)
Declare @lnCounter INT
SELECT @cSQL = 'SELECT Count(*) FROM '
SELECT @cSQL = @cSQL + @cTableName
exec (@cSQL)
GO
Proc 2, Sp_test
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'sp_test'
AND type = 'P')
DROP PROCEDURE sp_test
GO
CREATE PROCEDURE sp_test
@cTableName varchar(50)
AS
EXEC sp_Counter @cTableName
GO
****************************
Make sence?
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'sp_Counter'
AND type = 'P')
DROP PROCEDURE sp_Counter
GO
Create PROCEDURE sp_Counter
@cTableName varchar(50)
AS
Declare @cSQL varchar(1000)
Declare @lnCounter INT
SELECT @cSQL = 'SELECT Count(*) FROM '
SELECT @cSQL = @cSQL + @cTableName
exec (@cSQL)
GO
Proc 2, Sp_test
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'sp_test'
AND type = 'P')
DROP PROCEDURE sp_test
GO
CREATE PROCEDURE sp_test
@cTableName varchar(50)
AS
EXEC sp_Counter @cTableName
GO
****************************
Make sence?