April 2004 - Posts

Analysis Server / BI

Duncan has a nice blog about BI / Analysis Services :

http://duncanlamb.blogspot.com/

Subscribed ...

Guest Post by Amit Jethva

Hi,

This is a guest post by me. Thanks to my friend Manuj (Enigma ) for allowing to do this. I am just having a look at the sqljunkies site and the blogging interface. I really liked it. and now i am keen to get a blog for myself.

 

Amit Jethva

Catching errors in stored procedures

Amit Jethva points out a method to catch the errors from a stored procedure and  log them into SQL server Error log .. rather than returning them to the front end application  ... and believe me this looks like a cool way to capture errors for small applications  ...

http://www.sqlservercentral.com/columnists/ajethva/capturingtheerrordescriptioninastoredprocedure.asp

I hope to see him blogging soon ...  “Subscribed” in advance ...

VisualBlogger 2004 Beta 1 is out !!!

Hey Guys ... the much awaited beta (at least by me)  of VisualBlogger 2004 Beta 1 is out . Thanks a lot , Robert McLaws ...

Read all about it here ...

Now , need to test it .... And a small feature request too ...

How about providing proxy authentication ???

Possible new SQL Server Virus ???

From :http://www.sswug.org/columnists/editorial.asp?id=371 

Something almost all people working with SQL Server need to be aware of

I think we need to be just a bit more careful ... this could be the calm before the storm ...

I need some answers ???

Ok !!! I ve been having quite a heated discussion about IIS and Apache Server usage with one of my friends .... Almost most of the web surveys show Apache as the clear leader in spite of what I know are its deficiencies ...

I need some solid arguments as to why this is so ... I hope many of you can help me out there  (I am seriously out of depth here ... as I am working with SQL Server as a DBA ) ... I invite the open source community to come out with their arguments  ...   

From what I think is that most websites (small businesses and personal coz they are low cost) are based on apache servers due to the cost effectiveness ... is that so  ?

Please venture forth with your ideas ... and also with reasons which webserver is better under which conditions ???

Working in dreams

Vinod Kumar takes a pic right out side the place I would love to work at ... and another.

But as I said ... It is only a dream ...

(Disclaimer : It is only a dream ... It is only a dream ... It is only a dream ... It is only a dream ... )

The Enigma moved ...

Well .. just moved over to our new office today ....

http://sqljunkies.com/WebLog/enigma/gallery/image/137.aspx

and yes .. that's bloglines on my laptop

Microsoft DevDays 2004

I 'll be there : - Microsoft DevDays 2004 . I will be attending the session at Mumbai.

Does anybody have any Idea as to who will be presenting ...

And hope to meet all you fellow bloggers from Mumbai out there ....

UPDATE : Am going home, so will not be attending ... after all ... home comes first ... then MS Parties 

 

Undocumented Procs - II

 

Had the following left up as a comment in one of my previous posts .... and thought I should post it here so that everyone can read it and benefit ...

Thanks to the Anonymous Guy who left this comment.


1. Encryption in SQL server

        There are some hidden functions in SQL server through which we can encrypt any string and store the same in the table. This will be very helpful in encrypting the user password and other sensitive user data. Encryption supported by SQL server is one way hash. One way hash is nothing but the string encrypted cannot be decrypted. The only way is to compare values with encrypted string.


DECLARE @ClearPIN varchar(255)
DECLARE @EncryptedPIN varbinary(255)
SELECT @ClearPIN = 'test'
SELECT @EncryptedPIN = CONVERT(varbinary(255), pwdencrypt(@ClearPIN))
SELECT pwdcompare(@ClearPIN, @EncryptedPIN, 0)


In the above example @EncryptedPIN  will store the cipher Text. The data in this string is not the encrypted string instead it will return the hash code of the supplied plain string.

2. Extended Stored Procedures

sp_MSgetversion
This extended stored procedure can be used to get the current version of Microsoft SQL Server. To get the current SQL Server version, run:

EXEC master..sp_MSgetversion

Note. A more common way to retrieve the current SQL Server version (this way provides more information) is to use following SELECT statement:

SELECT @@version

xp_dirtree
This extended stored procedure can be used to get a list of all the folders for the folder named in the xp. To get a list of all the folders in the C:\MSSQL7 folder, run:

EXEC master..xp_dirtree 'C:\MSSQL7'

xp_subdirs
This extended stored procedure is used to get the list of folders for the folder named in the xp. In comparison with xp_dirtree, xp_subdirs returns only those directories whose depth = 1.

This is the example:

EXEC master..xp_subdirs 'C:\MSSQL7'

xp_enum_oledb_providers
This extended stored procedure is used to list of all the available OLE DB providers. It returns Provider Name, Parse Name and Provider Description. To get a list of all OLE DB providers for your SQL Server, run:

EXEC master..xp_enum_oledb_providers

xp_enumcodepages
This extended stored procedure can be used to list of all code pages, character sets and their description for your SQL Server. To see this, list, run:

EXEC master..xp_enumcodepages

xp_enumdsn
This extended stored procedure returns a list of all system DSNs and their descriptions. To get the list of system DSNs, run:

EXEC master..xp_enumdsn

xp_enumerrorlogs
This extended stored procedure returns the list of all error logs with their last change date. To get the list of error logs, run:

EXEC master..xp_enumerrorlogs

xp_enumgroups
This extended stored procedure returns the list of Windows NT groups and their description. To get the list of the Windows NT groups, run:

EXEC master..xp_enumgroups

xp_fileexist
You can use this extended stored procedure to determine whether a particular file exists on the disk or not. The syntax for this xp is:

EXECUTE xp_fileexist filename [, file_exists INT OUTPUT]

For example, to check whether the file boot.ini exists on disk c: or not, run:

EXEC master..xp_fileexist 'c:\boot.ini'

xp_fixeddrives
This very useful extended stored procedure returns the list of all hard drives and the amount of free space in Mb for each hard drive. To see the list of drives, run:

EXEC master..xp_fixeddrives

xp_getnetname
This extended stored procedure returns the WINS name of the SQL Server that you're connected to. To view the name, run:

EXEC master..xp_getnetname

xp_readerrorlog
This extended stored procedure returns the content of the errorlog file. You can find the errorlog file in the C:\MSSQL7\Log directory, by default. To see the text of the errorlog file, run:

EXEC master..xp_readerrorlog

xp_regdeletekey
This extended stored procedure will delete an entire key from the registry. You should use it very carefully. The syntax is:

EXECUTE xp_regdeletekey [@rootkey=]'rootkey', [@key=]'key'

For example, to delete the key 'SOFTWARE\Test' from 'HKEY_LOCAL_MACHINE', run:

EXEC master..xp_regdeletekey @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Test'

xp_regdeletevalue

This extended stored procedure will delete a particular value for a key in the registry. You should use it very carefully. The syntax is:

EXECUTE xp_regdeletevalue [@rootkey=]'rootkey', [@key=]'key', [@value_name=]'value_name'

For example, to delete the value 'TestValue' for the key 'SOFTWARE\Test' from 'HKEY_LOCAL_MACHINE', run:

EXEC master..xp_regdeletevalue @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Test', @value_name='TestValue'

xp_regread
This extended stored procedure is used to read from the registry. The syntax is:

EXECUTE xp_regread [@rootkey=]'rootkey', [@key=]'key' [, [@value_name=]'value_name'] [, [@value=]@value OUTPUT]

For example, to read into the variable @test from the value 'TestValue' from the key 'SOFTWARE\Test' from the 'HKEY_LOCAL_MACHINE', run:

DECLARE @test varchar(20)EXEC master..xp_regread @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Test', @value_name='TestValue', @value=@test OUTPUTSELECT @test

xp_regwrite
This extended stored procedure is used to write to the registry. The syntax is:

EXECUTE xp_regwrite [@rootkey=]'rootkey', [@key=]'key', [@value_name=]'value_name', [@type=]'type', [@value=]'value'

For example, to write the variable 'Test' to the 'TestValue' value, key 'SOFTWARE\Test', 'HKEY_LOCAL_MACHINE', run:

EXEC master..xp_regwrite @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Test', @value_name='TestValue', @type='REG_SZ', @value='Test'


Keep in mind that these undocumented extended stored procedures are not officially supported by Microsoft, and that they may not be found in the next version of SQL Server.


Google Launches Gmail

Google Launches GMAIL ... storage space 1 GB ... too good to believe ... isnt it ...

GMail Link : http://gmail.google.com

Here is the official press release : http://www.google.com/press/pressrel/gmail.html

He ... he ... that was the best joke payed on me in the whole day.

But who knows .. it might even be true ...

 

BCP GUI

DavidM has come out with a BCP GUI tool. Well ... I sure am glad to see that ... Its one tool that will make my life very easy :)