i have a client that runs a windows application on a sql server 2000 database, and i am trying to run a query that works fine on sql server 2005, with the HashBytes function like this:
SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5','some text'), 3, 32) AS MD5
but i don't know if this function works on sql server 2000, so i don't want to send to him something that may not work.
So, can you tell me if this is going to work on my client?
If not.. what alternatives i have to save that 'some text' in md5 format?
Thanks!
HASHBYTES was introduced in SQL 2005, for 2000 you would need an extended stored procedure, for example: http://www.codeproject.com/KB/database/xp_md5.aspx
Related
I need to generate a script with the data from one db in sql server to postgres. It seems the "Generate Script" in SQL Management doesn't do ANSI format like INSERT INTO that I need.
How can I do it?
I suggest.
Fire up an instance of Postgres on an accessible device.
Set up a linked server from Microsoft SQL Server to access the postgresql server using the postgres 64 bit odbc driver.
Start writing TSQL to transfer the data.
https://www.google.com.au/search?q=postgresql+odbc+sql+server+2012
I am using the SYSTEM_USER function to return the windows authentication user in SQL Server 2014. For the user localMachine\localUser value returned is localMachine\localUser.
However, in SQL Server 2016, the value returned is MICROSOFTACCOUNT\user.name#OUTLOOK.COM.
Value returned when using SQL Server Authentication is OK in both SQL Server versions.
I 've searched the documentation to try to find any possible reasons for this changed behavior, but couldn't find any.
Functions S_USERNAME and ORIGINAL_LOGIN behave in the same manner with Windows auth.
Thanks for any answers!
We are in desperate need to having some way to reference a static table in SQL. I'm assuming this maybe possible using a function but i'm not sure how to accomplish this.
For example I want to ...
-on SQL Server A (2005)
SELECT * FROM staticDB.someTbl
-on SQL Server B (2008)
SELECT * FROM staticDB.someTbl
then on each server have the real "staticDB" reference someplace
Hopefully this makes sense!
Thanks
EDIT
So when I have a stored procedure on our dev server it points to the dev db (via the function/var). Then on the prd server it points to prd db. Instead of having to remember to replace them every time. We can have one reference to this function/var and it would just work across both servers.
Something like a connection string equivalent, but for SQL.
Do you know any function implementation I could use for decrypting data encrypted by AES/Rijndael in SQL Server 2000?
xp_crypt might do it
Without the CLR and other whizzy stuff in SQL Server 2005+ it will be difficult in the raw SQL available in SQL Server 2000.
I'm working with a client who had a SQL Server 2008 converted from a SQL Server 2000 DB and one of the queries has quite dramatically increased in time since it was on SQL Server 2000.
However, if I change the compatibility level to 2008 in the DB, the query goes like a rocket (40-50 times faster).
The query does use a number of UDFs.
My questions:
- are there issues with running SQL2000 compatibility in SQL Server 2008
- has SQL Server 2008 improved the performance when using UDFs?
There are some other things you might want to do after upgrading. See the "After upgrading..." section here: http://msdn.microsoft.com/en-us/library/bb933942.aspx