I just signed up to receive em…
I just signed up to receive emails from DefeatTheDebt.com YOU SHOULD TOO.
I just signed up to receive emails from DefeatTheDebt.com YOU SHOULD TOO.
declare VARIABLES
declare CURSOR_NAME cursor local static for SELECT STATEMENT
open CURSOR_NAME
fetch next from CURSOR_NAME into VARIABLES –EXAMPLE –VAR1,VAR2 –SELECT STATEMENT RETURNS MATCHING COLUMNS FOR EACH VAR
while @@FETCH_STATUS = 0
begin
–DO STUFF
–YOU CAN SELECT IN TO OTHER VARIABLES
–OR IF @@ROWCOUNT > 0 OR OTHER IF STATEMENTS.
–RUN IUD QUERIES. ETC.
fetch next from CURSOR_NAME into VARIABLES
end
close CURSOR_NAME
deallocate CURSOR_NAME
--written here for posterity
Just put a new floor in our down half-bath for the 2nd time . On Thursday a PLUMBER is coming to install the rest so to avoid a repeat.
If you use Tortoise SVN you need a global ignore list so that your source code won’t change just by building a project or opening your IDE. Here is the global ignore list that I use.
*.suo *\bin *\obj *\bin\* *\obj\* *.resharper *.user _ReSharper* *.cache *.log *.vspscc *.vssscc *\build_output *\build_output\* *\code_drop *\code_drop\* SolutionVersion.cs SolutionVersion.vb* *\ MeetingManagerDXCore.Solution *\MeetingManagerDXCore.Solution*
A lot of the above settings are if you use Dev Express Refactor Pro and some specific to some of my projects.
Here is a plain vanilla global ignore list if you use Visual Studio.
*.suo *\bin *\obj *\bin\* *\obj\* *.resharper *.user *.cache *.log *.vspscc *.vssscc
Seth
What’s your states fiscal health? http://tinyurl.com/yj9fag6
I am reading John Mauldin’s excellent newsletter… http://tinyurl.com/ykree5r . To subscribe…http://tinyurl.com/2y9r3k.
Sorry for the long title.
Sometimes your SQL Server installation is corrupt. You read the logs and the error says that your the MASTER database won’t start. And…oops…you don’t have a recent backup of your all-important user database.
Maybe running this batch file will work.
REM repairMaster.bat
@echo off
REM CHANGE THE filepath variable below. If you have multiple sql instances the path below might not work.
REM UPDATE THE FOLLOWING VARIABLES TO MATCH YOUR NEED.
set file-path=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL
set backup-path=C:\SQL_data_recovery
set db-file-name=DBNAME.mdf
set log-file-name=LOGNAME.ldf
set db-name=DBNAME
set instance-name=INSTANCENAME
set server-name=SERVERNAMEecho %file-path%\mastlog.ldf
del “%file-path%\Data\master.mdf”
del “%file-path%\Data\mastlog.ldf”md %backup-path%
REM **JUST IN CASE GRAB THE TWO DATA FILES of your database. Since your server won’t start these files are not locked.
copy “%file-path%\Data\%db-file-name%” %backup-path%
copy “%file-path%\Data\%log-file-name%” %backup-path%copy “%file-path%\Template Data\master.mdf” “%file-path%\Data\master.mdf”
copy “%file-path%\Template Data\mastlog.ldf” “%file-path%\Data\mastlog.ldf”
copy “%file-path%\Template Data\model.mdf” “%file-path%\Data\model.mdf”
copy “%file-path%\Template Data\modellog.ldf” “%file-path%\Data\modellog.ldf”
copy “%file-path%\Template Data\msdbdata.mdf” “%file-path%\Data\msdbdata.mdf”
copy “%file-path%\Template Data\msdblog.ldf” “%file-path%\Data\msdblog.ldf”net start %instance-name%
sqlcmd -S%server-name% -Usa -irepairMaster.sql
echo DONE
OF COURSE, YOU HAVE TO UPDATE THE VARIABLES at the beginning of the batch file to match your needs.
It won’t work if you don’t put put the following SQL Script into same folder you put the BAT file.
–repairMaster.sql
use master
goDECLARE @filepathDB nvarchar(100);
DECLARE @filepathLog nvarchar(100);SET @filepathDB = ‘$(file-path)\Data\$(db-file-name)’
SET @filepathLog = ‘$(file-path)\Data\$(log-file-name)’exec sp_attach_db ‘$(db-name)’,@filepathDB,@filepathLog
goBACKUP DATABASE $(db-name) TO DISK=’$(backup-path)\$(db-name)_backup.bak’
GO
RESTORE VERIFYONLY FROM DISK=’$(backup-path)\$(db-name)_backup.bak’
GO
Sorry…no time to explain. To download click here.
Seth
Just ordered Money, Greed, and God: Why Capitalism Is the Solution and Not the Problem http://tinyurl.com/yb63vp7
Your right…it is an int not a decimal.