|
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
|
|
|
|
|
When are you trying to get the number? After INSERTing a new record into the table? If so, use @@IDENTITY[^].
Jon Sagara
As you may presently yourself be fully made aware of, my grammar sucks.
Sagara.org | Blog | My Articles
|
|
|
|
|
I'm actually trying to put a new record into the table and am getting errors on that field. Trying to figure out why. I know you have to pass a special parameter I just don't remember what it is...
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.
|
|
|
|
|
Okay, just fixed it.
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.
|
|
|
|
|
What was the solution?
Jon Sagara
As you may presently yourself be fully made aware of, my grammar sucks.
Sagara.org | Blog | My Articles
|
|
|
|
|
A few changes. First off it was required in my code. I changed that. Still got some funny errors so I just removed the field as I don't really need it on the insert. I only really need the field if I show/edit the record. Once I took it out of the page and removed the references I rebuilt the solution. Everything went fine after that. When I show/edit the record it now is behaving the way I'd expect.
It has been *SO* long since I worked in the database end of things. I use to be great at data modeling but it's been years. Now I have to remember all of this again.
- Rex
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.
|
|
|
|
|
Hi,
I am finding difficulties to hold all 13000 rows in DataSet , and DataReader is not reading beyond 65535 rows , my application wants to process all rows at a single shot. I am using OLEDB Jet 4.0 Driver provided by Microsoft.
Please do help !!!!
PK Biswas
love2code
|
|
|
|
|
hi everyone,
i'm new with this software. i have installed it and i think i was able to install it successfully. but i'm wondering it seems to me this 2005 version was not installed since i don't see any difference between this and the 2000 version. when i opened the "Books online" it says there Ms Sql Server 2000. that does mean the 2005 developer edition wasn't installed?
I will really appreciate any help!
|
|
|
|
|
Hi all
We have an application written in VB.Net.It crashes (without showing a message or something) whenever we try to fill a dataset using a DataAdapter (any type of data adapter) with huge data under microsoft windows 98 (Our RDBMS is Microsoft SQL Server 2000)
Does anybody know what is the reason? and what should we do to prevent the crash?
Please help me.
Thanking you in advance
|
|
|
|
|
|
win form has few textbox, i wana store data in table using DataAdapter.insertcommand.
I create Oledb.command object named Icmd then i store SQL "insert into Table" String then i write as follow, it did't give me any error but it cannot work.
DataAdapter.insertcommand = Icmd
If anybody has WinForm simple data entry module, so send me files then i can study myself.
thank you
|
|
|
|
|
Hi everyone,
I am attempting to read records from a table based on a date range, however, the dates are stored in a varchar field. The format of the date is 2005-09-01 10:50:00.
How can I get around the fact that the vendor used the wrong data type?
Your help is greatly appreciated.
|
|
|
|
|
Depends on what daabase you are using. If it's MSSQL you could cast/convert the varchar to a date before comparing it in the query:
select * from [PoorlyDesignedTable] where Cast([ShouldBeADateTimeField] as Datetime) = MyDate
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Rob thanks for your quick response!
Yes it is MSSQL 2000.
Now please pardon my ignorance, but, if I have records with dates greater than 9/1/05, the following statement should return all those records rigt?
SELECT field7, field13, field14<br />
FROM myTable<br />
WHERE (CAST(field14 AS Datetime) >= '2005-09-01') AND (field7 = 'Work Order')
But my result set is empty.
What am I missing?
|
|
|
|
|
SQL Server will return those records for which
CAST(field14 AS Datetime) is greather than '2005-09-01' only if value for filed7 is equal with 'Work Order'
Your result may be empty if settings for database COLLATION or field7 COLLATION is case sensitive CS.
Try to use this condition: ... AND UPPER(field7) = 'WORK ORDER'
Be attention at spaces between WORK and ORDER !
Also, the condition for date may be rewrite thus:
MONTH( field4 ) >= 9 AND YEAR( field4 ) >= 2005
|
|
|
|
|
Thanks everyone for your help!
I ended up using the following statement:
WHERE (UPPER(field7) = 'WORK ORDER') AND (field14 BETWEEN @startdate AND @enddate)
Following airbus' suggestion to use UPPER , and documentation I found in SQL Sever Bible
Thanks again!
|
|
|
|
|
What is datetime format setting for your server ?
Use DBCC USEROPTIONS in SQL Analyzer !
VB6,C#
|
|
|
|