Friday, March 23, 2012
How to determine if SQl Server is installed
installed?
Looking in a specific folder on the C: drive would not be useful, since it
might be installed in a non-standard location. And scanning all available
hard disks is not very desirable.
The best solution would be if there's a registry key that gives me the
location.
Thanks,
PeterWhat type of application do you plan to use to do this? VB? Etc. Your best
bet would be to look for the SQL Service.
"jpstewart" <jpstewart@.discussions.microsoft.com> wrote in message
news:CC3DE372-56C7-45B8-932B-C6485C54F759@.microsoft.com...
> What would the best way be to programmatically determine if SQL Server is
> installed?
> Looking in a specific folder on the C: drive would not be useful, since it
> might be installed in a non-standard location. And scanning all available
> hard disks is not very desirable.
> The best solution would be if there's a registry key that gives me the
> location.
> Thanks,
> Peter
>|||> The best solution would be if there's a registry key that gives me the
> location.
What location are you referring to?
The reg key for a default instance is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer
And for named instances:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL Server
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"jpstewart" <jpstewart@.discussions.microsoft.com> wrote in message
news:CC3DE372-56C7-45B8-932B-C6485C54F759@.microsoft.com...
> What would the best way be to programmatically determine if SQL Server is
> installed?
> Looking in a specific folder on the C: drive would not be useful, since it
> might be installed in a non-standard location. And scanning all available
> hard disks is not very desirable.
> The best solution would be if there's a registry key that gives me the
> location.
> Thanks,
> Peter
>
Monday, March 19, 2012
How to detach System Databases...
partitioned and is big enough only to hold Operating system files. D:
and E: drives are what were supposed to be used by developers / dba's
to store / create SQL Server (system and user databases).
Well, some developers installed the entire SQL Server named instance
and their system and user defined databases on the C: drive. Is there
any way to move the system databases (master, msdb, distribution
etc.,) from the C: to the D: / E: drives?
Appreciate any feedback.
Thanks
Jagannathan SanthanamThe master, model, and tempdb databases cannot be detached/attached.
--
-- Anith
( Please reply to newsgroups only )|||Hi
Check out http://support.microsoft.com/defaul...kb;EN-US;304692
John
"Jagannathan Santhanam" <jags_32@.yahoo.com> wrote in message
news:605df08e.0310271102.e5deab7@.posting.google.co m...
> We have C:, D: and E: drives on our server box. C: drive is
> partitioned and is big enough only to hold Operating system files. D:
> and E: drives are what were supposed to be used by developers / dba's
> to store / create SQL Server (system and user databases).
> Well, some developers installed the entire SQL Server named instance
> and their system and user defined databases on the C: drive. Is there
> any way to move the system databases (master, msdb, distribution
> etc.,) from the C: to the D: / E: drives?
> Appreciate any feedback.
> Thanks
> Jagannathan Santhanam|||Hi
Check out http://support.microsoft.com/defaul...kb;EN-US;304692
John
"Jagannathan Santhanam" <jags_32@.yahoo.com> wrote in message
news:605df08e.0310271102.e5deab7@.posting.google.co m...
> We have C:, D: and E: drives on our server box. C: drive is
> partitioned and is big enough only to hold Operating system files. D:
> and E: drives are what were supposed to be used by developers / dba's
> to store / create SQL Server (system and user databases).
> Well, some developers installed the entire SQL Server named instance
> and their system and user defined databases on the C: drive. Is there
> any way to move the system databases (master, msdb, distribution
> etc.,) from the C: to the D: / E: drives?
> Appreciate any feedback.
> Thanks
> Jagannathan Santhanam
Wednesday, March 7, 2012
how to delete text file
how to delete text files from c drive (ex: c:\sale\300407.txt) using ms sql express edition 2005 ?
plz help me...
enable xp_cmdshell from start-- programs -- SQL Server 2005-- SQL Sserver surface Area Configuration tool -- Surface area confiugration for feature --
enable XP_Cmdshell
then run
exec xp_cmdshell 'del c:\yourfilename.txt'
Madhu
|||Be aware that if you are using Windows Authentication, the User who is accessing th e procedure will need the appropiate rights to delete the file. If you are using SQL Server authentication, it has to be the SQL Server Service account, if you don′t won′t either one, you will have to create a proxy account for the XP_CMDSHELL.Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||i'm using windows authentication. the command given still error. here the error :
c:\010407_S13103.txt
Access is denied
how about delete multiple text file from folder (exale) in drive c using ms sql express edition 2005. is using the same command?|||
its a permission problem. this user do not have permission in the folder. Jens's post already mention how to handle it. Basically, what xp_cmdshell used for is to run a shell command from SQL Platform. Delete multiple files use
xp_cmdshell del *.txt
Madhu
|||the user is admin. there should be no permission problem. but i still get the same error after i run the command above for multiple files. please be remind that i'm using ms sql express edition 2005.|||Are you using WIndows authentication for connecting to the database ?|||yes i'm using windows authentication|||Then you either have a proxy account configured which is not able to access the file, or the user you are currently using for the connection is not allowed, or the usage of the directory (if you using Vista) is required elevation.
|||i try this command in ms sql 2005 express edition but still get the same error. here the command :
declare @.del varchar(1000)
select @.del = 'del c:\Transfer\*.TXT'
exec xp_cmdshell @.del
here the error:
c:\Transfer\010407SALE.131.TXT
Access is denied
i'm using windows authentication and using admin account. so there should be no permission problem. i already enable xp_cmdshell in SQL Server Surface Area Configuration. why this error still occur? plz help me. i'm using ms windows xp.|||Is the folder encrypted ?
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||no