|
Vector7 wrote:
Because there are cases in life where you have to accept nulls.
Yes, I know that; I've been using RDBMS for over 20 years
What I was trying to point out was that if you perform a syntactically correct select statement
SELECT * FROM CARS WHERE TYP = 'Honda%'
it should return rows, regardless of whether any column in the table has a NULL value (apart from TYP, obviously!). (Your original post said it wasn't working). If that doesn't work, it suggests issues other than NULL handling.
Since you 'fixed' it by specifying a table prefix, that suggests the parser is otherwise being slightly confused by the names. What version and SP of SQL Server are you running?
Steve S
Developer for hire
|
|
|
|
|
I have a bunch of scripts in one folder (example: c:\myScripts). How can I execute them all as opposed to loading/running them one by one from Query Analyzer?
Thanks.
Norman Fung
|
|
|
|
|
|
Thanks. That's a very handy utility. Can you show me what's the format for -r (resource) argument so I dont have so go over the code? This didn't work for obvious reason:
RunSQL -r localhost -f script.sql
I presume "-r" (resource) is a fully construction connection string? I tried:
RunSQL -r "Data Source=localhost,1433;Initial Catalog=MyDB;User ID=sa;Password=testing" -f "test_RunSQL.sql"
I'm getting a System.ArgumentNullException.
Norman Fung
|
|
|
|
|
"The demo application takes two command line arguments. The first is either a -r (for embedded resource) or -f (for a file). The second argument is either the name of the resource, or the name of the file."
So, you use a -r OR a -f but not both
-r is for an embedded resource. The demo also shows how to embed SQL Scripts as resources in your application so that you don't have to rely on external files.
So all you need is:
RunSQL -r script.sql
Do you want to know more?
WDevs.com - The worlds first Developers Services Provider
|
|
|
|
|
|
for %i in (*.sql) do osql -E %i You might need to use the -U and -P options rather than -E, and you might need to specify -S to run them on another server. If you need to run them in a particular order, remember that NTFS always outputs directory listings in alphabetical order.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Dear CPians,
Is there a way to invoke a Web Service from a Stored Procedure?
Thank you,
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Anybody knows about this? Any information please!
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
If you fill your database with premium, it runs faster and you get more miles to the gallon.
In other words, what the hell are you talking about ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I don`t know that databse either. That`s why I ask you guys. Maybe there isn`t any premium database.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I see - you've just failed to word your question in a way that makes sense. I'd recommend SQL Server as a database, I think Oracle is the main competitor, and it is utterly crap.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
No, no, no. What I meant was, is there any DBMS called "premium".
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Why would there be ? Have you tried google ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
Why would there be ?
Somebody told me that, I don`t know if it`s exist,or maybe I didn`t listen it correctly. He said that it was a database integrated with business application, like accounting application. I tried google, couldn`t find what i`m looking for.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Can I copy a OLAP Service cube from one computer to another? Thanks.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Hello,
I am storing in an SQL table data including email addresses. When trying to retrieve via the Select function rows including an email address the program traps because the @ character witin the select statement is a reserved symbol for parameters.
How can i select rows in a table based on email addresses, such that the @ symbols is not interpreted as a special symbol but part of a string parameter.
I tried to use "\@" instead of @ but it doesent work.
Any suggestions are most appreciated,
Daniel
|
|
|
|
|
Can you show us your code?? or give us more information?
Where do you execute the SELECT command? how do you build your query?
Off the top of my mind, if you're using .NET, using parametized queries (see SqlCommand class and its Parameters property) should solve your problem.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Dear Luis,
Thank you for your reply.
I have been using visual studio.net form designers to construct a data set object, which included a "SubscribersEmails" table. This table stores one (or more) email addresses a subscriber can use to register.
Following is a code snipplet, which attempts to retrieve one row within the SubscribersEmails table which belong to a specific subscriber (identified by a SubscriberID) and is the row associated with one email address (identified by the anEmailAddress string). Note the SubscribersEmail table includes the columns: SubscriberID and emailAddress.
Dim theEmailRows As DataRow()
theEmailRows = subscriberTableDS.Tables("SubscribersEmails").Select("SubscriberID = " & SubscriberID & "AND emailAddress = " & anEmailAddress)
Since during execution the string anEmailAddress includes the @ sign, the above command fails, complaining about the @ sign.
thanks,
Daniel
|
|
|
|
|
grossd wrote:
theEmailRows = subscriberTableDS.Tables("SubscribersEmails").Select("SubscriberID = " & SubscriberID & "AND emailAddress = " & anEmailAddress)
Since anEmailAddress is a string , you have to use delimiters, in this case single quotes.
....Select("SubscriberID = " & SubscriberID & " AND emailAddress = <big>'</big>" & anEmailAddress & "<big>'</big>") Hope this helps,
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hello Luis,
Thank you!,
It works very well now. That was exactly the problem.
Daniel
|
|
|
|
|
You're very welcome! I'm glad I could help!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Can anyone help ...
i'm developing an ADO.NET prog., here is a brief description :
--dataSet X contains all tables.
--dataSet Y : temp dataSet for filtering some table views (every search session Y is created and shipped with the chosen table(only one table) from X).
--after the user build the search criteria (by entering some values for some columns or choosing predefined values for lookup columns)he clicks Accept.
-- the Accept button deletes the dirty copy of the table (if exists),which may exists from a previous search session, then Copies another copy(clean one) of the table (original table copied at the start of search session) existing in (Y) and apply the filteration criteria by deleting those rows (from the second table) which does not match the search criteria.
****Important:When the user clicks Accept AGAIN the filtered table (in Y) is deleted and then copy a new one from the already existing one.***********
--after all filteration is done, a dataGrid (M) is bound to (Y) and the filtered table(second table).
**********
PROBLEM
**********
--when the user CHANGES the search criteria (by changing any value or adding new condition), he then presses Accept but (M)refuses to view the updated table.
--note that the first time of search goes ok, but no further results are dispalyed correctly(the first search result lasts forever on M) if the search criteria changes even though the filtered table in (Y) has changed.
****
Code
****
AcceptButton()
{
layer1.ReloadTempTable();
for(int i=0;i
|
|
|
|
|
hi,
i got this table -
Employees:
Id | Name
------------------
1 Avi
2 jack
3 NULL
4 NULL
5 betty
when i query this sql - "select id, name from employees"
i get back a data set with 5 results.
the problem is that its seems like when the query executed , when the query bump into a null value in the Name column, from now on all the results will be null.
it means that the dataset result will be -
Id | Name
------------------
1 Avi
2 jack
3 NULL
4 NULL
5 NULL // SUPPOSE TO BE WITH "betty"
why is that?
(i accord to the problem when i tried to do ds.tables[0].rows[1][4] and it returned dbnull)
|
|
|
|
|
Avi Laviad wrote:
(i accord to the problem when i tried to do ds.tables[0].rows[1][4] and it returned dbnull)
Given the SQL you gave, then this should fail.
What you are saying in this piece of code is that you want the value from table[0] (the first table returned), Rows[1] (the second row, which should contain 2, Jack) and then column[4] (the fifth column is way outside the range - You should get an IndexOutOfRange exception if you run it)
Perhaps, for brevity, you cut too much out of the code and we cannot see the problem anymore.
Do you want to know more?
WDevs.com - The worlds first Developers Services Provider
|
|
|
|