|
Not sure about this, but try setting CDO.Message's BodyPart.Charset to utf-8 .
|
|
|
|
|
Thanks for the reply....
Yes, that's what I suspect is needed, however, I'm unable to find how to do it in T-SQL....
I've tried varous combinations of OASets, but keep getting errors, and can't seem to find the "correct" way to do it...
Thanks again for your time...
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I haven't really used that (always used either sql mail or database mail). I'd guess it could be something like :
sp_OASetProperty @iMsg, 'BodyPart.Charset.Value','"utf-8"'
Or some of it's variations. I guess you'll have to google around or test several variations.
If it would be possible for you I'd suggest that you would use database mail (if having SQL Server 2005 or above). It's a whole lot simpler and purely smtp.
modified on Monday, December 8, 2008 5:14 PM
|
|
|
|
|
Got it in the end.....
EXEC @hr = sp_OASetProperty @iMsg, 'BodyPart.Charset', 'windows-1252'
Seems to do the trick....Many thanks for the help there chap.
C# has already designed away most of the tedium of C++.
|
|
|
|
|
RichardGrimmer wrote: Many thanks for the help there chap
You're welcome.
|
|
|
|
|
How to select the column names that contains a value of say 0 in the first row
Please help
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
I think you could write a little procedure (or program). If you need the columns only from one table, just select the first row and loop through columns. If you need info from several tables, you could use system tables and based on the info from there, loop tables, fetch first row and then loop through columns. You'll need to use dynamic statements based on system table information.
|
|
|
|
|
If you want it in SQL , so :
SELECT names FROM tableName WHERE id IN ( SELECT MIN(id) FROM tableName )
You should identify first row by a field , in this case I used id
|
|
|
|
|
Mohammad Dayyan wrote: SELECT names FROM tableName WHERE id IN ( SELECT MIN(id) FROM tableName )
Hey Mohammad,
More help please
By selecting column names, I'll get all the columns even if they contain a value other than the minimum in the sub select statement, are you sure it can be done from sql??
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
It should work, but I think sou can use this query too :
SELECT name, MIN(id)
FROM tableName ;
|
|
|
|
|
Hey Mohammad,
Thank you for your kind help, but do you understand my question??
I want to get the column names of a table that has for example the value '1' in the first and only row of that table
Example:
A B C
-- -- --
0 0 1
The output should be:
C
Please tell me if you can make this happen.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks Muammar. I've got it right now
I think you should use several queries
select A from tablename where A=1
select B from tablename where B=1
select C from tablename where C=1
|
|
|
|
|
No, thanks to you Mohammad,
That should do it, but do you have any idea how can we combine the 3 select statements so they would return a single row??
Thank you for being there until now
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Thanks Mohammad, UNION ALL was what I needed to combine multiple select statements and get them in one column
Column Name
------------
A
B
C
D
Column Value
------------
0
0
1
0
Though, I still need to combine those tow columns in one output, can you help in that too my friend
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: Thank you for being there until now
Oh no problem Muammar, I'm happy to help someone .
Muammar© wrote: That should do it, but do you have any idea how can we combine the 3 select statements so they would return a single row??
I'm so sorry , I don't know
|
|
|
|
|
Don't worry Mohammad, thanks anyways for your efforts, I think it's some sort of a join query and I'm googling for join queries.
Thanks again Mohammad.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
hi. How do you transfer data of a database from another database. I am using MS SQL. I have hundreds of data there and I need to transfer it to another database since I'm having problems with the previous one with regards to attaching it to the dataset with crystal reports. It only recognizes the newly created databases in SQL Express and I don't know why. So I just planned to recreate my recent database and transfer all of the existing data to a new one. How do I do that? Thanks!
|
|
|
|
|
harcaype wrote: How do you transfer data of a database from another database
SSIS is one way if you have to do this continuously but you can also use backup/restore or detach/attach. They would be easier for a single transfer.
harcaype wrote: It only recognizes the newly created databases in SQL Express
If this is the root problem, I think you should concentrate in this. There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.
|
|
|
|
|
Root problem? I'm sorry, but what did you mean by root problem? I'm not really sure myself though. A few days ago I was able to attach the tables on the dataset with the same database, and get recognized in the Crystal Report Wizard. Then when I duplicated my project file, and redo what I did in my "backed-up" project file, that started the strange problem. And if you mean that getting and successfully querying the database is a good condition, Yes. My database is in good condition for that part.
|
|
|
|
|
harcaype wrote: A few days ago I was able to attach the tables on the dataset with the same database, and get recognized in the Crystal Report Wizard. Then when I duplicated my project file, and redo what I did in my "backed-up" project file, that started the strange problem
Yes that's what I mean by root problem. If your new project acts differently than the previous project I would guess that the problem is actually in the project, not in the database. But then again I don't know enough about the solution so this is merely guessing.
Try for example restoring a backup to a new database. If that solves the problem then everything should be ok. If it doesn't it would still give you more information about the problem.
|
|
|
|
|
I tried attaching the database on a newly created project. Still the same. Not recognized in the crystal report wizard. Sigh.. Oh well. I'll just try this newly created database first. Hopefully it works.
|
|
|
|
|
Let's hope so. If not, post what you have found and we'll see if some new ideas come up.
|
|
|
|
|
Mika Wendelius wrote: There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.
Unless Crystal Reports is connected to the new instance only. I'm willing to bet he has two instances installed.
The world is a stage and most of us are desperately unrehearsed.
—Sean O’Casey, Playwright
|
|
|
|
|
Jerry Hammond wrote: I'm willing to bet he has two instances installed
That would explain it, but even though it's a matter of connection string... "Where do want to go today"
|
|
|
|
|
If I remember my Crystal Reports it is even simpler. From within the report he is building he should be able to use the UI to connect to the correct instance/db.
The world is a stage and most of us are desperately unrehearsed.
—Sean O’Casey, Playwright
|
|
|
|