Showing posts with label building. Show all posts
Showing posts with label building. Show all posts

Tuesday, February 14, 2012

Best way to handle License issues

Here is the scenario:

We are developing an ETL type data load application and we're thinking building a SSIS package to assist with this.

The application and data files to be loaded would be on the client Windows XP Workstation. The SQL Server 2005 instance would be on a networked server elsewhere.

The XP Workstation would NOT have sql server 2005.

What is the best way to handle this? Can this be achieved fairly easily?

Kevin

You’ll have to be a bit more specific on how you want to do your licensing... on a per seat basis? Per server?

No matter the model, I would highly recommend taking a read of this article on the mechanisms provided by the .NET Framework to help you implement a licensing mechanism.

|||I'm sorry I wasn't clear. I do not want to CREATE licensing for my application. I want to find out what the best, cost effective solution for me would be.

Example:
Buy 1 SQL Server 2005 and call SSIS packages from the Client?
I think in this scenario I would only need 1 SQL Server Standard license?

Kevin
|||Ahh... that I’m afraid I cannot help you with much... instead I would suggest starting with the SQL Server 2005 Licensing: Frequently Asked Questions if you have not already found it.|||

If the ETL application is to be on the client then you will need to have a licensed SQL Server install there - although you need only install SSIS and tools, not the server itself.

A better - and more economical - scenario for you may be to have SSIS running on the SQL Server box. No additional license required. You can create a SQL Agent job to execute the package and invoke that job remotely from the client using T-SQL.

Either way, of course, you will have data moving over the network from client to server - and that may be a bottleneck for you.

Donald

Monday, February 13, 2012

best way to get related tables?

SQL Server 2000 : ASP w/ C# Codebehind 2.0 framework
I'm building an intranet site to query our database. ON the initial
page is a checkbox list of all the user tables in our DB. When a table
is first checked, I want to query the database and disable all
checkboxes representing tables not related to the first table checked.
The way I started to do it was to query
INFORMATION_SCHEMA.TABLE_CONSTRAINTS for contraints which contained the
table name, I then realized that even if I had a list of related tables
(which I could get by parsing the results properly from my I_S.T_C
query) I still wouldn't know which fields were related, which I need to
know in order to build the INNER JOIN part of the site's end query. So,
I suppose my question is, what is the easiest way to find out which
tables are related to a certain table, and on which fields those tables
are joined?
Thanks,
KrBIs this of any help?
SELECT u.column_name as PrimaryColumn,tc.TABLE_NAME AS PrimaryKeyTable,
--tc.CONSTRAINT_NAME AS PrimaryKey,
u2.column_name as ForeignColumn,
--COALESCE(rc1.CONSTRAINT_NAME,'N/A') AS ForeignKey ,
COALESCE(tc2.TABLE_NAME,'N/A') AS ForeignKeyTable
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE u on tc.CONSTRAINT_NAME
=u.CONSTRAINT_NAME
JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 ON
tc.CONSTRAINT_NAME =rc1.UNIQUE_CONSTRAINT_NAME
JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME
=rc1.CONSTRAINT_NAME
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE u2 on rc1.CONSTRAINT_NAME
=u2.CONSTRAINT_NAME
WHERE TC.CONSTRAINT_TYPE ='PRIMARY KEY'
ORDER BY tc.TABLE_NAME,tc.CONSTRAINT_NAME,rc1.CONSTRAINT_NAME
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||I'll look into it, thanks SQL Menace =)
K|||That is really close to what I need. The only thing is ForeignColumn
and PrimaryColumn are always equal. I can tell it's picking up the
right tables, however. So it looks like u2.column_name is the same as
u.column_name. I'll tinker with it a bit, thanks again, Denis.|||If you run that code in the Northwind DB you will see that the column
names are not always the same, in pubs they are always the same
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||Hmm... Interesting. So is there a way to pull the foreign key column
out of this select?|||Here is a little addition
I have specified AND TC2.CONSTRAINT_TYPE ='FOREIGN KEY' just to be
sure
SELECT TC.CONSTRAINT_TYPE,TC2.CONSTRAINT_TYPE,u.column_name as
PrimaryColumn,tc.TABLE_NAME AS PrimaryKeyTable,
--tc.CONSTRAINT_NAME AS PrimaryKey,
u2.column_name as ForeignColumn,
--COALESCE(rc1.CONSTRAINT_NAME,'N/A') AS ForeignKey ,
COALESCE(tc2.TABLE_NAME,'N/A') AS ForeignKeyTable
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE u on tc.CONSTRAINT_NAME
=u.CONSTRAINT_NAME
JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 ON
tc.CONSTRAINT_NAME =rc1.UNIQUE_CONSTRAINT_NAME
JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc2 ON tc2.CONSTRAINT_NAME
=rc1.CONSTRAINT_NAME
join INFORMATION_SCHEMA.KEY_COLUMN_USAGE u2 on tc2.CONSTRAINT_NAME
=u2.CONSTRAINT_NAME
WHERE TC.CONSTRAINT_TYPE ='PRIMARY KEY'
AND TC2.CONSTRAINT_TYPE ='FOREIGN KEY'
ORDER BY tc.TABLE_NAME,tc.CONSTRAINT_NAME,rc1.CONSTRAINT_NAME
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||Okay... I think I was just being retarded. So it takes PrimaryKey from
PrimaryKeyTable and ForeignKeyTable is the related table, which is
where ForeignKey comes from. I thought, for some reason, it was saying
ForeignKey and PrimaryKey were coming from the same table... You've
surely saved me many hours of head to wall impact, thanks again.
Kyle

Sunday, February 12, 2012

Best way to do a free text search

HiI have a .net 2 website that works from a sql 2000 db. I am building a form that will allow the user to type in any search criteria and based on their input I need to produce some results (that's the simplest way to put it)I will need to search various parts of my db to find similar sounding information, I was just wondering what is the best way to do this. I had the following thoughts1) Search columns using Soundex tsql function (but not sure how good this is?)2) Remove all noise words from user input (eg, and, or, the etc...) and then use a regular expression to search the fields in the dbAlternatively are their some third party components to do can do this for me Many thanks in advance

You can full text search enable the database, and create a full text index on the column in the table you want to search. Then you will be able to search any word that appears inside that column. Here are a couple of links that might be helpful to you.

http://www.databasejournal.com/features/mssql/article.php/3441981

http://www.wherecanibuyit.co.uk/ASP/full-text-search.html

http://msdn2.microsoft.com/en-us/library/ms177652.aspx

|||

Hi

Thanks for that, it was a great help

I have noticed that their is a RowNumber method in SQL 2005, is their any way to do this functionality in SQL 2000

One method I thought of was to put the data in temp table and loop through each record and give it a number, and then pull out 10 records at a time as the user pages through.

Are their any other ways I could do this.

Many thanks in advance

|||

The short answer is yes. You may want to search for articles on Custom Paging with SQL Server 2000. There are ways to do it, but they are not as simple or clean as the ROW_NUMBER() function. Here is an article to get you started.

http://www.4guysfromrolla.com/webtech/042606-1.shtml