Thursday, March 29, 2012
Changing Connection String programmatically
(WS2005, Windows forms, C#)
I need to change the server name, or Initial Catalog parts of the string.
My connection strings are in a field of a master SQL database table.
The design of the different databases are the same.
How can I pass it to the _connection in the dataset?
_connection and InitConnection() are private.
I know, that I can edit the MyDbDataSet.Designer.cs, but I don't
belive, that it is good solution.
private void InitConnection() {
this._connection = new System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = "Data
Source=SQL\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security="
+
"True";
}
If the Data Source Confoguration Wizard saves the connection string,
the Settings.Designer.cs has also private properties I don't want edit.
Thanks - ZsoltSince if the SQL Server holding your connection strings is renamed or
changed, and you will not be able to get to the connection strings, that
seems like a bad idea.
Why not save the connection string(s) in the application.config file?
If you are storing connnection string information related to additional
servers, and you will use a confirmed static connection to retreive the
stored strings, just put them in a table. You may wish to have different
fields for server, database, security context, etc.. Create a stored
procedure that will provide you the concatenated string when you pass it a
parameter.
Arnie Rowland
"To be successful, your heart must accompany your knowledge."
"Zsolt" <Zsolt@.nowhere.nospam> wrote in message
news:1173DEA0-9696-4C12-8F58-ACA1926D85D8@.microsoft.com...
> How can I change the Connection String programmatically?
> (WS2005, Windows forms, C#)
> I need to change the server name, or Initial Catalog parts of the string.
> My connection strings are in a field of a master SQL database table.
> The design of the different databases are the same.
> How can I pass it to the _connection in the dataset?
> _connection and InitConnection() are private.
> I know, that I can edit the MyDbDataSet.Designer.cs, but I don't
> belive, that it is good solution.
> private void InitConnection() {
> this._connection = new System.Data.SqlClient.SqlConnection();
> this._connection.ConnectionString = "Data
> Source=SQL\\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated
> Security=" +
> "True";
> }
> If the Data Source Confoguration Wizard saves the connection string,
> the Settings.Designer.cs has also private properties I don't want edit.
> Thanks - Zsolt
>|||Thank you for your answer, Arnie!
The reason for using different databases of the same design is that
every year we will create new database. After creating the new years
database, we will register it in the master database, entering the
necessary connection data in a table. DataSet should use any years
database, but only one at a time.
My problem is that how can I pass it to the DataSet, because it is
private. Of course I can edit the MyDataSet.Designer.cs file,
change the body of the private void InitConnection(), and it works:
private void InitConnection() {
this._connection = new System.Data.SqlClient.SqlConnection();
// insted of:
// this._connection.ConnectionString = "Data Source=SQL\\SQLEXPRESS;Initial
Catalog=Data2006;Integrated Security=True";
// This:
this._connection.ConnectionString = MyConnStrinProvider.GetConnString();
}
But whenever I make some changes on .xsd, the changes above are lost.
Changing of an <auto-generated> file seems not good.
I think there must be better solution then this.
Thank you again,
Zsolt
"Arnie Rowland" wrote:
> Since if the SQL Server holding your connection strings is renamed or
> changed, and you will not be able to get to the connection strings, that
> seems like a bad idea.
> Why not save the connection string(s) in the application.config file?
> If you are storing connnection string information related to additional
> servers, and you will use a confirmed static connection to retreive the
> stored strings, just put them in a table. You may wish to have different
> fields for server, database, security context, etc.. Create a stored
> procedure that will provide you the concatenated string when you pass it a
> parameter.
> --
> Arnie Rowland
> "To be successful, your heart must accompany your knowledge."
>
> "Zsolt" <Zsolt@.nowhere.nospam> wrote in message
> news:1173DEA0-9696-4C12-8F58-ACA1926D85D8@.microsoft.com...
>
>|||This is a good situation for putting the connection string information in th
e app.config file. You will not have to recompile and redeploy the applicati
on each year, only the app.config file.
Add an Application.config file to the solution, and then add the appSettings
section. You can add as many 'keys' as you wish. They are just name=value p
airs that the application can retrieve.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="DATA Source=ServerName;initial catalog=My
Database;integrated security=True" />
</appSettings>
</configuration>
Then in the application use:
for VB: Dim con As SqlConnection = New SqlConnection(System.Configuration.Co
nfigurationSettings.AppSettings("ConnectionString"))
for C#: SqlConnection con = New SqlConnection(System.Configuration.Configura
tionSettings.AppSettings("ConnectionString"))
You may wish to check further in VS Help about using an app.config file.
--
Arnie Rowland
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"Zsolt" <Zsolt@.nowhere.nospam> wrote in message news:DD87AECE-A6FF-4C8B-ABA6-B5B80B89D9A6@.mi
crosoft.com...[vbcol=seagreen]
> Thank you for your answer, Arnie!
>
> The reason for using different databases of the same design is that
> every year we will create new database. After creating the new years
> database, we will register it in the master database, entering the
> necessary connection data in a table. DataSet should use any years
> database, but only one at a time.
>
> My problem is that how can I pass it to the DataSet, because it is
> private. Of course I can edit the MyDataSet.Designer.cs file,
> change the body of the private void InitConnection(), and it works:
>
> private void InitConnection() {
> this._connection = new System.Data.SqlClient.SqlConnection();
> // insted of:
> // this._connection.ConnectionString = "Data Source=SQL\\SQLEXPRESS;Initi
al
> Catalog=Data2006;Integrated Security=True";
> // This:
> this._connection.ConnectionString = MyConnStrinProvider.GetConnString()
;
> }
>
> But whenever I make some changes on .xsd, the changes above are lost.
> Changing of an <auto-generated> file seems not good.
>
> I think there must be better solution then this.
>
> Thank you again,
> Zsolt
>
>
> "Arnie Rowland" wrote:
>|||Connection strings of different years (databases) can be stored in app.confi
g
file (among other places). User can select one, using a ComboBox. Ok.
Using the selected connect string, SqlConnection and SqlCommand can be
constructed, OK!
But DataTableAdapter's System.Data.SqlClient.SqlDataAdapter _adapter member
is declared in MyDataset.Designer.cs as private, so I can't access it. That
is my original problem.
Of course, I can edit the MyDataset.Designer.cs file, it compiles and works
well,
but it is not a clear method, and not recommended at all.
Any changes in MyDataset.xsd file overwrites my editing (program is under
construction).
That's why I am looking for better and clearer solution.
Thank you again,
--
Zsolt
"Arnie Rowland" wrote:
[vbcol=seagreen]
> This is a good situation for putting the connection string information in
the app.config file. You will not have to recompile and redeploy the applica
tion each year, only the app.config file.
> Add an Application.config file to the solution, and then add the appSettin
gs section. You can add as many 'keys' as you wish. They are just name=value
pairs that the application can retrieve.
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <appSettings>
> <add key="ConnectionString" value="DATA Source=ServerName;initial ca
talog=MyDatabase;integrated security=True" />
> </appSettings>
> </configuration>
> Then in the application use:
> for VB: Dim con As SqlConnection = New SqlConnection(System.Configuration.
ConfigurationSettings.AppSettings("ConnectionString"))
> for C#: SqlConnection con = New SqlConnection(System.Configuration.Configu
rationSettings.AppSettings("ConnectionString"))
> You may wish to check further in VS Help about using an app.config file.
> --
> Arnie Rowland
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
>
> "Zsolt" <Zsolt@.nowhere.nospam> wrote in message news:DD87AECE-A6FF-4C8B-AB
A6-B5B80B89D9A6@.microsoft.com...
changing connection string from one sql server to another using vb .net
that is
soon to go into production. When I built each report, CR connected to sql
server on my development platform. The connection string is different than
it will be at my client.
How can I change the connection string so that it recognizes my client's
server instead of mine for each of these reports? This is not technically a
sql server question, but I am hoping some of the sql developers who review
these posts will have run into the same issue,
Thanks for any help.
Bernie YaegerConnection String data is generally stored in a centralized location...
1) config File
2) Registry
3) INI
4) Global.ASAX
hope this helps
Greg J
PDX, Oregon
changing connection string from one sql server to another using vb .net
that is
soon to go into production. When I built each report, CR connected to sql
server on my development platform. The connection string is different than
it will be at my client.
How can I change the connection string so that it recognizes my client's
server instead of mine for each of these reports? This is not technically a
sql server question, but I am hoping some of the sql developers who review
these posts will have run into the same issue,
Thanks for any help.
Bernie YaegerConnection String data is generally stored in a centralized location...
1) config File
2) Registry
3) INI
4) Global.ASAX
hope this helps
Greg J
PDX, Oregon
Changing computer name
SQL7&6.5 you need to run the set up
/ Hasselblad
"Thomas Mcintee" <anonymous@.discussions.microsoft.com> skrev i meddelandet
news:6DA36872-2875-45F8-B971-D909C694AD1D@.microsoft.com...
> how to change windows 2000 computer name with SQL 2000 Server on it|||Hi
To change the name of the server you can change it in My
Computer/Properties/Network Identification. Once this is done you can rename
SQL server see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_afterinstall_5r8f.asp
John
"Thomas Mcintee" <anonymous@.discussions.microsoft.com> wrote in message
news:6DA36872-2875-45F8-B971-D909C694AD1D@.microsoft.com...
> how to change windows 2000 computer name with SQL 2000 Server on it|||yes I know where to change it but when i change it SQL tells me it can't find my user name it shows oldname\tom not newname\tom even though it is in windows users and if i try to add it it tells me it doesn't exsist
-- John Bell wrote: --
Hi
To change the name of the server you can change it in My
Computer/Properties/Network Identification. Once this is done you can rename
SQL server see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_afterinstall_5r8f.asp
John
"Thomas Mcintee" <anonymous@.discussions.microsoft.com> wrote in message
news:6DA36872-2875-45F8-B971-D909C694AD1D@.microsoft.com...
> how to change windows 2000 computer name with SQL 2000 Server on it|||I should use, sp_droplogin on master & Sp_dropuser on Userdb and then
recreate them
//Hasselblad
"Thomas McIntee" <anonymous@.discussions.microsoft.com> skrev i meddelandet
news:003A7ECE-7CD7-490F-B6F6-B3DCEC65A4F3@.microsoft.com...
> yes I know where to change it but when i change it SQL tells me it can't
find my user name it shows oldname\tom not newname\tom even though it is in
windows users and if i try to add it it tells me it doesn't exsist
> -- John Bell wrote: --
> Hi
> To change the name of the server you can change it in My
> Computer/Properties/Network Identification. Once this is done you can
rename
> SQL server see
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_afterinstall_5r8f.asp
> John
> "Thomas Mcintee" <anonymous@.discussions.microsoft.com> wrote in
message
> news:6DA36872-2875-45F8-B971-D909C694AD1D@.microsoft.com...
> > how to change windows 2000 computer name with SQL 2000 Server on it
>
>sql
Sunday, March 25, 2012
Changing authentication mode in TSQL?
the authentication mode from 'Windows Authentication'
to 'Mixed Mode'?
Thanks in advance!You can use the undocumented xp_regwrite/xp_instance_regwrite to change the
registry key that contols this (which is what EM does anyway) or use SQLDMO
but it needs a SQL Service restart to take effect e.g.
exec master..xp_instance_regwrite N'HKEY_LOCAL_MACHINE',
N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer',
'LoginMode', N'REG_DWORD', 2
'Set security mode to mixed where oSQL is a SQLServer object
Set oSEC = oSQL.IntegratedSecurity
oSEC.SecurityMode = 2
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Bill Fee" <william.fee@.compuware.com> wrote in message
news:132701c37266$f9ad2310$a601280a@.phx.gbl...
Is there a TSQL statement that will allow you to change
the authentication mode from 'Windows Authentication'
to 'Mixed Mode'?
Thanks in advance!
Changing Authentication Mode
authentication' to 'mixed mode'? The SQL Server was installed using
windows authentication but I want to change it to 'mixed mode'.
Thanks
Egbon
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Hi Egbon
The easiest way is through Enterprise Manager. Right click on your server
and choose Properties.
On the Security Tab, in the section called Authentication, select "SQL
Server and Windows".
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Egbon V." <vnjowusi@.gosps.com> wrote in message
news:O$9FAVusDHA.1740@.TK2MSFTNGP12.phx.gbl...
> How can I change the authentication mode of SQl Server from 'windows
> authentication' to 'mixed mode'? The SQL Server was installed using
> windows authentication but I want to change it to 'mixed mode'.
> Thanks
> Egbon
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!|||Thanks a lot!
Egbon
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:em$W3gusDHA.2464@.TK2MSFTNGP12.phx.gbl...
> Hi Egbon
> The easiest way is through Enterprise Manager. Right click on your server
> and choose Properties.
> On the Security Tab, in the section called Authentication, select "SQL
> Server and Windows".
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Egbon V." <vnjowusi@.gosps.com> wrote in message
> news:O$9FAVusDHA.1740@.TK2MSFTNGP12.phx.gbl...
> > How can I change the authentication mode of SQl Server from 'windows
> > authentication' to 'mixed mode'? The SQL Server was installed using
> > windows authentication but I want to change it to 'mixed mode'.
> >
> > Thanks
> >
> > Egbon
> >
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it!
>
changing authentication error, Please HELP!
property to the mixed mode authentication (SQL Server and Windows
authentication mode) in SQL Server Management Studio. I loged in to the
server which is local in Managament Studio using windows authentication. When
I right click on the connection I get the following error:
-----
TITLE: Microsoft SQL Server Management Studio Express
--
Cannot show requested dialog.
--
ADDITIONAL INFORMATION:
Cannot show requested dialog. (Microsoft.SqlServer.Express.SqlMgmt)
--
Failed to retrieve data for this request.
(Microsoft.SqlServer.Express.SqlManagerUI)
For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
--
Failed to connect to server ILYA-TEST-PC\SQLEXPRESS.
(Microsoft.SqlServer.Express.ConnectionInfo)
--
A connection was successfully established with the server, but then an
error occurred during the login process. (provider: Shared Memory
Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft
SQL Server, Error: 233)
-----
All the protocols for SQLEXPRESS are enabled. I don't know what's going on.
I also checked the Surface Area Configuration and everything seems to be
turned on there. The log file contains the following.
-----
2006-03-30 16:38:11.98 Logon Error: 17809, Severity: 20, State: 1.
2006-03-30 16:38:11.98 Logon Could not connect because the maximum
number of '1' user connections has already been reached. The system
administrator can use sp_configure to increase the maximum value. The
connection has been closed. [CLIENT: <local machine>]
-----
But I can't increase the maximum value of connections because when I right
click on connection I get the same error mentioned above. What is going on
here? Do I need to reinstall SQL Express? I can't get rid of this stupid
error. Thank you.
Ilyause command line utility to connect to express and change the setting.
e.g.
sqlcmd -S".\Express" -Q"exec sp_configure 'user connections','32767';
reconfigure with override"
--
-oj
"Ilya" <Ilya@.discussions.microsoft.com> wrote in message
news:D58D1B38-F886-4285-90FB-F1CADFCE9B4A@.microsoft.com...
>I am running SQL Server 2005 Express. I am trying to change the server
> property to the mixed mode authentication (SQL Server and Windows
> authentication mode) in SQL Server Management Studio. I loged in to the
> server which is local in Managament Studio using windows authentication.
> When
> I right click on the connection I get the following error:
> -----
> TITLE: Microsoft SQL Server Management Studio Express
> --
> Cannot show requested dialog.
> --
> ADDITIONAL INFORMATION:
> Cannot show requested dialog. (Microsoft.SqlServer.Express.SqlMgmt)
> --
> Failed to retrieve data for this request.
> (Microsoft.SqlServer.Express.SqlManagerUI)
> For help, click:
> http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476
> --
> Failed to connect to server ILYA-TEST-PC\SQLEXPRESS.
> (Microsoft.SqlServer.Express.ConnectionInfo)
> --
> A connection was successfully established with the server, but then an
> error occurred during the login process. (provider: Shared Memory
> Provider, error: 0 - No process is on the other end of the pipe.)
> (Microsoft
> SQL Server, Error: 233)
> -----
> All the protocols for SQLEXPRESS are enabled. I don't know what's going
> on.
> I also checked the Surface Area Configuration and everything seems to be
> turned on there. The log file contains the following.
> -----
> 2006-03-30 16:38:11.98 Logon Error: 17809, Severity: 20, State: 1.
> 2006-03-30 16:38:11.98 Logon Could not connect because the maximum
> number of '1' user connections has already been reached. The system
> administrator can use sp_configure to increase the maximum value. The
> connection has been closed. [CLIENT: <local machine>]
> -----
> But I can't increase the maximum value of connections because when I right
> click on connection I get the same error mentioned above. What is going on
> here? Do I need to reinstall SQL Express? I can't get rid of this stupid
> error. Thank you.
> Ilya
>
Tuesday, March 20, 2012
Changes to table not reflected in report
I usa a SQL server for my windows application project. I have created a Crystal report, using .NET dataset connections. I made changes to one of the tables used in the report, and I updated the dataset. I then opened the report and used the "Verify database" feature, but the changes are not reflected. This worked before in the same report with changes to the same table. It seems like it does not work in any of my reports (using different datasets).
I have spent a good hour searching knowledge bases and forums, but found nothing. Anyone here that can help me? (I'm a bit pressed for time, close to deadline and all)
Thanks in advanceHave you checked EnableSaveDataWithReport and made sure its set off (either thru the menu option) or thru your code? Hope this helps|||Also Open the report and Do verify database|||Hi!
Thanks for the answers. The problem is solved for the moment. It seems that the "Verify database" functionality always works after I have run the applikation, a build is not enough. But If I start the app and then try to do the changes it seems to work....
So I consider it a bug that its not enough to changes and save the dependant DS... but as long as I get it to work I keep on. =)
Changes to SQL 2000 Server Properties Don't "Stick"
I have a new installation of SQL 2000 (via SBS 2003). When it was originally
setup, "Windows Only" security was configured. Using the "Server Properties
" dialog in Enterprise Manager, I tried changing it to "Windows and SQL", bu
t the changes don't "stick"
after clicking OK. I tried some other general changes (for example: min/max
memory) and none of the changes I make are stored after clicking OK.
Has anyone run across this before?
ThanksHi,
I have not encountered this sort of sitiuations before,
For changing the Memory and other parameters please try executing
SP_CONFIGURE procedure (Look books online for info).
For changing the Authentication mode you have to change the registry entry
& #91;HKEY_LOCAL_MACHINE\SOFTWARE\Microsof
t\Microsoft SQL
Server\HARISQL\MSSQLServer]
Change the value for "LoginMode" to 2 for SQL server and Windows , AFter
this restart SQL server sevice and verify the status.
Thanks
Hari
MCDBA
"FJOHN" <anonymous@.discussions.microsoft.com> wrote in message
news:A9887B4F-FFD3-4E7A-B465-210476166479@.microsoft.com...
> Hello,
> I have a new installation of SQL 2000 (via SBS 2003). When it was
originally setup, "Windows Only" security was configured. Using the "Server
Properties" dialog in Enterprise Manager, I tried changing it to "Windows
and SQL", but the changes don't "stick" after clicking OK. I tried some
other general changes (for example: min/max memory) and none of the changes
I make are stored after clicking OK.
> Has anyone run across this before?
> Thanks|||It sounds like the login that SQL Server is running under may NOT have
permissions to alter the registry keys for SQL Server...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"FJOHN" <anonymous@.discussions.microsoft.com> wrote in message
news:A9887B4F-FFD3-4E7A-B465-210476166479@.microsoft.com...
> Hello,
> I have a new installation of SQL 2000 (via SBS 2003). When it was
originally setup, "Windows Only" security was configured. Using the "Server
Properties" dialog in Enterprise Manager, I tried changing it to "Windows
and SQL", but the changes don't "stick" after clicking OK. I tried some
other general changes (for example: min/max memory) and none of the changes
I make are stored after clicking OK.
> Has anyone run across this before?
> Thankssql
Monday, March 19, 2012
Changes since last backup?
Is there any way of telling if a database or table has been updated,
altered or deleted from since the last backup was made in SQL server.
Windows does not correctly report .mdf file size changes until a
database is brought offline so it seems impossible to work on physical
file size changes as reported in windows.
Ive done some research in this group and people have talked about a
status bit which is set in sysfiles. This does not seem to work for
me. Are there any other suggestions?
Differential backups are ruled out due to working restrictions.
Any help or suggestions are greatly received.
Thanks
Bob"bobdirls" <bobdirls@.hotmail.com> wrote in message
news:157c1396.0312110458.72bbb518@.posting.google.c om...
> Hi,
> Is there any way of telling if a database or table has been updated,
I don't think so.
What exactly is your goal?
> altered or deleted from since the last backup was made in SQL server.
> Windows does not correctly report .mdf file size changes until a
> database is brought offline so it seems impossible to work on physical
> file size changes as reported in windows.
> Ive done some research in this group and people have talked about a
> status bit which is set in sysfiles. This does not seem to work for
> me. Are there any other suggestions?
> Differential backups are ruled out due to working restrictions.
> Any help or suggestions are greatly received.
> Thanks
> Bob|||Hi,
If you are talking about INSERT, UPDATE, or DELETE statements against a
table (that is modification of data) then you could use triggers to write
new records to an audit table whenever a record is added, modified, or
deleted.
If you are talking about changes to the structure of the table (ALTER TABLE)
then perhaps someone else could help.
Good luck
"bobdirls" <bobdirls@.hotmail.com> wrote in message
news:157c1396.0312110458.72bbb518@.posting.google.c om...
> Hi,
> Is there any way of telling if a database or table has been updated,
> altered or deleted from since the last backup was made in SQL server.
> Windows does not correctly report .mdf file size changes until a
> database is brought offline so it seems impossible to work on physical
> file size changes as reported in windows.
> Ive done some research in this group and people have talked about a
> status bit which is set in sysfiles. This does not seem to work for
> me. Are there any other suggestions?
> Differential backups are ruled out due to working restrictions.
> Any help or suggestions are greatly received.
> Thanks
> Bob|||Thanks for the replies.
I cant really use triggers as they only work at a table level. We have
about 40 databases each with at least 50 tables.
My goal is to replace the current back regime so its more efficient.
At the moment everything backs up every night. We have a few databases
that are over 40 GB, as they grow the length of time to do backups is
eating into daytime processing.
Basically I want to be able to interrogate windows or SQL server to
see if a database file has been altered since the last backup. If it
has been altered then run a backup job, if not then dont. There will
be times when all databases have been altered and will need backing
up, but it would be nice to only have databases being backed up that
have been altered.
Im trying to push to use differential backups at least during the week
but there is some opposition to that, is another solution possible?
Thanks again for the responses.
"Terri" <Terri@.spamaway.om> wrote in message news:<bracug$c6g$1@.reader2.nmix.net>...
> Hi,
> If you are talking about INSERT, UPDATE, or DELETE statements against a
> table (that is modification of data) then you could use triggers to write
> new records to an audit table whenever a record is added, modified, or
> deleted.
> If you are talking about changes to the structure of the table (ALTER TABLE)
> then perhaps someone else could help.
> Good luck
> "bobdirls" <bobdirls@.hotmail.com> wrote in message
> news:157c1396.0312110458.72bbb518@.posting.google.c om...
> > Hi,
> > Is there any way of telling if a database or table has been updated,
> > altered or deleted from since the last backup was made in SQL server.
> > Windows does not correctly report .mdf file size changes until a
> > database is brought offline so it seems impossible to work on physical
> > file size changes as reported in windows.
> > Ive done some research in this group and people have talked about a
> > status bit which is set in sysfiles. This does not seem to work for
> > me. Are there any other suggestions?
> > Differential backups are ruled out due to working restrictions.
> > Any help or suggestions are greatly received.
> > Thanks
> > Bob|||bobdirls@.hotmail.com (bobdirls) wrote in message news:<157c1396.0312120023.2ac46e2a@.posting.google.com>...
> Thanks for the replies.
> I cant really use triggers as they only work at a table level. We have
> about 40 databases each with at least 50 tables.
> My goal is to replace the current back regime so its more efficient.
> At the moment everything backs up every night. We have a few databases
> that are over 40 GB, as they grow the length of time to do backups is
> eating into daytime processing.
> Basically I want to be able to interrogate windows or SQL server to
> see if a database file has been altered since the last backup. If it
> has been altered then run a backup job, if not then dont. There will
> be times when all databases have been altered and will need backing
> up, but it would be nice to only have databases being backed up that
> have been altered.
> Im trying to push to use differential backups at least during the week
> but there is some opposition to that, is another solution possible?
> Thanks again for the responses.
<snip
There are a couple of things that aren't completely clear - at least
to me - from your post. First, why are your backups "eating into
daytime processing"? Backups can run while users are accessing the
database as usual, so unless you take the databases offline to back
them up (which is unnecessary) then this shouldn't be a major problem.
Unless perhaps you have some awkward I/O issues or OEM backup software
to work around.
If you really do need to speed up the backup, one possible approach is
to back up in parallel to several different disk files or tapes. This
should be much faster than backing up to one place, but of course you
then have to manage the increased number of backup files.
Second, it's not clear what the benefit is of only backing up a
database when it has been modified. The only real benefit I can think
of would be to save space on your backup media, but that would be at
the expense of increased backup management, and disk space is much
cheaper than DBA time. In any event, differential backups are designed
to do exactly that - why not let MSSQL do the work for you, instead of
trying to build your own solution?
If this isn't helpful, perhaps you could post some more information
about why your backups are currently affecting daytime processing;
what you hope to gain by only backing up changed databases; and why
your organization is reluctant to consider differential backups.
Simon|||Thanks for the replies.
I guess that means that there is no way of doing it then?
We need to save time on backups as we only have a short window
overnight to do the backups. Our shop is not the sole owner of the box
so we have to take other peoples needs into account.
I agree differential backups are probably the solution, but
unfortunately are not appropriate. Dont ask me why but they have been
ruled out totally for the time being.
Our databases are built during the month then once the data is
complete they are released to live. It would therefore be nice to only
backup databases when they differ from the current backup. This would
save time for doing the backups in the limited time we have. I was
looking for a way around this without using differential backups.
Basically there are a lot of both technical and business restraints on
what we use our box for. I havent been able to find a solution to my
original solution so I may have to recommend that changes are made in
the way the database is managed at a higher level.
Thanks for your help.
sql@.hayes.ch (Simon Hayes) wrote in message news:<60cd0137.0312120652.59a909e4@.posting.google.com>...
> bobdirls@.hotmail.com (bobdirls) wrote in message news:<157c1396.0312120023.2ac46e2a@.posting.google.com>...
> > Thanks for the replies.
> > I cant really use triggers as they only work at a table level. We have
> > about 40 databases each with at least 50 tables.
> > My goal is to replace the current back regime so its more efficient.
> > At the moment everything backs up every night. We have a few databases
> > that are over 40 GB, as they grow the length of time to do backups is
> > eating into daytime processing.
> > Basically I want to be able to interrogate windows or SQL server to
> > see if a database file has been altered since the last backup. If it
> > has been altered then run a backup job, if not then dont. There will
> > be times when all databases have been altered and will need backing
> > up, but it would be nice to only have databases being backed up that
> > have been altered.
> > Im trying to push to use differential backups at least during the week
> > but there is some opposition to that, is another solution possible?
> > Thanks again for the responses.
> <snip>
> There are a couple of things that aren't completely clear - at least
> to me - from your post. First, why are your backups "eating into
> daytime processing"? Backups can run while users are accessing the
> database as usual, so unless you take the databases offline to back
> them up (which is unnecessary) then this shouldn't be a major problem.
> Unless perhaps you have some awkward I/O issues or OEM backup software
> to work around.
> If you really do need to speed up the backup, one possible approach is
> to back up in parallel to several different disk files or tapes. This
> should be much faster than backing up to one place, but of course you
> then have to manage the increased number of backup files.
> Second, it's not clear what the benefit is of only backing up a
> database when it has been modified. The only real benefit I can think
> of would be to save space on your backup media, but that would be at
> the expense of increased backup management, and disk space is much
> cheaper than DBA time. In any event, differential backups are designed
> to do exactly that - why not let MSSQL do the work for you, instead of
> trying to build your own solution?
> If this isn't helpful, perhaps you could post some more information
> about why your backups are currently affecting daytime processing;
> what you hope to gain by only backing up changed databases; and why
> your organization is reluctant to consider differential backups.
> Simon|||"bobdirls" <bobdirls@.hotmail.com> wrote in message
news:157c1396.0312130128.5c4aa4db@.posting.google.c om...
> Thanks for the replies.
> I guess that means that there is no way of doing it then?
> We need to save time on backups as we only have a short window
> overnight to do the backups. Our shop is not the sole owner of the box
> so we have to take other peoples needs into account.
Again, as a previous poster said, I'm not clear on why you have a short
window. Normally backups do not interfere with normal operations.
> I agree differential backups are probably the solution, but
> unfortunately are not appropriate. Dont ask me why but they have been
> ruled out totally for the time being.
Strange, but I'll take your word for it.
> Our databases are built during the month then once the data is
> complete they are released to live. It would therefore be nice to only
> backup databases when they differ from the current backup. This would
> save time for doing the backups in the limited time we have. I was
> looking for a way around this without using differential backups.
> Basically there are a lot of both technical and business restraints on
> what we use our box for. I havent been able to find a solution to my
> original solution so I may have to recommend that changes are made in
> the way the database is managed at a higher level.
I think you will have to.
> Thanks for your help.
>
> sql@.hayes.ch (Simon Hayes) wrote in message
news:<60cd0137.0312120652.59a909e4@.posting.google.com>...
> > bobdirls@.hotmail.com (bobdirls) wrote in message
news:<157c1396.0312120023.2ac46e2a@.posting.google.com>...
> > > Thanks for the replies.
> > > > I cant really use triggers as they only work at a table level. We have
> > > about 40 databases each with at least 50 tables.
> > > My goal is to replace the current back regime so its more efficient.
> > > At the moment everything backs up every night. We have a few databases
> > > that are over 40 GB, as they grow the length of time to do backups is
> > > eating into daytime processing.
> > > > Basically I want to be able to interrogate windows or SQL server to
> > > see if a database file has been altered since the last backup. If it
> > > has been altered then run a backup job, if not then dont. There will
> > > be times when all databases have been altered and will need backing
> > > up, but it would be nice to only have databases being backed up that
> > > have been altered.
> > > > Im trying to push to use differential backups at least during the week
> > > but there is some opposition to that, is another solution possible?
> > > > Thanks again for the responses.
> > > <snip>
> > There are a couple of things that aren't completely clear - at least
> > to me - from your post. First, why are your backups "eating into
> > daytime processing"? Backups can run while users are accessing the
> > database as usual, so unless you take the databases offline to back
> > them up (which is unnecessary) then this shouldn't be a major problem.
> > Unless perhaps you have some awkward I/O issues or OEM backup software
> > to work around.
> > If you really do need to speed up the backup, one possible approach is
> > to back up in parallel to several different disk files or tapes. This
> > should be much faster than backing up to one place, but of course you
> > then have to manage the increased number of backup files.
> > Second, it's not clear what the benefit is of only backing up a
> > database when it has been modified. The only real benefit I can think
> > of would be to save space on your backup media, but that would be at
> > the expense of increased backup management, and disk space is much
> > cheaper than DBA time. In any event, differential backups are designed
> > to do exactly that - why not let MSSQL do the work for you, instead of
> > trying to build your own solution?
> > If this isn't helpful, perhaps you could post some more information
> > about why your backups are currently affecting daytime processing;
> > what you hope to gain by only backing up changed databases; and why
> > your organization is reluctant to consider differential backups.
> > Simon|||bobdirls (bobdirls@.hotmail.com) writes:
> We need to save time on backups as we only have a short window
> overnight to do the backups. Our shop is not the sole owner of the box
> so we have to take other peoples needs into account.
As others have pointed out, there is no compelling reason why the
backups cannot be taken while users are working in the datanase.
> I agree differential backups are probably the solution, but
> unfortunately are not appropriate. Dont ask me why but they have been
> ruled out totally for the time being.
Did you ever look at backing up only the transaction log? Assuming
that is, that you are running with your databases in Full or
Bulk_logged recovery mode. This is a more common method that
differential backups. By taking transaction log backups, you can
take full backups less frequently, if the update frequency to the
database is modest.
> Our databases are built during the month then once the data is
> complete they are released to live. It would therefore be nice to only
> backup databases when they differ from the current backup. This would
> save time for doing the backups in the limited time we have. I was
> looking for a way around this without using differential backups.
Well, you could use the undocumented command DBCC LOG() to examine
the transaction log to see if something have happened. Again, this
this requires you to run with at least bulk_logged recovery, or the
transaction log would automatically truncated. And in any case, the
output from DBCC LOG() is cryptic, and you would need to learn how
to interpret it. (I don't know.) And since you would be running with
full or bulk_logged recovery, you would at least need to truncate
the transaction log now and then, or you disk will fill up.
You would be better off with the 3rd party tool Lumigent Log Explorer
which knows how to read the log. But how you would programmatically
use this information, I don't have the faintest.
In essence: in order to save some work for the machine, you are
creating a whole lot of work for yourself. And in the end for the
machine too.
So open the books and learn about transaction log backups.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Changed Version of SQL Server
with SP3A in a Active\Active Cluster.
When I loaded Windows 2000 SP4 on the server it changed
SQL Server 2000 version to "Microsoft SQL Server 2000 -
8.00.194 (Intel X86)".
If the Active (Node A)\ Active (Node B) cluster was moved
from original location could this change the SQL Server
version number. (Move Node A to Node B)
What could cause the version number to change within SQL
Server 2000. If the version is wrong is there away to
determine the version by SQL Server file dates?
Please help me resolve this issue.
Thanks,
Mark
weird normally the best way is to type the query below in Query Analyzer
which is determined by the version of SQLServr.exe.
SELECT @.@.VERSION
http://support.microsoft.com/default...b;en-us;321185
Although ocasionally (as with build 819 from
http://support.microsoft.com/default...b;en-us;826161) the real
version is not reflected as SQLServr.exe is not updated. In this case check
the registry @. HKLM\SOFTWARE\Microsoft\MSSQLServer\Hotfixes\0819
regards,
Andy.
"Mark" <anonymous@.discussions.microsoft.com> wrote in message
news:024a01c48aea$87d32a80$a601280a@.phx.gbl...
>
> I have Windows 2000 Advanced Server with SQL Server 2000
> with SP3A in a Active\Active Cluster.
> When I loaded Windows 2000 SP4 on the server it changed
> SQL Server 2000 version to "Microsoft SQL Server 2000 -
> 8.00.194 (Intel X86)".
> If the Active (Node A)\ Active (Node B) cluster was moved
> from original location could this change the SQL Server
> version number. (Move Node A to Node B)
>
> What could cause the version number to change within SQL
> Server 2000. If the version is wrong is there away to
> determine the version by SQL Server file dates?
>
> Please help me resolve this issue.
> Thanks,
> Mark
Sunday, March 11, 2012
Changed Administrator Password
I have changed the Administrator password on my Windows 2003 SBS server, and
now each time I reboot the server, the SQL Server Service fails to start.
I have to change the password back to the previous one, manually start the
service, and then change the password back to what I want it to be.
Does anyone know how to get round this?
TIA
Gareth Sharp
Hi Gareth
If the SQL Services are running on a specified account then you will need to
change the password for the service account too.
In case the SQL Services are running on the Local System account then there
should be no problem in the service starting up.
Thanks
Amer M J
MCP
"Gareth Sharp" wrote:
> Hi There!
> I have changed the Administrator password on my Windows 2003 SBS server, and
> now each time I reboot the server, the SQL Server Service fails to start.
> I have to change the password back to the previous one, manually start the
> service, and then change the password back to what I want it to be.
> Does anyone know how to get round this?
> TIA
> Gareth Sharp
>
>
|||Hello,
Go to the Administrative Tools/Services and find the MSSQLSERVER service.
Click for it's properties and check if the user that starts the service is
Administrator. Change the password for the new password there.
Eduardo Sicouret
American Call Center
"Gareth Sharp" <gs@.paxsoft.co.uk> escribi en el mensaje
news:doghmm$deo$1$8300dec7@.news.demon.co.uk...
> Hi There!
> I have changed the Administrator password on my Windows 2003 SBS server,
> and
> now each time I reboot the server, the SQL Server Service fails to start.
> I have to change the password back to the previous one, manually start the
> service, and then change the password back to what I want it to be.
> Does anyone know how to get round this?
> TIA
> Gareth Sharp
>
|||Hi Eduardo
Thanks for the help - I have made the change, and shall check it next time
the server is rebooted.
Does it matter if it is set to Local System account or Administrator? Could
I avoid the problem in the future by changing the option to Local System
account?
Thanks In Advance
Gareth
"Eduardo Sicouret" <esicouret@.americancallcenter.com> wrote in message
news:OavZ218BGHA.1676@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> Hello,
> Go to the Administrative Tools/Services and find the MSSQLSERVER service.
> Click for it's properties and check if the user that starts the service is
> Administrator. Change the password for the new password there.
> Eduardo Sicouret
> American Call Center
> "Gareth Sharp" <gs@.paxsoft.co.uk> escribi en el mensaje
> news:doghmm$deo$1$8300dec7@.news.demon.co.uk...
start.[vbcol=seagreen]
the
>
Changed Administrator Password
I have changed the Administrator password on my Windows 2003 SBS server, and
now each time I reboot the server, the SQL Server Service fails to start.
I have to change the password back to the previous one, manually start the
service, and then change the password back to what I want it to be.
Does anyone know how to get round this?
TIA
Gareth SharpHi Gareth
If the SQL Services are running on a specified account then you will need to
change the password for the service account too.
In case the SQL Services are running on the Local System account then there
should be no problem in the service starting up.
Thanks
Amer M J
MCP
"Gareth Sharp" wrote:
> Hi There!
> I have changed the Administrator password on my Windows 2003 SBS server, and
> now each time I reboot the server, the SQL Server Service fails to start.
> I have to change the password back to the previous one, manually start the
> service, and then change the password back to what I want it to be.
> Does anyone know how to get round this?
> TIA
> Gareth Sharp
>
>|||Hello,
Go to the Administrative Tools/Services and find the MSSQLSERVER service.
Click for it's properties and check if the user that starts the service is
Administrator. Change the password for the new password there.
Eduardo Sicouret
American Call Center
"Gareth Sharp" <gs@.paxsoft.co.uk> escribió en el mensaje
news:doghmm$deo$1$8300dec7@.news.demon.co.uk...
> Hi There!
> I have changed the Administrator password on my Windows 2003 SBS server,
> and
> now each time I reboot the server, the SQL Server Service fails to start.
> I have to change the password back to the previous one, manually start the
> service, and then change the password back to what I want it to be.
> Does anyone know how to get round this?
> TIA
> Gareth Sharp
>|||Hi Eduardo
Thanks for the help - I have made the change, and shall check it next time
the server is rebooted.
Does it matter if it is set to Local System account or Administrator? Could
I avoid the problem in the future by changing the option to Local System
account?
Thanks In Advance
Gareth
"Eduardo Sicouret" <esicouret@.americancallcenter.com> wrote in message
news:OavZ218BGHA.1676@.TK2MSFTNGP09.phx.gbl...
> Hello,
> Go to the Administrative Tools/Services and find the MSSQLSERVER service.
> Click for it's properties and check if the user that starts the service is
> Administrator. Change the password for the new password there.
> Eduardo Sicouret
> American Call Center
> "Gareth Sharp" <gs@.paxsoft.co.uk> escribió en el mensaje
> news:doghmm$deo$1$8300dec7@.news.demon.co.uk...
> > Hi There!
> >
> > I have changed the Administrator password on my Windows 2003 SBS server,
> > and
> > now each time I reboot the server, the SQL Server Service fails to
start.
> >
> > I have to change the password back to the previous one, manually start
the
> > service, and then change the password back to what I want it to be.
> >
> > Does anyone know how to get round this?
> >
> > TIA
> >
> > Gareth Sharp
> >
> >
>
Changed Administrator Password
I have changed the Administrator password on my Windows 2003 SBS server, and
now each time I reboot the server, the SQL Server Service fails to start.
I have to change the password back to the previous one, manually start the
service, and then change the password back to what I want it to be.
Does anyone know how to get round this?
TIA
Gareth SharpHi Gareth
If the SQL Services are running on a specified account then you will need to
change the password for the service account too.
In case the SQL Services are running on the Local System account then there
should be no problem in the service starting up.
Thanks
Amer M J
MCP
"Gareth Sharp" wrote:
> Hi There!
> I have changed the Administrator password on my Windows 2003 SBS server, a
nd
> now each time I reboot the server, the SQL Server Service fails to start.
> I have to change the password back to the previous one, manually start the
> service, and then change the password back to what I want it to be.
> Does anyone know how to get round this?
> TIA
> Gareth Sharp
>
>|||Hello,
Go to the Administrative Tools/Services and find the MSSQLSERVER service.
Click for it's properties and check if the user that starts the service is
Administrator. Change the password for the new password there.
Eduardo Sicouret
American Call Center
"Gareth Sharp" <gs@.paxsoft.co.uk> escribi en el mensaje
news:doghmm$deo$1$8300dec7@.news.demon.co.uk...
> Hi There!
> I have changed the Administrator password on my Windows 2003 SBS server,
> and
> now each time I reboot the server, the SQL Server Service fails to start.
> I have to change the password back to the previous one, manually start the
> service, and then change the password back to what I want it to be.
> Does anyone know how to get round this?
> TIA
> Gareth Sharp
>|||Hi Eduardo
Thanks for the help - I have made the change, and shall check it next time
the server is rebooted.
Does it matter if it is set to Local System account or Administrator? Could
I avoid the problem in the future by changing the option to Local System
account?
Thanks In Advance
Gareth
"Eduardo Sicouret" <esicouret@.americancallcenter.com> wrote in message
news:OavZ218BGHA.1676@.TK2MSFTNGP09.phx.gbl...
> Hello,
> Go to the Administrative Tools/Services and find the MSSQLSERVER service.
> Click for it's properties and check if the user that starts the service is
> Administrator. Change the password for the new password there.
> Eduardo Sicouret
> American Call Center
> "Gareth Sharp" <gs@.paxsoft.co.uk> escribi en el mensaje
> news:doghmm$deo$1$8300dec7@.news.demon.co.uk...
start.[vbcol=seagreen]
the[vbcol=seagreen]
>
Change xp_cmdshell working directory?
xp_cmdshell seems to be using c:\windows\system32 as some sort of "working"
directory. When we excute commands that create temporary files (such as FTP
for example), they write their temporary files to c:\windows\system32. If
we're ftping a large file, this causes problems.
Can this be changed? When FTP.exe is run from a normal command window, it
seems to respect the TEMP/TMP environment variable settings. When run from
xp_cmdshell, it doesn't seem to respect those settings.
Does anyone have any ideas?
You need to set the TEMP/TMP environment variable settings for the user that
SQL Server runs as. SQL Server does not run as *your* account, typically,
so changing your environment variables does absolutely nothing for the SQL
Server process.
A
"Daniel Peterson" <pythas@.hotmail.com> wrote in message
news:B2531A19-F787-4365-9F5E-3B29AE3D7956@.microsoft.com...
> Hello,
> xp_cmdshell seems to be using c:\windows\system32 as some sort of
> "working"
> directory. When we excute commands that create temporary files (such as
> FTP
> for example), they write their temporary files to c:\windows\system32. If
> we're ftping a large file, this causes problems.
> Can this be changed? When FTP.exe is run from a normal command window, it
> seems to respect the TEMP/TMP environment variable settings. When run
> from
> xp_cmdshell, it doesn't seem to respect those settings.
> Does anyone have any ideas?
|||Hello,
The environment variables are set properly for the service account.
It looks like this FTP procedure is part of a defined job that's scheduled
to run a couple of times a week. That step that uses xp_cmdshell to call FTP
is set to run as "Self".
Any other ideas?
"Aaron Bertrand [SQL Server MVP]" wrote:
> You need to set the TEMP/TMP environment variable settings for the user that
> SQL Server runs as. SQL Server does not run as *your* account, typically,
> so changing your environment variables does absolutely nothing for the SQL
> Server process.
> A
>
> "Daniel Peterson" <pythas@.hotmail.com> wrote in message
> news:B2531A19-F787-4365-9F5E-3B29AE3D7956@.microsoft.com...
>
>
|||> It looks like this FTP procedure is part of a defined job that's scheduled
> to run a couple of times a week. That step that uses xp_cmdshell to call
> FTP
> is set to run as "Self".
> Any other ideas?
Oh, you didn't mention this was a scheduled job. What is the proxy/account
in use for the SQL Server Agent service (not SQL Server itself)? Who is the
owner of the job?
|||SQL Service Account is running as the same service account as the SQL Server
itself. If I login as that service account user, environment variables look
like they get set properly. Looks like the server isn't configured with a
proxy account.
Didn't realize it was a scheduled job either, our developers left that out
of the email they sent me, and I just noticed it when I was pawing through
the job definition more.
Looks like the owner of the job is sa.
"Aaron Bertrand [SQL Server MVP]" wrote:
> Oh, you didn't mention this was a scheduled job. What is the proxy/account
> in use for the SQL Server Agent service (not SQL Server itself)? Who is the
> owner of the job?
>
>
Change xp_cmdshell working directory?
xp_cmdshell seems to be using c:\windows\system32 as some sort of "working"
directory. When we excute commands that create temporary files (such as FTP
for example), they write their temporary files to c:\windows\system32. If
we're ftping a large file, this causes problems.
Can this be changed? When FTP.exe is run from a normal command window, it
seems to respect the TEMP/TMP environment variable settings. When run from
xp_cmdshell, it doesn't seem to respect those settings.
Does anyone have any ideas?You need to set the TEMP/TMP environment variable settings for the user that
SQL Server runs as. SQL Server does not run as *your* account, typically,
so changing your environment variables does absolutely nothing for the SQL
Server process.
A
"Daniel Peterson" <pythas@.hotmail.com> wrote in message
news:B2531A19-F787-4365-9F5E-3B29AE3D7956@.microsoft.com...
> Hello,
> xp_cmdshell seems to be using c:\windows\system32 as some sort of
> "working"
> directory. When we excute commands that create temporary files (such as
> FTP
> for example), they write their temporary files to c:\windows\system32. If
> we're ftping a large file, this causes problems.
> Can this be changed? When FTP.exe is run from a normal command window, it
> seems to respect the TEMP/TMP environment variable settings. When run
> from
> xp_cmdshell, it doesn't seem to respect those settings.
> Does anyone have any ideas?|||Hello,
The environment variables are set properly for the service account.
It looks like this FTP procedure is part of a defined job that's scheduled
to run a couple of times a week. That step that uses xp_cmdshell to call FTP
is set to run as "Self".
Any other ideas?
"Aaron Bertrand [SQL Server MVP]" wrote:
> You need to set the TEMP/TMP environment variable settings for the user that
> SQL Server runs as. SQL Server does not run as *your* account, typically,
> so changing your environment variables does absolutely nothing for the SQL
> Server process.
> A
>
> "Daniel Peterson" <pythas@.hotmail.com> wrote in message
> news:B2531A19-F787-4365-9F5E-3B29AE3D7956@.microsoft.com...
> > Hello,
> >
> > xp_cmdshell seems to be using c:\windows\system32 as some sort of
> > "working"
> > directory. When we excute commands that create temporary files (such as
> > FTP
> > for example), they write their temporary files to c:\windows\system32. If
> > we're ftping a large file, this causes problems.
> >
> > Can this be changed? When FTP.exe is run from a normal command window, it
> > seems to respect the TEMP/TMP environment variable settings. When run
> > from
> > xp_cmdshell, it doesn't seem to respect those settings.
> >
> > Does anyone have any ideas?
>
>|||> It looks like this FTP procedure is part of a defined job that's scheduled
> to run a couple of times a week. That step that uses xp_cmdshell to call
> FTP
> is set to run as "Self".
> Any other ideas?
Oh, you didn't mention this was a scheduled job. What is the proxy/account
in use for the SQL Server Agent service (not SQL Server itself)? Who is the
owner of the job?|||SQL Service Account is running as the same service account as the SQL Server
itself. If I login as that service account user, environment variables look
like they get set properly. Looks like the server isn't configured with a
proxy account.
Didn't realize it was a scheduled job either, our developers left that out
of the email they sent me, and I just noticed it when I was pawing through
the job definition more.
Looks like the owner of the job is sa.
"Aaron Bertrand [SQL Server MVP]" wrote:
> > It looks like this FTP procedure is part of a defined job that's scheduled
> > to run a couple of times a week. That step that uses xp_cmdshell to call
> > FTP
> > is set to run as "Self".
> >
> > Any other ideas?
> Oh, you didn't mention this was a scheduled job. What is the proxy/account
> in use for the SQL Server Agent service (not SQL Server itself)? Who is the
> owner of the job?
>
>|||You can verify the account and the environment variables by
executing a job with the same job owner to execute
xp_cmdshell 'SET' . Have the job step output to a file and
then check that file.
Check the system variables for the temporary directory as
well. Control Panel -> System. Select the Advanced tab - you
can check environment variables there. Not everything
related to a profile is loaded when the account is running a
service.
-Sue
On Fri, 16 Feb 2007 15:07:03 -0800, Daniel Peterson
<pythas@.hotmail.com> wrote:
>SQL Service Account is running as the same service account as the SQL Server
>itself. If I login as that service account user, environment variables look
>like they get set properly. Looks like the server isn't configured with a
>proxy account.
>Didn't realize it was a scheduled job either, our developers left that out
>of the email they sent me, and I just noticed it when I was pawing through
>the job definition more.
>Looks like the owner of the job is sa.
>"Aaron Bertrand [SQL Server MVP]" wrote:
>> > It looks like this FTP procedure is part of a defined job that's scheduled
>> > to run a couple of times a week. That step that uses xp_cmdshell to call
>> > FTP
>> > is set to run as "Self".
>> >
>> > Any other ideas?
>> Oh, you didn't mention this was a scheduled job. What is the proxy/account
>> in use for the SQL Server Agent service (not SQL Server itself)? Who is the
>> owner of the job?
>>
Change xp_cmdshell working directory?
xp_cmdshell seems to be using c:\windows\system32 as some sort of "working"
directory. When we excute commands that create temporary files (such as FTP
for example), they write their temporary files to c:\windows\system32. If
we're ftping a large file, this causes problems.
Can this be changed? When FTP.exe is run from a normal command window, it
seems to respect the TEMP/TMP environment variable settings. When run from
xp_cmdshell, it doesn't seem to respect those settings.
Does anyone have any ideas?You need to set the TEMP/TMP environment variable settings for the user that
SQL Server runs as. SQL Server does not run as *your* account, typically,
so changing your environment variables does absolutely nothing for the SQL
Server process.
A
"Daniel Peterson" <pythas@.hotmail.com> wrote in message
news:B2531A19-F787-4365-9F5E-3B29AE3D7956@.microsoft.com...
> Hello,
> xp_cmdshell seems to be using c:\windows\system32 as some sort of
> "working"
> directory. When we excute commands that create temporary files (such as
> FTP
> for example), they write their temporary files to c:\windows\system32. If
> we're ftping a large file, this causes problems.
> Can this be changed? When FTP.exe is run from a normal command window, it
> seems to respect the TEMP/TMP environment variable settings. When run
> from
> xp_cmdshell, it doesn't seem to respect those settings.
> Does anyone have any ideas?|||Hello,
The environment variables are set properly for the service account.
It looks like this FTP procedure is part of a defined job that's scheduled
to run a couple of times a week. That step that uses xp_cmdshell to call FT
P
is set to run as "Self".
Any other ideas?
"Aaron Bertrand [SQL Server MVP]" wrote:
> You need to set the TEMP/TMP environment variable settings for the user th
at
> SQL Server runs as. SQL Server does not run as *your* account, typically,
> so changing your environment variables does absolutely nothing for the SQL
> Server process.
> A
>
> "Daniel Peterson" <pythas@.hotmail.com> wrote in message
> news:B2531A19-F787-4365-9F5E-3B29AE3D7956@.microsoft.com...
>
>|||> It looks like this FTP procedure is part of a defined job that's scheduled
> to run a couple of times a week. That step that uses xp_cmdshell to call
> FTP
> is set to run as "Self".
> Any other ideas?
Oh, you didn't mention this was a scheduled job. What is the proxy/account
in use for the SQL Server Agent service (not SQL Server itself)? Who is the
owner of the job?|||SQL Service Account is running as the same service account as the SQL Server
itself. If I login as that service account user, environment variables look
like they get set properly. Looks like the server isn't configured with a
proxy account.
Didn't realize it was a scheduled job either, our developers left that out
of the email they sent me, and I just noticed it when I was pawing through
the job definition more.
Looks like the owner of the job is sa.
"Aaron Bertrand [SQL Server MVP]" wrote:
> Oh, you didn't mention this was a scheduled job. What is the proxy/accoun
t
> in use for the SQL Server Agent service (not SQL Server itself)? Who is t
he
> owner of the job?
>
>|||You can verify the account and the environment variables by
executing a job with the same job owner to execute
xp_cmdshell 'SET' . Have the job step output to a file and
then check that file.
Check the system variables for the temporary directory as
well. Control Panel -> System. Select the Advanced tab - you
can check environment variables there. Not everything
related to a profile is loaded when the account is running a
service.
-Sue
On Fri, 16 Feb 2007 15:07:03 -0800, Daniel Peterson
<pythas@.hotmail.com> wrote:
[vbcol=seagreen]
>SQL Service Account is running as the same service account as the SQL Serve
r
>itself. If I login as that service account user, environment variables loo
k
>like they get set properly. Looks like the server isn't configured with a
>proxy account.
>Didn't realize it was a scheduled job either, our developers left that out
>of the email they sent me, and I just noticed it when I was pawing through
>the job definition more.
>Looks like the owner of the job is sa.
>"Aaron Bertrand [SQL Server MVP]" wrote:
>
Change Windows Authentication to Mixed Mode
(Express)?
On May 24, 9:09 pm, "Middletree" <middlet...@.hottttttttmail.com>
wrote:
> How do I Change Windows Authentication to Mixed Mode on SQL Server 2005
> (Express)?
I don't know express
In SSMS , go to SERVER , Right Click Properties ,
-> Security-> Server Authentication Select SQL Server and Windows
authentication
OR
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft
\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
|||The first method worked. Thanks.
Change Windows Authentication to Mixed Mode
(Express)?On May 24, 9:09 pm, "Middletree" <middlet...@.hottttttttmail.com>
wrote:
> How do I Change Windows Authentication to Mixed Mode on SQL Server 2005
> (Express)?
I don't know express
In SSMS , go to SERVER , Right Click Properties ,
-> Security-> Server Authentication Select SQL Server and Windows
authentication
OR
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft
\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO|||The first method worked. Thanks.
Change Windows Authentication to Mixed Mode
(Express)?On May 24, 9:09 pm, "Middletree" <middlet...@.hottttttttmail.com>
wrote:
> How do I Change Windows Authentication to Mixed Mode on SQL Server 2005
> (Express)?
I don't know express
In SSMS , go to SERVER , Right Click Properties ,
-> Security-> Server Authentication Select SQL Server and Windows
authentication
OR
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft
\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO|||The first method worked. Thanks.