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


Top 5 Contributors of the Month
satyapriyanayak
kelly456
Post New Web Links

How to execute sql script file in Sql Server 2008

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Sql Server
 
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



View Complete Post


More Related Resource Links

LDF File Disaster in SQL Server 2008

  
I am working on a startup company and the "dba" recently quit...come to find out he let the LDF file grow to 105GB - which effectively shut down the server due to lack of disk space.  I need to serious help as this database is also supporting our replication system and thus I cannot do anything drastic like detaching, deleting the LDF file and reattaching. I tried the shrink file option but the LDF file did not shrink at all.  I set the recovery model to simple, then tried shrinking and that did nothing.  This is a SQL Server 2008 machine - can somebody please help? Also, given that I am mainly a developer, is there some EASY reference on how to setup log file backups so this does not happen in the future?  Do I just perform a full backup every 30 minutes over-writing the previous backup, differentials, what? Thanks!

SSMS 2008 Activity Monitor Activity Monitor is unable to execute queries against server (SQL Server

  
I get the following error when running SQL Server SSMS 2008 (32-bit) on my (Windows 7 64-bit) workstation against our SQL Server 2005 (32-bit) development server running Windows Server 2003 (32-bit): TITLE: Microsoft SQL Server Management Studio ------------------------------ The Activity Monitor is unable to execute queries against server <my server\instance name>. Activity Monitor for this instance will be placed into a paused state. Use the context menu in the overview pane to resume the Activity Monitor. ------------------------------ ADDITIONAL INFORMATION: Unable to find SQL Server process ID 2256 on server VTX-DEV-01 (Microsoft.SqlServer.Management.ResourceMonitoring)   I can expand the panes and all display data except Overview and Data File I/O. This is true for all instances on that server. The SSMS 2005 Activity Monitor (also on my workstation) works fine when connected to that server. I checked for the registry setting to disable the performance counters on both my machine and the server, and it was not there. I started the Performance Counter DLL Host on my machine, but that made no difference. I can see all Processor counters on the server from my local Performance Monitor. I ran "lodctr /R" on both systems, but that didn't help. The only SQL counters I see on the server (from my workstation) are SQLServer:SSIS Pipeline and SQLServer:SSIS

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,

Restoring a BAK file via SQL Server Express 2008

  
How can I restore a BAK file that I received from a vendor.  They were unable to find a database schema for us so they just sent us a BAK file.  I'm using SQL Server Express 2008

sql 2008: the activity monitor is unable to execute queries against server

  
Installed sql server 2008 entrprise edition on VM server windows 2008 (64bit). When launch Activity Monitor, get:

The Acityvity Monitor is unable to execute queries against server <server name>.
Activity Monitor for this instance will be placed into a paused state.
Use the context menu in the overview pane to resume the Activity Monitor.

Additional information:
   Unable to find SQL Server process ID xxxx on server <server name>
   (Microsoft.SqlServer.Management.ResourceMonitoring)



Tried to "use he context menu in the overview pane to resume the Activity Monitor" and got the same error again.

Installed sql 2008 in my XP machine, I can use Activity Monitor (AM) for local instance but cannot launch it for the instance on the server (same error).

Used windows authentication with sysadmin role for connection from my machine. On the server used domain\administrator that the account created the instance.

Please help.

Cannot attach a database file to SQL server 2008 Express

  

When I try to attach a database using SQL server 2008 express version, it gives me an error message.  it says

"Msg 18456, Level 14, State 1, Server LINDA\SQLEXPRESS, Line 1
Login failed for user 'LINDA\Linda'"

How can I fix this error?

 


reading text file using sql server 2000 , 2008

  

hi,

can any one tell me how to read the data's in the text file using sql server 2000 and 2008.

i have a text file in a server and it contains one column name with the multiple column values i need to read that informations and i need to update in a table in the database.

how can we do this.

Regards,

lawmen



property setting in report server (2008) config file is not working as expected.

  

Hi,

I have set the <WorkingSetMinimum> property to 2.4GB in my reportserver 2008 config file.

By defintion, <WorkingSetMinimum> setting means,

  1. Lower limit of service memory consumption; memory will not be released if the consumption is below this amount, though the service will not reserve the designated amount of memory when it starts.
  2. If service uses more than the designated amout of memory, it will release back the memory only till this declared value and not beyond that, which means it should keep 2.4GB as designated.

See this link for definition: http://books.google.com/books?id=mzY_Xo_9J-gC&pg=PA589&lpg=PA589&dq=What+is+%3Cworkingsetminimum%3E+in+report+server+configuration+file&source=bl&ots=r_xhRp8erj&sig=E_o0-Dh2SXOgMNrW3sptt5oZrYI&hl=en&ei=f5mjTNeNM5O8ccmErJMI&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCAQ6AEwAw#

SQL Server 2008 R2 Disk Usage report showing incorrect data file

  

When I go to ANY database (System, AdventureWorks*, user) in Managemant Studio, I right-click on the db, select Reports, select Standard Reports, and select Disk Usage.  The disk usage report shows the correct db on top, but always only shows AdventureWorks_Data.mdf when I expand Disk Space Used by Data Files section.  This happens to any db I try.  When I look at Database Properties/Files for that database, the logical and physical file names are correct.

Since the correct files appear in Database Properties/Files, I'm hoping it's just a bug in the report.  Same thing happens if I run a Disk Usage by Table report for ANY database,  The tables for AdventureWorks always only appear,

Thanks,  Mike


uploading CSV file to SQL SERVER 2008

  

Hi,

I want to upload csv file to sql server on my web portal website with validation check. Any ideas or any tutorials of uploading the csv file on to sql server 2008.


"Cannot execute as the server principal..." SQL 2008 SP1

  
I found an article about this error but pertaining to SQL 2005:

http://support.microsoft.com/kb/913423

Looks like it hasn't been fixed in SQL 2008?

Anyway....

I created a GROUP in AD on the domain controller.

 

I created a login for this group on the SQL 2K8 SP1 server.

 

I created an user one of the databases.

 

When I look at the properties of that database, and attempt to see what the effective permissions are for th

How to check for file exists on remote server in ssrs 2008?

  
I have a report that needs to display images that are stored on a remote web server. The problem is that I also need to check if the file exists first otherwise I get those annoying image not found red X's.

I tried entering the code at the bottom in the custom code section of the report which works if I run it on my local machine however it doesn't work in SSRS 2008. After doing a little trial and error I found it seems to be failing on the first line in the function,

Dim request = System.Net.WebRequest.Create(New Uri (fileURL))

Is there some specific permissions or configuration change needed on the SSRS2008 server for this code to work? Or is there a better way to do this?

Thanks,
Robert


Public Function CheckRemoteURL(ByVal fileURL As String) As String
Dim request = System.Net.WebRequest.Create(New Uri (fileURL))
request.Method = "HEAD"

Dim returnURL = ""

Try
Dim response = request.GetResponse()
returnURL = fileURL
Catch ex As Exception
returnURL =""
End Try

Return returnURL
End Function

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

  
hi

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

thank's in advance

Categories: 
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