Select * from users where convert(char,createddate,101)=’07/29/2008′
select cast(getdate() as char)
Select * from users where convert(char,createddate,101)=’07/29/2008′
select cast(getdate() as char)
To reset the identity value in database table
Syntax: DBCC checkident (tablename, reseed, 0)
DBCC checkident can reseed the value of the table. For e.g.: our table has 25 records with 25 as last identity. If we want next record to have identity has 35 we need to run following T-SQL
DBCC checkidetnt (tablename, reseed, 34)
Disadvantage: It will violate the uniqueness.
INSERT INTO TestTable (FirstName, LastName)
SELECT FirstName, LastName
FROM Person.Contact
WHERE EmailPromotion = 2
–Verify that Data in TestTable
SELECT FirstName, LastName
FROM TestTable
IF it is in different database.
INSERT INTO SmithNephewStoreFront.dbo.category ( [Name],parentcategoryID)
SELECT category,subcatid
FROM endo.dbo.category
WHERE catid = 2
DBCC CHECKIDENT (category, RESEED, 0)