Adding/Removing IDENTITY property on a Column  

Posted by ReelTym

CREATE TABLE MyTable ( ID INT, Data varchar(max) )
GO
INSERT INTO MyTable VALUES ( 4, 'This is stuff' ), ( 6, 'This is more stuff' )
GO
SELECT * FROM MyTable
GO

--------
-- Adding IDENTITY property
--------
SELECT * INTO #MyTempTable FROM MyTable
GO
TRUNCATE TABLE MyTable
GO
ALTER TABLE MyTable ADD ID_II INT IDENTITY(1,1)
GO
ALTER TABLE MyTable DROP COLUMN ID
GO
ALTER TABLE MyTable ALTER COLUMN ID_II INT NOT NULL
GO
EXEC sp_rename 'MyTable.ID_II', 'ID', 'COLUMN'
GO
SET IDENTITY_INSERT MyTable ON
GO
INSERT INTO MyTable ( ID, Data ) SELECT t.ID, t.Data FROM #MyTempTable t
GO
SET IDENTITY_INSERT MyTable OFF
GO
INSERT INTO MyTable ( Data ) VALUES ( 'This is the last stuff' )
GO
DROP TABLE #MyTempTable
GO

SELECT * FROM MyTable
GO
EXEC sp_help MyTable
GO

--------
-- Removing IDENTITY property
--------
-- Drop FKs/UKs/PKs/Indexes that reference the Column being changed.
ALTER TABLE MyTable ADD ID_II INT
GO
UPDATE MyTable SET ID_II = ID
GO
ALTER TABLE MyTable DROP COLUMN ID
GO
ALTER TABLE MyTable ALTER COLUMN ID_II INT NOT NULL
GO
EXEC sp_rename 'MyTable.ID_II', 'ID', 'COLUMN'
GO
-- Recreate FKs/UKs/PKs/Indexes that referenced the Column being changed.

SELECT * FROM MyTable
GO
EXEC sp_help MyTable
GO

--Adding IDENTITY property to a Column
DROP TABLE MyTable
GO

Dynamic Sorting  

Posted by ReelTym

Declare @pSortParam varchar(35)

Select @pSortParam = 'BfsXpLogID';

with a as (
Select * from dbo.BfsXpLog a with (nolock)
)
Select * from (Select top 10 * from a where @pSortParam = 'CreateDate' order by CreateDate) as b
union all
Select * from (Select top 10 * from a where @pSortParam = 'BfsXpLogID' order by BfsXpLogID) as b

Youth Theme 2011: We Believe  

Posted by ReelTym


WE BELIEVE






YOUNG MEN







YOUNG WOMEN







WE SEEK AFTER THESE THINGS




LEADER SUPPORT

17 Points of the True Church of Christ  

Posted by ReelTym

  1. Christ organized the Church (Eph 4:11-14)
  2. The true church must bear the name of Jesus Christ (Eph 5:23)
  3. The true church must have a foundation of Apostles and Prophets (Eph 2:19-20)
  4. The true church must have the same organization as Christ's Church (Eph 4:11-14)
  5. The true church must claim divine authority (Heb 5:4-10)
  6. The true church must have no paid ministry (1 Cor 9:16-18; Acts 20:33-34; John 10:11-13)
  7. The true church must baptize by immersion (Matt 3:13-16)
  8. The true church must bestow the gift of the Holy Ghost by the laying on of hands (Acts 8:14-17)
  9. The true church must practice divine healing (Mark 3:14-15)
  10. The true church must teach that God and Jesus are separate and distinct individuals (John 17:11; 20:17)
  11. The true church must teach that God and Jesus have bodies of flesh and bone (Luke 23:36-39; Acts 1:9-11; Heb 1:1-3)
  12. The officers must be called by God (Heb 4:4; Ex 28:1; 40:13-16)
  13. The true church must claim revelation from God (Amos 3:7)
  14. The true church must be a missionary church (Matt 28:19-20)
  15. The true church must be a restored church (Acts 3:19-20)
  16. The true church must practice baptism for the dead (1 Cor 15:16&29)
  17. "By their fruits ye shall know them." (Matt 7:20