Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Thursday, March 22, 2012

Cluster File Share failed

I have a Windows 2000 Advanced Server with SQL Server 2000
Enterprise Edition with SP3A. The cluster is set up as a
Active/Active cluster.
What would cause the Cluster File Share resource to fail?
I have a file share directory set up so that if my server
fails over the file share directory 'shot_p' will be
recognized on the failover server.
Event Viewer Error:
Cluster File Share resource 'shot_p' has failed a status
check. The error code is 64.
Thanks,
Mike
Sounds like your network name resource failed...
C:\>net helpmsg 64
The specified network name is no longer available.
C:\>
Regards,
John
"Mike" <anonymous@.discussions.microsoft.com> wrote in message
news:21aef01c45afe$75b27840$a401280a@.phx.gbl...
> I have a Windows 2000 Advanced Server with SQL Server 2000
> Enterprise Edition with SP3A. The cluster is set up as a
> Active/Active cluster.
> What would cause the Cluster File Share resource to fail?
> I have a file share directory set up so that if my server
> fails over the file share directory 'shot_p' will be
> recognized on the failover server.
> Event Viewer Error:
> Cluster File Share resource 'shot_p' has failed a status
> check. The error code is 64.
> Thanks,
> Mike

Tuesday, March 20, 2012

Cluster Environment SQL Server setup and configure

What is the best way to setup and configure a clusterd
environment of SQL Server in terms of RAID, data file
location, log file location, backup etc. I guess in
separate drives for data and logfile.Great question. The bad answer is always "it depends."
You must be doing something like a SAN or DAS right? In very general terms,
split the data, logs, and temp db all out on different raid configs, i.e.,
LUNs. I like RAID 1+0 (or said RAID 10) because of the speed and high
tolerance of multiple disk failures at once, not to mention when you need
more disk space, adding new spindles is easy. If performance is more
important than money, then spread out over as many spindles as feasable.
You achieve more I/Os this way. This means, go for more disks of lower size
than few disks of higher size.
I believe on the SQL disk there is a VB6 application called database hammer
which you can use to test your config.
hth, Eric
"Aboki" <waco361@.hotmail.com> wrote in message
news:0afe01c36b38$2ab80730$a001280a@.phx.gbl...
> What is the best way to setup and configure a clusterd
> environment of SQL Server in terms of RAID, data file
> location, log file location, backup etc. I guess in
> separate drives for data and logfile.sqlsql

Monday, March 19, 2012

Clue - Who dun it? The Data Adapter, DataSet, SqlSelect etc...

Ok, I know my connection string and config file are good. Once the rest of the code is added I receive this error:

"SQL Server does not exist or access denied. "

I'm using the 1.1 framework and my hosting company provides MSSql 2005.

Thanks for your time,

Charlie

Here's the code in my cond behind file.

using System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Web;

using System.Web.SessionState;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

namespace blog

{

/// <summary>

/// Summary description for WebForm1.

/// </summary>

public class WebForm1 : System.Web.UI.Page

{

protected System.Data.SqlClient.SqlConnection sqlConnect;

protected System.Web.UI.WebControls.DataList dList;

protected System.Data.SqlClient.SqlDataAdapter DA;

protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;

protected System.Web.UI.WebControls.LinkButton linkAdmin;

protected System.Web.UI.WebControls.Image header;

protected blog.DS ds1;

private void Page_Load(object sender, System.EventArgs e)

{

DA.Fill(ds1, "blogEntry");

dList.DataBind();

}

#region Web Form Designer generated code

override protected void OnInit(EventArgs e)

{

//

// CODEGEN: This call is required by the ASP.NET Web Form Designer.

//

InitializeComponent();

base.OnInit(e);

}

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.sqlConnect = new System.Data.SqlClient.SqlConnection();

this.DA = new System.Data.SqlClient.SqlDataAdapter();

this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

this.ds1 = new blog.DS();

((System.ComponentModel.ISupportInitialize)(this.ds1)).BeginInit();

this.linkAdmin.Click += new System.EventHandler(this.linkAdmin_Click);

//

// sqlConnection String

//////////////////webserver////////////////

this.sqlConnection1.ConnectionString = "Server=xxx.xxx.xxx.x;Database=myDataBase;User ID=myID;Password=myPass";

//////////////////local///////////////////

//this.sqlConnect.ConnectionString = "workstation id=HAL;packet size=4096;integrated security=SSPI;data source=HAL;pers" +

//"ist security info=False;initial catalog=blog";

//

// DA

//

this.DA.SelectCommand = this.sqlSelectCommand1;

this.DA.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {

new System.Data.Common.DataTableMapping("Table", "blogEntry", new System.Data.Common.DataColumnMapping[] {

new System.Data.Common.DataColumnMapping("bodyID", "bodyID"),

new System.Data.Common.DataColumnMapping("linkID", "linkID")})});

//

// sqlSelectCommand1

//

this.sqlSelectCommand1.CommandText = "SELECT id, wxID, dateID, titleID, bodyID, linkID FROM blogEntry ORDER BY id DESC";

this.sqlSelectCommand1.Connection = this.sqlConnect;

//

// ds1

//

this.ds1.DataSetName = "DS";

this.ds1.Locale = new System.Globalization.CultureInfo("en-US");

this.Load += new System.EventHandler(this.Page_Load);

((System.ComponentModel.ISupportInitialize)(this.ds1)).EndInit();

}

#endregion

private void linkAdmin_Click(object sender, System.EventArgs e)

{

Server.Transfer("logOn.aspx",true);

}

}

}

fatthippo:

Ok, I know my connection string and config file are good. Once the rest of the code is added I receive this error:

"SQL Server does not exist or access denied. "

If you are receiving that error, it generally means that your connection string is NOT good. Check out this KB article:Potential causes of the "SQL Server does not exist or access denied" error message.

|||

That string was pasted in from another page on the same host. It works fine there. Why should I not assume that it's good?

|||

Hello,

Something I just noticed in the stack trace.

 
 blog.WebForm1.Page_Load(Object sender, EventArgs e)in c:\inetpub\wwwroot\blog\index.aspx.cs:31

 this is still referencing my local machine. How can I change this?
  

|||

Hi,

From your code, I can see your connection string is:

Server=xxx.xxx.xxx.x;Database=myDataBase;User ID=myID;Password=myPass

Please check if your server address is correct. Is the SQL server you're connecting to a default instance or a named instance. If a named instance, please try to use Server=xxx.xxx.xxx.xxx\InstanceName

also, please check the login name and password. You can try to create a .udl file for testing. Here are the steps:

1. Create a Text file.
2. Rename it to .udl
3. Double click on the file, and test in the Data Link Properties window.

HTH.

|||

I believe I found the issue. This being my first attempt to host a .net web app on a ISP, it didn't occur to me that modifying the connection string in the provided online text editor wouldn't be sufficient. Simply put, I needed to recompile my app.

Thank-you all for your support.

Fatthippo

CLR Trigger to write file.......

Hello, theres,

I have a request to write to a file whenever new record added to the table.

When records insert row by row, it goes well. but when more than 2 session insert at the same time, sometimes it duplicate some record in the file. I try to add synchonize code ( like lock , Monitor) but it doesn't work. any idea ?

Regards,

Agi

I assume you are using this to generate an Audit log or something similar. Here is the route I took.

http://sqljunkies.com/Article/4CD01686-5178-490C-A90A-5AEEF5E35915.scuk

|||

Jonathan,

Thanks for your reply, I just want to write everything to the flat file whenever new record inserted to my table. I write a trigger using c#. I just wonder if more than 2 threads (sessions) insert new record at the same time, what will be write to the flat file ?

Regards,

Agi

|||Hi,
I think the “CLR Triggers for SQL Server 2005” article on
http://aspalliance.com/1273_CLR_Triggers_for_SQL_Server_2005.all
may be helpful in this discussion.

This popular white paper is written by a software engineer from our organization Mindfire Solutions (http://www.mindfiresolutions.com).

I hope you find it useful!

Cheers,
Byapti

Sunday, March 11, 2012

CLR Stored procedure

Can I create a CLR stored procedure in VB or C# to print a file. Please give the code sample

All you would need to do it create a SQL Server project, add a stored procedure class, write your printing code inside there, and then deploy it to the database.

You probably shouldn't be doing this though. Any CLR stored procedures or functions should abide by the same principles as the database, which is to not rely on any resources which may not be there. Communicating with a printer is prone to this type of problem as the network may be down, or the printer may be off or out of paper etc. Therefore it shouldn't really be a stored procedure.

CLR SP and config file

Can a clr stored proc use a config file?Technically it works, but its not recommended or officially supported.
Reference:
d286" target="_blank">http://www.sqlskills.com/blogs/bobb...e55
d286
and
e81d" target="_blank">http://www.sqlskills.com/blogs/bobb...7d1
e81d
Cheers,
Bob Beauchemin
http://www.sqlskills.com/blogs/bobb
"Richard" <napa299@.yahoo.com> wrote in message
news:OLUWTkmlGHA.1552@.TK2MSFTNGP04.phx.gbl...
> Can a clr stored proc use a config file?
>

Thursday, March 8, 2012

ClR Function errror cant get to lcoal file system

My users complain that they cant run a CLR function. I am told that it cant get access to the local file system. I do not how to code these so from SSIS is there any way to let the users gain access to this. If this is a permission issue what is the lease privilege that I can configure for this to work?

Thanks
AdminAnupHow are they connecting to SQL Server ? If you are using SQL Server authenitcation, they will use the SQL Server account permissions to access the files, if this one does not have any permissions, they will get a Access denied. The same situation if you are using Windows authentication and the individual users do not have access to the files. Did you try to run the function individually ? Which error do you get there if you try to let it run at a user context (and not probably one with administrative priviledges :-) )

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||it is using sql authentication.

Can you let me know which permission does sql authentication need to execute

and also if i change it to be windows does it need any admin privileges|||If you are using SQL Server Authentication, the SQL Server service account SQL Server is running with, will need to have rights on the accessed files / shares. If you are using Windows authentication, the logged in User wil need to have those rights.

Jens K. Suessmeyer

http://www.sqlserver2005.de
|||Has the CLR assembly been granted EXTERNAL_ACCESS?|||Yes that was it as it was in Safe mode
Thanks

Wednesday, March 7, 2012

CLR access to File Info

"KurtK" <KurtK@.discussions.microsoft.com> wrote in message
news:D85635C4-9444-4CD4-8323-1903F8EA9B58@.microsoft.com...
> testFile = My.Computer.FileSystem.GetFileInfo(Filename)
VB My.* code is not supported under SQLCLR. If you used a VS Sql Server
Project you'll notice that you can't compile and deploy it from there as the
My feature is not supported for this project type:
http://msdn2.microsoft.com/en-us/library/ms172698.aspx
Changing your code to
testFile = new FileInfo(Filename)
should work
StevenSteven,
I tried replacing
testFile = My.Computer.FileSystem.GetFileInfo(Filename)
with
testFile = FileIO.FileSystem.GetFileInfo(Filename)
which seemed to be the only way to get to the GetFileInfo method. However I
still get the same exception.
This is my first venture into Visual Studio/.net since we still develop
under VB6 so I'm using the command line to compile my .vb code as was shown
in an example CLR integration sample I found.
Thanks,
Kurt
"Steven Hemingray [MSFT]" wrote:

> "KurtK" <KurtK@.discussions.microsoft.com> wrote in message
> news:D85635C4-9444-4CD4-8323-1903F8EA9B58@.microsoft.com...
> VB My.* code is not supported under SQLCLR. If you used a VS Sql Server
> Project you'll notice that you can't compile and deploy it from there as t
he
> My feature is not supported for this project type:
> http://msdn2.microsoft.com/en-us/library/ms172698.aspx
> Changing your code to
> testFile = new FileInfo(Filename)
> should work
> Steven
>
>|||I got it to work if I set the permission to UNSAFE. However since I'm only
accessing the FileInfo class it seems like EXTERNAL should be good enough.
What gives'
-Kurt
"Steven Hemingray [MSFT]" wrote:

> "KurtK" <KurtK@.discussions.microsoft.com> wrote in message
> news:D85635C4-9444-4CD4-8323-1903F8EA9B58@.microsoft.com...
> VB My.* code is not supported under SQLCLR. If you used a VS Sql Server
> Project you'll notice that you can't compile and deploy it from there as t
he
> My feature is not supported for this project type:
> http://msdn2.microsoft.com/en-us/library/ms172698.aspx
> Changing your code to
> testFile = new FileInfo(Filename)
> should work
> Steven
>
>|||My.Computer.FileSystem is very similar to FileIO.FileSystem so neither
approach works under SQLCLR.
However, I checked that using 'testFile = new System.IO.FileInfo(Filename)'
does work - is there a specific reason you need to use GetFileInfo?
Steven
"KurtK" <KurtK@.discussions.microsoft.com> wrote in message
news:A5EEEC2D-A66A-46DC-BCC2-70978AD47508@.microsoft.com...
> Steven,
> I tried replacing
> testFile = My.Computer.FileSystem.GetFileInfo(Filename)
> with
> testFile = FileIO.FileSystem.GetFileInfo(Filename)
> which seemed to be the only way to get to the GetFileInfo method. However
> I
> still get the same exception.
> This is my first venture into Visual Studio/.net since we still develop
> under VB6 so I'm using the command line to compile my .vb code as was
> shown
> in an example CLR integration sample I found.
> Thanks,
> Kurt
>
> "Steven Hemingray [MSFT]" wrote:
>|||Thanks. That works with permission set to EXTERNAL. And to answer your
question, I don't have to use GetFileInfo if there is another way to test fo
r
a file's existence.
Thanks for your help.
-Kurt
"Steven Hemingray [MSFT]" wrote:

> My.Computer.FileSystem is very similar to FileIO.FileSystem so neither
> approach works under SQLCLR.
> However, I checked that using 'testFile = new System.IO.FileInfo(Filename)
'
> does work - is there a specific reason you need to use GetFileInfo?
> Steven
> "KurtK" <KurtK@.discussions.microsoft.com> wrote in message
> news:A5EEEC2D-A66A-46DC-BCC2-70978AD47508@.microsoft.com...
>
>|||"examnotes" <KurtK@.discussions.microsoft.com> wrote in
news:16E92B69-081D-415E-B168-1F2494ED0D2C@.microsoft.com:

> , I don't have to use GetFileInfo if there is another way to test for
> a file's existence.
>
System.IO.File.Exists(path)
Niels
****************************************
**********
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb@.no-spam.develop.com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
****************************************
**********

closing SQL Connection

hello to all
i am finding my self in confusing problem.

everyay log file of my application increase by 10 GB.
every time i found more than 100 connections open in SDQL Server 2005 under my database.

i an using SQLHELPER Class by microsoft.i ma not putting my code in try-catch block. example

of one of my frequently used function is as follows:

protected Int64 GetMemberID()
{
String SqlSelect = "SELECT * FROM MemberMaster WHERE MemberUserName= '" +

Session["UserName"].ToString() + "'";
SqlDataReader dr1 =

SqlHelper.ExecuteReader(ConfigurationManager.ConnectionStrings["CowcallConnectionString2"].T

oString(), CommandType.Text, SqlSelect);
while (dr1.Read())
{
CurrentMemberID = Int64.Parse(dr1["MemberID"].ToString().Trim());
}
return CurrentMemberID;
}

well i doubt i am opening connection and do not closing it. moreover i do not know how to close connection in above code when i am using sql helper class.
please give me yours suggestion regarding my code even if it is not solving above two problems.

Hi munishbhatia,

use theCommandBehavior to close the connection after use like: SqlHelper.ExecuteReader(CommandBehavior.CloseConnection);

Close discussion

We have a sharepoint <\\ces\cesgypdav> that is a WebDAV connection, not an actual fileshare. A SSRS Subscription fails on file write ... "Failure writing file <name here > : The network path was not found" ... to this path.

Can SQL Reporting write to a WebDAV sharepoint?

WebDAV issue is known, need to 'work around'.

This helps: http://sqljunkies.com/WebLog/tpagel/archive/2005/12/23/17682.aspx

Saturday, February 25, 2012

Close connection of SQLExpress!

Hi,

I write a .NET Windows Form that connect to SQLExpress datafile. After updating data, I want to zip the .mdf file and send email. However, I got an exeption that the .mdf file is used by other thread so I cant zip. Even I try to close all connection, I still cant zip.

Is there any way to detach/unlock .mdf file connecting by SQLExpress?

MA.

Hi,

if you are sure you closed down all conenctions, you can use the sp_detach command to detach the database. if you want to close all connection from the server side first you will have to use the ALTER DATABASE command first and change the state of the database to a SINGLe or admin mode.


HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Hi,

Unfortunaterly, I dont control the connection but I want to force to close all connection from the client side (using C# code).

MA.

|||

Hi MA,

Jens is exactly correct, you'll need to force the database into single user mode:

ALTER DATABASE pubs
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE

This will rollback all transactions and then you can detach the database as you like. I'm not sure what you mean you don't control the connections. If you can not connect to the database, then you can not close it's connections and you will not be able to close the connections.

Mike

Close all open connections

Before I can drop an mdf file form the server, all connections needs to be closed. how can I force to close this connection. The solution explained on this blog don't seems to work in my case http://sqlserver2005.de/SQLServer2005/MyBlog/tabid/56/EntryID/9/Default.aspx

I'm using SQL express, with visual studio pro 2005.

Thx for you quick responses

best regards

Luc N

please verify the code I've used

Dim svr As Server

svr = Nothing

svr = New Server(".\SQLEXPRESS")

'attach database

Dim con As New SqlConnection(svr.ConnectionContext.ConnectionString)

Dim com As New SqlCommand("sp_detach_db", con)

Dim d As Database

con.Open()

For Each d In svr.Databases

If Not d.IsSystemObject Then

'com.CommandType = Data.CommandType.StoredProcedure

'com.Parameters.Add(New SqlParameter("@.dbname", d.Name))

'com.ExecuteNonQuery()

'MsgBox(d.UserName.ToString())

d.DatabaseOptions.UserAccess = DatabaseUserAccess.Restricted

SqlConnection.ClearAllPools()

d.Drop()

'com.CommandText = "DROP DATABASE " & d.Name.ToString

'com.CommandType = CommandType.Text

'com.ExecuteNonQuery()

'End If

End If

Next

com.Connection.Close()

Why do you think that the information form the blog is not working for you ?

Jens K. Suessmeyer

http://www.sqlserver2005.de
|||

I've still got the message 'cannot drop the database because.......................'

I've modified my code , which seems to be working,

please reply your comments on this code

thx Luc

Try

Dim svr As Server

svr = Nothing

svr = New Server(".\SQLEXPRESS")

'attach database

Dim con As New SqlConnection(svr.ConnectionContext.ConnectionString)

Dim d As Database

con.Open()

For Each d In svr.Databases

If Not d.IsSystemObject Then

Exit For

End If

Next

If InStr(d.Name, "exp", CompareMethod.Text) <> 0 Then

svr.KillAllProcesses(d.Name)

d.DatabaseOptions.UserAccess = DatabaseUserAccess.Restricted

SqlConnection.ClearAllPools()

d.Drop()

con.Close()

End If

Catch ex As Exception

' MsgBox(ex.Message)

End Try

|||As I pointed out in the comment, they fixed the behaviour in the Service Pack, so KillDatabase should work for you.

Sunday, February 19, 2012

Client side text handling

I have a text/excel file on client machines. user ( at client side) will be uploading it to Oracle database tables on the server using a client side procedure. I have Oracle client 8.0 loaded on the user/client machines. How can this be achieved. Need something like utl_file. (I am not using oracle Forms or reports so I cannot use text_io)Will SQL Loader not do it? If necessary, you could load into a temporary table and then process in PL/SQL.|||No , It will not serve the purpose as I have to modify & add some contents of the file after some validation. Only then I'll be attaching & sending the same through my client email.

Thursday, February 16, 2012

Client Network Utility

Guys,
Anybody knows how the client network utility can be configured PROGRAMATICALLY.
What I wanna do ultimately, is to run a batch file and set an alias for the client network utility.
Thanks,
Regards,Any possibilities thru OSQL? I haven't found anything yet.|||Double posting. :)|||I'm pretty sure that you can do it with a registry file... don't have SQL Server on my new laptop yet so I can't tell you what key, but it should be in HKEY_LOCAL_MACHINE somewhere

all you should have to do is set it up, do a search in the registry (using regedit) for the alias or whatever you added, export that key to a *.reg file, clean up the file a bit (to get rid of duplicate or extraneous keys) and import it on a test machine to check it out.

I use that method to add system ODBC data sources all the time, never done it with the Client Network Utility though... standard disclaimer however... if you mess up the registry it's your fault and don't forget to back it up before importing anything|||Hey thanx Drew. Interesting idea. I'll give it a try and let you know what happened.|||sure thing... I'll be in the office tomorrow and will post it up if I get to it before you, been meaning to do it for a long time to make client config as dummy proof as possible so I don't have to sit on the phone t-shooting stupid crap like that

Friday, February 10, 2012

cli for MSSQL server?

I need to put a series of records in two columns of an
Excel file into an MSSQL database on a server I am
connected to over a LAN. On my computer I am running SQL
Server service manager. I do not appear to have the
software to insert. I see there are a bunch of
executables in the MSSQL directory, but they do not appear
to accept SQL commands. Please Help!
UsarianWhat happens if you try to run DTSWiz.exe from Start -> Run
?
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Usarian" <usariankristine@.juno.com> wrote in message
news:0f2b01c3dfa7$9cf9b990$a101280a@.phx.gbl...
I need to put a series of records in two columns of an
Excel file into an MSSQL database on a server I am
connected to over a LAN. On my computer I am running SQL
Server service manager. I do not appear to have the
software to insert. I see there are a bunch of
executables in the MSSQL directory, but they do not appear
to accept SQL commands. Please Help!
Usarian|||File not found. It does not show in my searches on local
and networked drives either.
thank you for your prompt reply tho!
Usarian
quote:

>--Original Message--
>What happens if you try to run DTSWiz.exe from Start ->

Run
quote:

>?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>
>"Usarian" <usariankristine@.juno.com> wrote in message
>news:0f2b01c3dfa7$9cf9b990$a101280a@.phx.gbl...
>I need to put a series of records in two columns of an
>Excel file into an MSSQL database on a server I am
>connected to over a LAN. On my computer I am running SQL
>Server service manager. I do not appear to have the
>software to insert. I see there are a bunch of
>executables in the MSSQL directory, but they do not appear
>to accept SQL commands. Please Help!
>Usarian
>
>.
>
|||Then consider installing SQL Server client utilities on this machine.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:176101c3dfad$1e3e1ff0$a401280a@.phx.gbl...
File not found. It does not show in my searches on local
and networked drives either.
thank you for your prompt reply tho!
Usarian
quote:

>--Original Message--
>What happens if you try to run DTSWiz.exe from Start ->

Run
quote:

>?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>
>"Usarian" <usariankristine@.juno.com> wrote in message
>news:0f2b01c3dfa7$9cf9b990$a101280a@.phx.gbl...
>I need to put a series of records in two columns of an
>Excel file into an MSSQL database on a server I am
>connected to over a LAN. On my computer I am running SQL
>Server service manager. I do not appear to have the
>software to insert. I see there are a bunch of
>executables in the MSSQL directory, but they do not appear
>to accept SQL commands. Please Help!
>Usarian
>
>.
>

cli for MSSQL server?

I need to put a series of records in two columns of an
Excel file into an MSSQL database on a server I am
connected to over a LAN. On my computer I am running SQL
Server service manager. I do not appear to have the
software to insert. I see there are a bunch of
executables in the MSSQL directory, but they do not appear
to accept SQL commands. Please Help!
UsarianWhat happens if you try to run DTSWiz.exe from Start -> Run
?
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Usarian" <usariankristine@.juno.com> wrote in message
news:0f2b01c3dfa7$9cf9b990$a101280a@.phx.gbl...
I need to put a series of records in two columns of an
Excel file into an MSSQL database on a server I am
connected to over a LAN. On my computer I am running SQL
Server service manager. I do not appear to have the
software to insert. I see there are a bunch of
executables in the MSSQL directory, but they do not appear
to accept SQL commands. Please Help!
Usarian|||File not found. It does not show in my searches on local
and networked drives either.
thank you for your prompt reply tho!
Usarian
>--Original Message--
>What happens if you try to run DTSWiz.exe from Start ->
Run
>?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>
>"Usarian" <usariankristine@.juno.com> wrote in message
>news:0f2b01c3dfa7$9cf9b990$a101280a@.phx.gbl...
>I need to put a series of records in two columns of an
>Excel file into an MSSQL database on a server I am
>connected to over a LAN. On my computer I am running SQL
>Server service manager. I do not appear to have the
>software to insert. I see there are a bunch of
>executables in the MSSQL directory, but they do not appear
>to accept SQL commands. Please Help!
>Usarian
>
>.
>|||Then consider installing SQL Server client utilities on this machine.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
<anonymous@.discussions.microsoft.com> wrote in message
news:176101c3dfad$1e3e1ff0$a401280a@.phx.gbl...
File not found. It does not show in my searches on local
and networked drives either.
thank you for your prompt reply tho!
Usarian
>--Original Message--
>What happens if you try to run DTSWiz.exe from Start ->
Run
>?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>
>"Usarian" <usariankristine@.juno.com> wrote in message
>news:0f2b01c3dfa7$9cf9b990$a101280a@.phx.gbl...
>I need to put a series of records in two columns of an
>Excel file into an MSSQL database on a server I am
>connected to over a LAN. On my computer I am running SQL
>Server service manager. I do not appear to have the
>software to insert. I see there are a bunch of
>executables in the MSSQL directory, but they do not appear
>to accept SQL commands. Please Help!
>Usarian
>
>.
>

clever date to find most recent .bak file

Say I have 3 .bak files named:

jamesB.bak, jamesG.bak, jamesW.bak

Is there a clever way to find out which is the most recent of these
backup files?? Using sql query analyzer preferably...jamesd wrote:

Quote:

Originally Posted by

Say I have 3 .bak files named:
>
jamesB.bak, jamesG.bak, jamesW.bak
>
Is there a clever way to find out which is the most recent of these
backup files?? Using sql query analyzer preferably...


USE msdb;
GO
SELECT * FROM dbo.backupset;

SELECT * FROM dbo.backupfile;
SELECT * FROM dbo.backupfilegroup;
SELECT * FROM dbo.backupmediafamily;
SELECT * FROM dbo.backupmediaset;|||Hi Steve,
I don't think that will work, because I do not have the original msdb
database. I only have 3 .bak files (from another machine) and a virgin
database server (sql 2000).|||"jamesd" <jamesd@.ring4freedom.comwrote in message
news:1160592663.337156.238310@.k70g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Hi Steve,
I don't think that will work, because I do not have the original msdb
database. I only have 3 .bak files (from another machine) and a virgin
database server (sql 2000).
>


xp_cmdshell with DIR and then read it into a table.|||Please assume that all 3 files have the same ntfs modified date. I am
looking for a way to examine each .bak file to read its metadata and
see which one is most recent.

If I restore each .bak file is there a way to see the date of the
backup?

Greg D. Moore (Strider) wrote:

Quote:

Originally Posted by

"jamesd" <jamesd@.ring4freedom.comwrote in message
news:1160592663.337156.238310@.k70g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

Hi Steve,
I don't think that will work, because I do not have the original msdb
database. I only have 3 .bak files (from another machine) and a virgin
database server (sql 2000).


>
xp_cmdshell with DIR and then read it into a table.

Clearness needed in Sp_attach_db

Hi

With the sql server on line help , The syntax for the sp_attach_db has
the file name .It is aslo given that max of 16 files can be geven. I
attached a db with a single d.mdf .

could u pls tell what r the 16 file types or how a db can be attached
with 16 files.

With thanksYou can use CREATE DATABASE ... FOR ATTACH to attach a database of more
than 16 files. See the SQL 2000 Books Online
<tsqlref.chm::/ts_create_1up1.htm> for details.

BTW, sp_attach_db and sp_single_file_attach_db are basically just
wrappers for this command.

--
Hope this helps.

Dan Guzman
SQL Server MVP

--------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index...epartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
--------

"Raghuraman" <raghuraman_ace@.rediffmail.com> wrote in message
news:66c7bef8.0311160458.621723bc@.posting.google.c om...
> Hi
> With the sql server on line help , The syntax for the sp_attach_db has
> the file name .It is aslo given that max of 16 files can be geven. I
> attached a db with a single d.mdf .
> could u pls tell what r the 16 file types or how a db can be attached
> with 16 files.
>
> With thanks

Clear/Purge Log files

The MDF file is 800 MB but the LDF file is 5 GB. I run the "shrink database"
but this does not seems to reduce the mdf or ldf filesize.
What I did is detach the database, delete the ldf file, re-attach the
database to create a new ldf file. If I do not do so, the application cannot
work (hang!) because the ldf file is too huge and it takes ages to commit a
transaction. Is there a "better" way to control the ldf file like
auto-purging ? Should I restrict the log file size to a specific filesize
like 500MB ? Does this mean it will auto-purge each time it reach 500MB for
the ldf file ?
Thanks
The way you manage your log file is driven by your database recovery plan.
If your recovery plan is to restore from your last full backup and not apply
transaction log backups, then change your database recovery model to SIMPLE.
This will keep your log size reasonable by removing committed transactions
from the log. The log will still need to be large enough to accommodate
your largest single transaction. If you want to reduce potential data loss,
you should use the BULK_LOGGED or FULL recovery model and backup your log
periodically.
The proper way to shrink files is with DBCC SHRINKFILE. See the Books
Online for details. You should not need to do this as part of routine
maintenance.
Hope this helps.
Dan Guzman
SQL Server MVP
"Carlos" <wt_know@.hotmail.com> wrote in message
news:OueiitTPEHA.620@.TK2MSFTNGP10.phx.gbl...
> The MDF file is 800 MB but the LDF file is 5 GB. I run the "shrink
database"
> but this does not seems to reduce the mdf or ldf filesize.
> What I did is detach the database, delete the ldf file, re-attach the
> database to create a new ldf file. If I do not do so, the application
cannot
> work (hang!) because the ldf file is too huge and it takes ages to commit
a
> transaction. Is there a "better" way to control the ldf file like
> auto-purging ? Should I restrict the log file size to a specific filesize
> like 500MB ? Does this mean it will auto-purge each time it reach 500MB
for
> the ldf file ?
> Thanks
>
>
|||Hi,
Instead of detaching , delete the LDF file, Attach the database ytou should
have tried the below steps:-
Alter database <dbname> set single_user with rollback immediate
go
backup log <dbname> to disk='d:\backup\dbname.trn1'
go
dbcc shrinkfile('logical_log_name',truncateonly)
go
Alter database <dbname> set multi_user
After executing the above you can execute the below command check the log
file size and usage,
dbcc sqlperf(logspace)
Like Dan suggested go for SIMPLE recovery model if your data is not critical
or you not require a transaction log based recovery (POINT_IN_TIME).
Thanks
Hari
MCDBA
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:uTGdG0TPEHA.2256@.TK2MSFTNGP10.phx.gbl...
> The way you manage your log file is driven by your database recovery plan.
> If your recovery plan is to restore from your last full backup and not
apply
> transaction log backups, then change your database recovery model to
SIMPLE.
> This will keep your log size reasonable by removing committed transactions
> from the log. The log will still need to be large enough to accommodate
> your largest single transaction. If you want to reduce potential data
loss,[vbcol=seagreen]
> you should use the BULK_LOGGED or FULL recovery model and backup your log
> periodically.
> The proper way to shrink files is with DBCC SHRINKFILE. See the Books
> Online for details. You should not need to do this as part of routine
> maintenance.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Carlos" <wt_know@.hotmail.com> wrote in message
> news:OueiitTPEHA.620@.TK2MSFTNGP10.phx.gbl...
> database"
> cannot
commit[vbcol=seagreen]
> a
filesize
> for
>
|||Thanks for the advices ! :-)
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:%23MWo0lUPEHA.3328@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Instead of detaching , delete the LDF file, Attach the database ytou
should
> have tried the below steps:-
> Alter database <dbname> set single_user with rollback immediate
> go
> backup log <dbname> to disk='d:\backup\dbname.trn1'
> go
> dbcc shrinkfile('logical_log_name',truncateonly)
> go
> Alter database <dbname> set multi_user
> After executing the above you can execute the below command check the log
> file size and usage,
> dbcc sqlperf(logspace)
> Like Dan suggested go for SIMPLE recovery model if your data is not
critical[vbcol=seagreen]
> or you not require a transaction log based recovery (POINT_IN_TIME).
> Thanks
> Hari
> MCDBA
>
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:uTGdG0TPEHA.2256@.TK2MSFTNGP10.phx.gbl...
plan.[vbcol=seagreen]
> apply
> SIMPLE.
transactions[vbcol=seagreen]
> loss,
log[vbcol=seagreen]
> commit
> filesize
500MB
>