Thursday, 15 November 2018

How can I take backup of particular tables in SQL Server 2008?

Process:

SELECT * INTO new_table_1
FROM existing_table_1
 
--- For table 2

SELECT * INTO new_table_2 
 FROM existing_table_2
 
and so on... for n number of tables

This statement WILL CREATE the tables called new_table_1, new_table_2 ,.. thus you do not have to previously create it.

Note: This process takes the backup quite fast but major disadvantage would be that it does not carry over the Keys, Indexes and Constraints of the table and backup is stored within the database not somewhere externally to a file.
 

Friday, 31 August 2018

Clock Wise / Anti Clock Wise Stopwatch in JavaScript

:: Code ::

<html>
<head>
<title>stopwatch</title>
<script type="text/javascript">
var c=60;
var c2=0;
var t,t2;
function stopCount()
{
clearTimeout(t)
}
function stopCount2()
{
clearTimeout(t2)
}
function timedCount()
{
document.getElementById('txt').value=c
c=c-1
if(c==-1)
{
alert("time over")
stopcount()
}
t=setTimeout("timedCount()",1000)
}
function timedCount2()
{
document.getElementById('txt2').value=c2
c2=c2+1
if(c2==61)
{
alert("time over")
stopcount2()
}
t=setTimeout("timedCount2()",1000)
}
</script>
</head>
<body>
<center>
<form>
 <input type="text" id="txt">
 <input type="button" value="Start stopwatch (Anti Clock Wise)" onClick="timedCount()">
 <input type="button" value="Stop" onClick="stopCount()">
 <br/>
 <br/>
 <input type="text" id="txt2">
 <input type="button" value="Start stopwatch (Clock Wise)" onClick="timedCount2()">
 <input type="button" value="Stop" onClick="stopCount()">
</form>
<center>
</body>
</html>

:: Example ::




Monday, 19 March 2018

unable to open the physical file mdf operating system error access is denied

Solution:

Steps are given bellow:

  • go to Control Panel ->
  • System and Security ->
  • Administrative Tools ->
  • Services ->
  • Double Click SQL Server (SQLEXPRESS) -> right click, Properties
  • Select Log On Tab
  • Select "Local System Account" (the default was some obtuse Windows System account)
  • -> OK
  • right click, Stop
  • right click, Start
Now you want to try attach your .mdf file.