How To Read SQL Server Log?

Jan 13, 2008

is there any way to view and read the sql server log using T-SQL or .NET form?

View 2 Replies


ADVERTISEMENT

Transact SQL :: Making Server Database Read / Write From Read Only

Jan 12, 2012

i attached adventure works in sql server 2008 and it showing as read only ,make it read write or remove read only tag from database.

View 11 Replies View Related

Read Text File From SQL Server, Read Its Content, And Load It In RichTextBox (Related Component: Context.Response.BinaryWrite(), And StreamReader)

Nov 26, 2007

OBJECTIVE: I would like to read a text file from SQL Server 2000, read the text file content, and load its conntents in a RichTextBoxTHINGS I'VE DONE AND HAVE WORKING:1) I've successfully load a text file (ex: textFile.txt) in sql server database table column (with datatype Image) 2) I've also able to load the file using a Handler as below: using System;using System.Web;using System.Data.SqlClient;public class HandlerImage : IHttpHandler {string connectionString;public void ProcessRequest (HttpContext context) {connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["NWS_ScheduleSQL2000"].ConnectionString;int ImageID = Convert.ToInt32(context.Request.QueryString["id"]);SqlConnection myConnection = new SqlConnection(connectionString);string Command = "SELECT [Image], Image_Type FROM Images WHERE Image_Id=@Image_Id";SqlCommand cmd = new SqlCommand(Command, myConnection);cmd.Parameters.Add("@Image_Id", System.Data.SqlDbType.Int).Value = ImageID;SqlDataReader dr;myConnection.Open(); cmd.Prepare(); dr = cmd.ExecuteReader();if (dr.Read()){ //WRITE IMAGE TO THE BROWSERcontext.Response.ContentType = dr["Image_Type"].ToString();context.Response.BinaryWrite((byte[])dr["Image"]);}myConnection.Close();}public bool IsReusable {get {return false;}}}'>'>
<a href='<%# "HandlerDocument.ashx?id=" + Eval("Doc_ID") %>'>File
</a>- Click on this link, I'll be able to download or view the file WHAT I WANT TO DO, BUT HAVE PROBLEM:- I would like to be able to read CONTENT of this file and load it in a string as belowStreamReader SR = new StreamReader()SR = File.Open("File.txt");String contentText = SR.Readline();txtBox.text = contentText;BUT THIS ONLY WORK FOR files in the server.I would like to be able to read FILE CONTENTS from SQL Server.PLEASE HELP. I really appreciate it.

View 1 Replies View Related

SQL 2012 :: Identify Whether Files Are In Read / Write Or Read Only

Mar 24, 2015

How to identify whether the files are in read write or read only?

View 1 Replies View Related

Recovery :: Switch (Standby / Read-Only) DB To Be Read And Write

Aug 26, 2015

I'm trying to do Sharepoint DR with Log Shipping and every thing configured except one thing which is switch the WSS_Content (Standby /Read-Only) DB to be ready and Write. 

I tried from

GUI or ALTER DATABASE [WSS_Content] SET
READ_WRITE WITH NO_WAIT

but I received the below error: 

Database WSS_Content is in Warm Standby 

View 9 Replies View Related

Reset Database Files From Read-only To Read-write

Jan 18, 2008

I have two database files, one .mdf and one .ndf. The creator of these files has marked them readonly. I want to "attach" these files to a new database, but cannot do so because they are read-only. I get this message:

Server: Msg 3415, Level 16, State 2, Line 1
Database 'TestSprintLD2' is read-only or has read-only files and must be made writable before it can be upgraded.

What command(s) are needed to make these files read_write?

thanks

View 7 Replies View Related

SQL 2012 :: Read Committed For Read Only Database?

Jun 27, 2014

i have a database which get refreshed every day from client's data . and we need to pull heavy data from them every day as reports . so only selects happens on that database.

we do daily population of some table in some other databases from this daily refreshed DB.

will read uncommitted or NOLOCK with select queries to retrieve data faster.

there will be no dirty read as there are NO DML operation in that database so for SELECT which happens concurrently on these tables , will NOLOCK work?

View 2 Replies View Related

SQL 2012 :: Change Read-only And Read-write

Aug 15, 2014

Can a user of db owner role of a database change the databse option to read only and read-write?If not what permission I need to grant to the user?

View 1 Replies View Related

Set READ UNCOMMITTED (dirty Read) At Login.

Jul 23, 2005

Is it possible to set READ UNCOMMITTED to a user connecting to an SQL2000 server instance? I understand this can be done via a front endapplication. But what I am looking to do is to assign this to aspecific user when they login to the server via any entry application.Can this be set with a trigger?

View 1 Replies View Related

How Read CSV File In Other Server Using Bulk Insert Command In Sql Server In Different Server...

Mar 24, 2008

Hi All,
 Please some one help me...
I have to insert a csv into one table in sql server. But the problem is the file is in one server and SQL SERVER 2005 is in other server..
 how do i insert the file....
please help me.....
 

View 1 Replies View Related

Come On SQLdatareader....read....read....read...ok Help.

Mar 12, 2004

OK, I'm using VS2003 and I'm having trouble. The page works perfectly when I created it with WebMatrix but I want to learn more about creating code behind pages and this page doesn't work. I think it has some things to do with Query builder but I can't seem to get change outside "please register". I have the table populated and it is not coming back with "login successful" or "password wrong" when I've entered correct information. Enclosed is what I've done in VS2003. Can you see where my error is? Any help would be greatly appreciated.
Thanks again.

Imports System.data.sqlclient
Imports System.Data
Public Class login2
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection
Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "server=LAWORKSTATION;user id=sa;database=test;password=t3st"
'
'SqlCommand1
'
Me.SqlCommand1.CommandText = "SELECT pass FROM Customer WHERE (email = 'txtusername.text')"
Me.SqlCommand1.Connection = Me.SqlConnection1

End Sub
Protected WithEvents lblUsername As System.Web.UI.WebControls.Label
Protected WithEvents lblPassword As System.Web.UI.WebControls.Label
Protected WithEvents txtUsername As System.Web.UI.WebControls.TextBox
Protected WithEvents txtPassword As System.Web.UI.WebControls.TextBox
Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button
Protected WithEvents lblMessage As System.Web.UI.WebControls.Label
Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection
Protected WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
SqlConnection1.Open()
Dim dr As SqlDataReader = SqlCommand1.ExecuteReader
If dr.Read() Then
If dr("password").ToString = txtPassword.Text Then
lblMessage.Text = "login successful"
Else
lblMessage.Text = "Wrong password"
End If
Else
lblMessage.Text = "Please register"
End If
dr.Close()
SqlConnection1.Close()
End Sub
End Class

View 8 Replies View Related

Can Distributed Query Read Sql Server 2000 From Sql Server 2005?

Nov 29, 2007

if it is possible to run a distributed query against 2000 from 2005, what would the OPENDATASOURCE parameters look like? I'd like to be able to pivot without copying my older 2000 db to 2005 or using linked servers..

For reference, here's an example of a distrib query that reads excel...

ie SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C: estxltest.xls;Extended Properties=Excel 8.0')...[Customers$]

View 1 Replies View Related

Read Images From SQL Server

Sep 16, 2005

Hi Guru's,I want to show images in my webforms, but whitout any succes....... , hope some can tell me why as base I've used exactly the same script as defined in the article http://www.dotnetbips.com/displayarticle.aspx?id=101 Maybe its because some of the HTML is incorrect ?<itemtemplate>   <asp:image id="img" runat= server></asp:image></itemtemplate>Please , a need some assitance hereregardsS

View 1 Replies View Related

Read Cvs In C# And Insert Into Sql Server

Jun 5, 2006

Hi, Anybody has an  example of reading a csv comma delimited file and insert the fields into a datatable?Thanks

View 2 Replies View Related

Server Role For Read-only

Jun 23, 2005

Hi:

I have a couple enter prise SQL 2000 servers, each might contain around 800 customer databases. each of those 800 databases has its own sql standard login and password and corresponding permission on table select/update/delete and proc exec rights.

I want to create a sever level single login and password, which could read-only those 800 databases all tables only data. Those 800 databases are not always the same, some might be dropped out, new might be added.

If this is impossible, what might be the alternative?

thanks
-D :)

View 2 Replies View Related

Sql Server Read Transaction Log

Dec 1, 2004

Hi,

I wanted to read the transaction log...is there a way??? I want to know the command executed from the transaction logs.

DBCC TRACEON (3604)

select * from ::fn_dblog(1,null)

DBCC LOG (test,-1)

Anything else apart from these??

Regards,
Asha

View 1 Replies View Related

Read Only Table In SQL Server?

Apr 7, 2004

Is it possible to make a table (or set of tables) within a SQL Server database read only (still granting the db_datawriter fixed database role to database users) without dropping and recreating the db_datawriter database role?

View 1 Replies View Related

Read Image From Sql Server

Aug 6, 2007

Hello!

My real problem is that i want to read an image from an Sql Server DB, resize them and send them, all this through a Web Service. I decide to split my problem in four steps:

1 - read image from Database
2 - Resize that image
3 - Send her back to the DB
4 - Send the image throw a web service after he use a dataset to read the data from the DB.

i try to read the database with this function




Code Snippet
public System.Drawing.Image ReadImgFromDB(Int64 imageID)
{
System.Drawing.Image image = null;
using (SqlConnection conn = new SqlConnection())
{
string connString = WebConfigurationManager.ConnectionStrings
["StringCC"].ConnectionString;
conn.ConnectionString = connString;
SqlCommand myCommand = new SqlCommand(
"SELECT Pic FROM Images WHERE ID='"+ imageID +"'", conn);
conn.Open();

byte[] imageData = (byte[])myCommand.ExecuteScalar();
System.IO.MemoryStream memStream = new System.IO.MemoryStream(imageData);
image = System.Drawing.Image.FromStream(memStream);
}
return image;
}





i introduce a valid image ID and i get this message

--- " System.ArgumentException: Parameter is not valid.
at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
at System.Drawing.Image.FromStream(Stream stream)
at Service.ReadImgFromDB(Int64 chaveI) in e:Web ProjectsWSserviceApp_CodeService.cs:line 48"-----


line 48: "image = System.Drawing.Image.FromStream(memStream);"


Thank you!





View 3 Replies View Related

Read Only ODBC To SQL SERVER 2005

Jul 11, 2007

I have a Login that I setup in SQL Server 2005.  The only database roles given to the login are db_datareader and public.  On SQL 2000 these permissions are sufficient to allow me to setup a read only ODBC connection using this login and creating an import table in Access.  When using the login in SQL 2005 and creating an import table, I am able to edit the underlying data, something I am not able to do with a  SQL 2000 ODBC connection.  Is there something in SQL 2005 that I am unaware of that would allow this login to modify (update) the table? 

View 6 Replies View Related

Read Image Data From SQL Server

Sep 19, 2007

Here is my task  I am storing pdf's in sql server. I would like to retrieve the binary data from sql server and write the pdf content into an existing aspx page to the appropriate pageview section.  What is the best way to handle this.  The code works below but it loads a new browser with the content.  I need it to appear in it's tabbed section in the original aspx file.  Any assistance you can give me would be greatly appreciated.
 Thanks Jerry
oSQLConn.Open()Dim myreader As SqlDataReader
myreader = myCommand.ExecuteReader
Response.Expires = 0
Response.Buffer = True
Response.Clear()
Do While (myreader.Read())
Response.ContentType = ("application/pdf")Response.BinaryWrite(myreader.Item("img_content"))
Loop

View 5 Replies View Related

Access For Users To SQL Server Read Only

Jan 29, 2001

I have SQL Server 7 database & I need to create some interface between users & database to let users see what is in the database, but not let them change or destroy data. Do I need to create some other database in-between users & the original database? Users can't program & want access to all data.management doesn't want to create a replication of the database. They want to let users have access through MS Word or Access. What could you advise me?

View 1 Replies View Related

How To Read Server Error Log Files From Another M/c??

Mar 28, 2000

I have a few servers registered in my Enterprise Manager which I am managing. Can I see the server error log files for these servers?

Any help is greatly appreciated.

View 2 Replies View Related

[SQL Server 2000]Read The Logs .ldf

Aug 1, 2006

Hi,
I have an issue with an application, and i want to know what sql queries are done by this application. So i need to read the .ldf file, i have do some search on google, but i find nothing thant can be relevant.

View 3 Replies View Related

Read Only Access To All Databases On A Server

Jan 18, 2008

Hi,
How can I provide a user read only access to all the databases on the server. I have 15 databases on the server. I know I can give db_datareader access in each database individually but that is time consuming and I have 10 servers for this to be done.

thanks in advance.

View 3 Replies View Related

Read UNIX File From SQL Server

Feb 6, 2004

Is it possibel to run a DTS job to read a file from unix server?

View 4 Replies View Related

How To Read Traansaction Log Files In Sql Server

Mar 27, 2008

hi ,

how to read the transation log files in sql server 2005, any body can help me........

Nageswar.V

View 1 Replies View Related

Read Logs In Sql Server 20005

Jan 14, 2008



I was wondering how can I read log file in a sql sever 2k5 database??
I mean, I want to check out every query since the selects until those that change server configuration, How can I do it without needing install a third-party software??
Keep in mynd that I need to know: the query (e.g.elect * from table_name) , source , date , application.

Best Regards

Joseph

View 4 Replies View Related

How To Open Or Read SQL Server Log File .ldf

Mar 26, 2008



Hi all,
How to Open Or read SQL Server log file .ldf

When ever we create database from sql server, it's create two file. (1) .mdf (2) .ldf.
I want to see what's available inside the .ldf file.



Thanks,
Ashok

View 6 Replies View Related

MDF File Cannot Be Read By SQL Server 2005

Feb 10, 2006

Newbee question: I am trying to use some of the "101" samples in VS 2005 with SQL Server 2005. These samples use SQL server express MDF files.

The error is: "... you cannont open a database that is incompatible with this version of sqlservr.ext. You must re-create the database."

Do I need to install SQL server express? What are the issues with installing express when I am already running SQL Server 2005?

How do I update or "re-create" the express MDF database file in SQL Server 2005?

Thanks!

View 3 Replies View Related

Read Binary Data From SQL Server

Oct 19, 2007

hello.
i have a _CommandPtr that has the type CommandTypeEnum::adCmdTex, and the CommandText a query("Select * from Table_1") and this select returns one row that has a binary data in it.




Code Block

_CommandPtr pCommand;
//Create the C++ ADO Command Object

pCommand.CreateInstance(__uuidof(Command));

pCommand->ActiveConnection = this->pConnection;

//Make the ADO C++ command object to accept stored procedure

pCommand->CommandType = CommandTypeEnum::adCmdText;

//Tell the name of the Stored Procedure to the command object

pCommand->CommandText = _bstr_t("select * from Table_1");

//get recordset
pRecordset = pCommand->Execute(NULL,NULL,CommandTypeEnum::adCmdText);

BYTE* buffer = NULL;
if(pRecordset != NULL)
{

while (!pRecordset->GetEndOfFile())
{

VARIANT var = pRecordset->Fields->GetItem("test")->Value;

void * pData = NULL;
SafeArrayAccessData(var.parray, &pData);
long size = GetArraySize(var, NULL);
buffer = new BYTE[size];
memcpy(buffer, pData, size);
SafeArrayUnaccessData(var.parray);
pRecordset->MoveNext();
}
pRecordset->Close();
}

where:



Code Block
long GetArraySize(const VARIANT& var, long * nElems)
{

if ( !(var.vt & VT_ARRAY) ) return -1;

long size = 0;
long dims = SafeArrayGetDim(var.parray);
long elemSize = SafeArrayGetElemsize(var.parray);
long elems = 1;
for ( long i=1; i <= dims; i++ )
{

long lbound, ubound;
SafeArrayGetLBound(var.parray, i, &lbound);
SafeArrayGetUBound(var.parray, i, &ubound);
elems *= (ubound - lbound + 1);
}
if ( nElems ) *nElems = elems;
size = elems*elemSize;
return size;
}






I enter in VARIANT var = pRecordset..... and if gives me a value... but when I put it in Memory explorer in VS, i only see this data " fe ee fe ee fe ee fe ee fe ee fe ee fe ee ...fe ee" and of course it brakes at
SafeArrayGetLBound(var.parray, i, &lbound);

Can someone tell me where I am doing a very bad thing?

P.S. I was able to read the binary data from the server using C#.NET 2.0.

View 1 Replies View Related

Litespeed, SQL Server Could Not Read The Registry Value:

Apr 9, 2008

I am getting this error after Litespeed installed:

Error Msg: SQL Server could not read the registry value: HKLMSoftwareImcedaSQLLitespeedexepath.
Check that the value exists, and that the SQL Server service account has full access to this keyºlue.
(11200)


Anyone gotta help here, thanks a lot.

View 5 Replies View Related

To Read Sql Server Data In Oracle

Jun 22, 2007

I have an ORACLE server say "A". I have a SQL Server named "B". In SQL Server I have a table named "test" who contains only one field named "aa" which is "BIT" type field. I want to query this table of "B" from "A" interface through Oracle's DB Link and ODBC dsn for Sql Server. But it gives error. If I changed the data type of field "aa" to "int", then it reads easily. Please suggest.

View 7 Replies View Related

Image Data Read From SQL Server Does Not Show Up

Mar 4, 2004

Hi Guys,

I've been strugling with this problem all morning today.

Basically I store images in SQL Server 2000 database and then whould like to show them with

<img src="viewImage.aspx?image_id=10" border=1>


My table structure is setup this way

TABLE [userImages] (
[imageFilename] [nvarchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[imageContentType] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[imageFileSize] [bigint] NULL ,
[imageFileImage] [image] NULL )


and in viewImage.aspx I have:

if (dr.Read())
{

Response.ContentType = dr.GetString(dr.GetOrdinal("imageContentType"));
Response.BinaryWrite( (byte[]) dr["imageFileImage"] );
}


I have no prolems retrieving the data from DB. But the image does not display(in IE it shows a broken link image)

What's even more puzzling is I CAN display the same image from HDD like so:

FileStream fs = File.OpenRead("D:\my_image.png");
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();

Response.ContentType = "application/octet-stream";
Response.BinaryWrite(buffer);


Am I missing something very obvious. I tried playing around with different ContentType's same result.

In my case I am forced to store images in the DB.

I've seen other examples on the net and theirs work. Please help.

Sincerely,
Vlad Orlovsky

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved