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)
Assign a value to a textbox which is in password mode
[ Assign password value to a text box]
txtPassword.Attributes.Add(“value”, password);
if (Session["postid"] != null && ViewState["postid"] != null)
{
if (ViewState["postid"].ToString() != Session["postid"
var i;
var colorValue;
var color control
colorControl = document.getElementById(“drp”) ;
for(i=colorControl.options.length-1;i>=0;i–)
{
if(colorControl.options[i].selected)
{
colorValue = colorControl.options[i].value;
}
}