Showing posts with label based. Show all posts
Showing posts with label based. Show all posts

Thursday, March 29, 2012

Database Compatibilty with ASP.net

Hi:

If I will export my SQL express based database to SQL 2000 database - would I will be facing any compatibiltiy issues with my application. Do I just need to change the connection string in my config file and everything will work?

Danka

No, it won't just "work". It is possible for it to work though. You will need to ensure that your SQL Compatibility level on your express database is set to 80. Even then, I am not sure about express. It may not be possible at all.

Tuesday, March 27, 2012

Database catalog unique identifier

I need to develop a strong licensing solution based on the database accessed...

Currently our solution is easily hackable because the the license information is kept in the database of your choice and is not dependant on some static information, the current encryption key is static and kept in the software so it can be hacked easily. What i want to do to change this is simple in nature but i don't know how to get that one particular info i need.

I want to get some kind of unique identifier for a database (catalog) that sql server could generate. This info must be static and must not be movable. If for example, someone would backup and restore, this information would not be transfered with the backup. Thus, a user that backups his database and restores it on another database server or another database catalog even on the same server would corrupt his license since the Unique ID returned by the SQL Server would be different; the hashing code would change and thus the decryption would fail.

Is there any such info i can query using SQL that will not require admin rights?

after searching a bit more in the help i found out there was something i could use in sys.databases.

I was thinking of using a combination of the database name, the id column and the creation date to create the key but then it struck me, if someone wants to cancel his licensed solution, i can do wathever process i want, he can just restore it and the license is back online. Thus, for the original question, i'm pretty much done and everything is ok, but now i need to know if there is somewhere in the sys.* that i can find the last restore date so i can prevent database restore from happening...

|||

after even thourough searching even after work hours, i finally found it (8 hours on the subject is enough i think).

Here is the code that will do what i am searching for

SELECT
d.database_id,
d.name,
d.create_date,
r.restore_date
FROM sys.databases AS d
LEFT JOIN sys.database_files AS df ON df.name = d.name
LEFT JOIN RestoreHistory AS r ON r.destination_database_name = d.name
WHERE
d.name = '[DatabaseName]'

I hope this will benefit someone else and not just me

Friday, February 24, 2012

Data type validation

Hi all,

I want to make a conditional split based on the data type provided by the input.

For example : If the comming (Column x) is of data type (numeric) then pass , else do not pass.

(pass = Case 1

Do not pass = Case 2).

Is there any way for doing so ?

You can use conditional split transformation for this.

The following link will help you get started
http://technet.microsoft.com/en-us/library/ms137886.aspx


Thanks

|||

I think Data Convertion transform is the easiest way to do this, see this for details:

http://technet.microsoft.com/en-us/library/ms186792.aspx

You would read the data as string, then try to convert it to numeric. Configure Error Disposition to redirect row. The "pass" will go to default (green) output, the rows that do not pass will go to error output.