.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Is there any script for Open/Close sql-server 2008 ?

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :Sql Server

Is there any script (any batch file) for Open/Close sql-server 2008 ?

thank's in advance

View Complete Post

More Related Resource Links

how many open connection is recommended to leave - in sql server 2008 Enterprise Edition

hi i have my C# program that work with sql-server 2008 Enterprise Edition i have 40 users that connect to this database. i dont close the connection. how many open connection is recommended to leave ? or is it better to close connection ? thank's in advance

SQL Server 2008 Script Componant Error - [SSIS.Pipeline] Error: component "Script Comp Name" (48) fa

Hi All,   I am facing one strange issue in SSIS 2008. I have developed one SSIS package which is importing excel data into SQL Server 2008. This Package contains some Scirpt componants. This package is working fine on Windows XP machine but when I am trying to run on Windows 2003 server it gives me error "[SSIS.Pipeline] Error: component "SCR RDSTableRelation" (48) failed the post-execute phase and returned error code 0x80004002". Surprising thing is that if on windows server 2003server  if I drag a new script componat and paste the previous script code itself then it works fine. Even if I copy-paste the existing script componant and give source-destination connectino to this new script componant then also it works.

Error when running an SQL script to restore a database on SQL Server 2008 R2 Express

Hi, At work, I use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. At home, I also use SQL Server 2008 Express running on Windows XP Professional Service Pack 3. Whenever I do work on the database at work, I usually restore the database at home (or vice versa) I have been using the following SQL scripts to back up the database and to restore the same database (at work or at home). BackupRealEstate.sql USE Master BACKUP DATABASE [RealEstate] TO DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH NOFORMAT, INIT, NAME = N'RealEstate-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO RestoreRealEstate.sql USE Master RESTORE DATABASE [RealEstate] FROM DISK = N'F:\My Documents\My Database\RealEstate.bak' WITH  FILE = 1, NOUNLOAD, REPLACE, STATS = 10 GO Everything worked fine until I replaced my 8yo home computer with a newer and faster one. My new home computer is running Windows 7 Home Premium and I use the latest SQL Server 2008 R2 Express. When I tried to run the above restore SQL script, I got the following error message: Msg 3101, Level 16, State 1, Line 2 Exclusive access could not be obtained because the database is in use. Msg 3013, Level 16, State 1, Line 2 RESTORE DATABASE is terminating abnormally. There was no other application/process using this database. Can someone please help me? Regards,

SQL server connection - keep it opened all the time, or open/close on demand ?



I have a VB6 app that gets data from several devices and has to store it in a SQL server 2005 database.
It may have to store small amounts of data (a few KB at most) somewhere between 5 and 500 times per day.
My app only sends data to DB, doesn't read anything.

My question is what's better in this case:

a) the app opens a connection to DB at startup and closes it at exit, or
b) when data arrives, the app opens a connection, sends data, then closes the connection


SSRS 2008 Report Manager only accessible within the server, cannot open on a different PC


How should I configure my SQL 2008 Reporting Services so that the Report Manager can be accessed outside the server.  That is, from a different machine within the same network?  Whenever I try to access the Report Manager from another machine, a prompt will appear requesting for username/password several times before a blank page is shown.

Reporting Services Configuration Details:
Service Account: Local System
Execution Account: Tried using my own login details within the domain and tried without it

Please let me know if you need any other details.  I am running out of ideas on what I can possibly do, thanks!


Windows Server 2008 R2 - "Open in Windows Explorer" only works in special cases



I am running SharePoint 2007 off a Windows 2008 R2 server and it seems to be running fine.

We're using another Windows 2008 R2 server for clients to login to (using remote desktop) and connect to the SharePoint site. However, whenever a client tries to use the "Open in Windows Explorer"-feature when handling documents, nothing happens. I have run through all the posts here and checked that all services, webdav modules, etc. are as they should be.

I found a fix recently, but it does not make a lot of sense. If I go directly to the site after logging in, it does not work (as expected). However, if I type in the direct path to the documents folder, \\sitename\cases, it opens just fine and if I open a new browser AFTER that, the "Open in Windows Explorer" feature now works perfectly fine.

Is there some way to fix this behavior other than adding a "net use" command to all startup scripts for all the users? It seems like I'm circumventing the problem rather than fixing it.

EDIT: We disabled UNC paths (because of security issues on the client server), but even if we tells you the path is disallowed, simply typing it in triggers the function to work (and still gives you access through SharePoint). Very odd.

SQL 2008 could not open a connection to SQL server [53]


3 computers connect fine, but two others cannot connect to the DB.


Active X Script Supported in SQL Server 2008



We have using Active X Script in SQL Server 2008 SSIS Packages. We have installed SQLServer2005_BC MSI for DTSRuntime. Is Active X control is supported by Microsoft until SQL Server 2008 support ends. Pls let me know. Thanks

SQL Server 2008 database script



I created a database in sqlserver2008 and then i created a script which comprised of Schema and Data both ,now i run that script in sql server 2005 but two tables are not getting create on 2005,although there is not anything new in both the tables which is not in 2005...Pls help 

How to execute sql script file in Sql Server 2008

want to execute a sql script file if user want to apply the new database changes. That script file is present on the server and if user wants to apply the new changes it just press a button i want to know how to execute that script file to a particular server database in Sql Server 2008. Im using C# for coding

Sql Server 2008 Tutorials

This Link Provides total Sql Server 2008 Tutorials

Seven reasons to care about SQL Server 2008 R2

Microsoft begins to fully realize its vision of SQL Server as an information platform and not "just" a database. Hence the main theme for this release -- at least according to Microsoft -- is self-service BI. The PowerPivot plug-ins for Excel 2010 and SharePoint 2010 are easily going to make the biggest splash of all the new features, not least because they're the most complete. But then, SQL Server 2008 R2 isn't strictly necessary for PowerPivot for Excel, which works with plenty of other data sources.

Error upgrading SQL Server 2008


i was normally using VS2005 and SQL server 2005...

i upgraded to SQL Server 2008... and then...

i could not build my project anymore... because of this error:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source Error: 

sql server 2008 adventureworks database


dear Friends

For my MCTS 70 -433 examination, I recently installed sql server 2008 and installed the sample databases too. but my issue is, in that book they have mentioned a database called "AdventureWorks2008" and the nice thing is I don't have a such a database with me in my sql server 2008. 

And the query is 

-- MERGE Statement
USE AdventureWorks2008
MERGE INTO	Sales.SalesOrderDetailHistory AS SODH
USING Sales.SalesOrderDetail AS SOD
ON SODH.SalesOrderID = SOD.SalesOrderID
AND SODH.SalesOrderDetailID = SOD.SalesOrderDetailID
INSERT (LineTotal, SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty
, ProductID, SpecialOfferID, UnitPrice, UnitPriceDiscount
, rowguid, ModifiedDate, Cancelled)
VALUES(LineTotal, SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty
, ProductID, SpecialOfferID, UnitPrice, UnitPriceDiscount
, rowguid, ModifiedDate, DEFAULT)
UPDATE SET SOHD.Cancelled = 'True'
OUTPUT $action , inserted.* ;	

Please help me to overcome this issue and let me know where can I download that database too.

Thanking you

happy Coding

PostGreSQL to sql server 2008?



I am new to POSTGREsql.

I have a database built in POSTGresql and I have to migrate it to SQL SERVER 2008.

How can I do that?



Word Automation Issue in Windows Server 2008 Hosting



The problem I am posting here is that I was facing nearly 2 weeks around. Any body comes with this stuff please help.

Word Automation in sample ASP.NET(C#) application.

I am using Microsoft.Office.Inetrop.Word Assembly for automation. Here I am reading a XXX.dot template file and fill the contents with dynamic data.

When i am executing my code in localhost:someportnumber the automation is working fine and I could get expected result and when I am hosting in my inetmgr(Windows XP is my OS) it is also working fine.

But the problem is that when I am hosting in my production server(Windows Server 2008 Standard Edition) I am not able to perform automation and results in the following error.

Data: System.Collections.ListDictionaryInternal
Message: Word has encountered a problem.
Source: Microsoft Word

The code gets failed in the following line:

ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

Document wordDoc = wordApp.Documents.Add(ref oTemplate, ref oFalse, ref oMissing, ref oMissing); // Error in this line

I cannot able to proceed further. Can anybody please help me in solving this issue?

Thank you.

With Regards,


No ASPNET User in Windows Server 2008?


I have been looking everywhere online regarding this, but have not found a clear answer.


I have an ASP.Net app running on Windows Server 2008, it's basically a reporting app using Crystal Reports. I have encountered a roadblock in regards to rendering some pages. When I run the app in Visual Studio(on the same 2008 machine) everything works perfectly. Yet when I publish it and run it live the reports will not display correctly, I get a message saying Failed to render page.


I looked this error up in the Crystal Reports website and the fixes they have there refer to giving the windows "aspnet" user full access rights to certain folders on the machine. I would be happy to do this, however there is no aspnet user in Windows Server 2008.


I installed the server and set its role to be Web Server. I also checked all the options regarding ASP.Net and IIS 6 compatibility. Yet there is no ASPNET username anywhere.


Did I set the server up wrong? or do I have to do something within ASP.Net to  create this user and then give it rights? 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend