|
With SQL Server 2000, I can execute the following SQL command:
select * from table1 select * from table2
The output contains two record sets, one for each select statement. But if I do this with Oracle or MS Access (via ODBC connections), I got syntax errors. The question is, what is the correct way to execute a SQL command with two or more select statements? Is it supported by Oracle? Is there a way to get around it?
Thanks.
P.S. I know the problem is not with ODBC itself because I can do this with SQL Server 2000 via ODBC connection.
My articles and software tools
|
|
|
|
|
you have to use ';' character to separate SQL statements
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
you have to use ';' character to separate SQL statements
Thanks. I tried it, did not work. I also tried "\n" and "\r\n" without success.
My articles and software tools
|
|
|
|
|
if both tables are identical, you can use
'Select * from tab1
UNION
Select * from tab2'
in fact you can use the UNION statement whenever querys return a identical resultset.
dirk
|
|
|
|
|
|
hi everyone,
ım using .net and sql server 2005, ı have a report project and this project have parameters.think that like "primary school" and "high school fields". sometimes, ı want to filter outputs with two parameters, and sometimes ı want to filter with just one parameter. thats the time that ı have problems. when ı pass only a parameter, ı want that this report doesnt care with the second parameter. but, it understands it (param1=something_ı_want, param2=null). then it searches for null values in second parameter and as an output, ı have nothing.
do you know how can ı fix that problem, how can ı say to this report "dont care with second parameter, ı only ask for first one"?
thanks for your help,
Ali Sapancı
|
|
|
|
|
i think u r using crystal report,better you pass recordset to the report at runtime. At run time you can frame your SQL as you want and create the recordset and assign that record set to the report. that will be very flexible than using the parameters in report
|
|
|
|
|
it is not my decision, ım in an internship now and that is what they want
|
|
|
|
|
hi all,
I have a field which name is Information
and it type is Varchar (8000),but some time data access than 8000 character, my client told me,make this field to store Unlimited data.
So how can i achive this task, i m using VS 2003 (ASP.NET with VB.NET) with SQL 2000.
Thanks
Shally
|
|
|
|
|
Look up ntext, text and image in SQL books online. These types will let you store data blobs limited only by the storage space on the server. They do have limits on the types of queries you can run on them so make sure they fit your needs.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
|
Thanks.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
|
Hi All,
I wanna store " ' " in data base ....for e.g,
"father's" or "isn't",
i m using VS 2003 with SQL Server 2000..
so how can i achive this task
Thanx
Sajjad
|
|
|
|
|
Use an ADO.Net parameter to pass the data in rather then building the SQL dynamically. If you have to build dyanmic sql, '' gets translated to ', so 'father''s' is stored as father's. This is typically done with a call to Replace("'", "''")
|
|
|
|
|
thanx for reply...
but i wanna store in database ' father's ' not ' father"s '
i think u understand my point..
thanx
|
|
|
|
|
imshally81 wrote:
but i wanna store in database ' father's ' not ' father"s '
That's what I told you how to do. '' is a string escape code for ' in sql just like \t for tab in C or "" for " in VB.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
insert into <tablename> values ('''')
will insert a single "'"
"fathers'''s" or "isn'''t" will do....
dirk
|
|
|
|
|
Thanx for reply...
u means if i wanna insert " father's " in data base so we enter text as
" father'''s "
am i write ..?
basically i used VS 2003(ASP.NET with VB.NET) with SQL Server 2000,so if u have any sample code for this... i shall very thankfull of u...
|
|
|
|
|
Yup, at least that is Standard-SQL, should work with most Databases, for shure with SQL Server and Oracle.
You could try it out from Enterprise Manager or Query Analyser by raising a INSERT statement from there.
|
|
|
|
|
|
hi everyone,
i'm trying to install the sample database AdventureWorks I followed the step-by-step in the tutorial book (installing after the setup). but i don't know why i cannot make a connection on it.
Anyone here knows how to workaround this problem.
I will appreciate any help!
|
|
|
|
|
lagumaster wrote:
Anyone here knows how to workaround this problem.
What problem ? You said this:
'I followed the instructions, but it didn't work'.
You obviously did not follow the instructions, but without clear description of the sort of errors you're getting, it's impossible to work out how and where.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I believe I followed the instructions. I did the steps in: To install the sample databases and samples after Setup. But then when I tried to register the AdventureWorks Database, in the New Server Registration Dialog Box, I clicked on the AdventureWorks (in the Connect to Database listbox), then I clicked TEST button, I'm getting an error says: "Cannot open database requested in login...."
So I thought it was installed but not attached, so what I did I used the ATTACH context menu in the Database, i looked for the .mdf file, but I'm still getting an error.
But I was wondering why when I installed AdventureWorks it didn't go to this path: n:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data. It when here: n:\Program Files\Microsoft SQL Server\90\Tools\Samples
\AdventureWorks OLTP. And I'm getting an error when i'm trying to attach it
hope this makes my problem clear and hope you can help me.
Thanks!
|
|
|
|
|
Used this code to create the field in the table:
ALTER TABLE invoice add number INT IDENTITY(10000,1) NOT NULL
Now I must be forgetting something because when I bind a page to the field
and load it for entering in the record that corresponds to it I'm not getting
the number from the database.
I cannot remember how you do this. I'm using C# but I don't consider this a
C# question. I think I need to do something else SQL Server side but I'm not
a dba and I don't remember...{SIGH}
Anybody know how I get the autonumber/identity to kick me the next number
in order on the table? I've only got experience with this in Sybase and I
don't see a correllation between this instance and Sybase at all...
Ideas?
My name is Maximus Decimus Meridius, commander of the Armies of the North, General of the Felix Legions, loyal servant to the true emperor, Marcus Aurelius. Father to a murdered son, husband to a murdered wife. And I will finish this project, in this life or the next. Slightly modified " from Gladiator.
Code-frog System Architects, Inc.
-- modified at 15:04 Sunday 28th August, 2005
|
|
|
|