Monday, March 19, 2012
how to return UTF 8 string from nvarchar field
i have connected my ms sql 2000 with C using ODBC
can u help me to return the utf 8 string from nvarchar field ??
how should i do it
please help!!!!!!!http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q232/5/80.ASP&NoWebContent=1 information about storing UTF8 data.|||hi
thanx for u r help but it did not solve my problem
i want to retrive the utf 8 stirngs stored in nvarchar
but this does not help
thanx hope u can help me|||In SQL you can use READTEXt/WRITETEXT/UPDATETEXT to retrieve such data and refre to books online for more information.|||hi
thanx a lot
can u tell me which book to look for and
what i am saying is that the UTF 8 data that i have stored in the nvarchar field and retrieved it from C and store in a txt file
it should give ?? it only gives me ? which means it is not reading the whole data
so can u help in that plzzz
thanx a lot
looking forward to u r reply
thanx|||IN which language you're trying to retrieve C or SQL?
Ensure the windows locale does match to the collation set on SQL server.
Books online is the utility installed alongwith SQL server.
If not get the latest from here (http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp)|||i am retrieving the data from MS SQL(back end) through ODBC using C language(front end)
in win2k envoironment and storing the data in a text file
the field is a nvarchar field which has UTF 8 chars in it
and i want to retrieve the data from it and but it is not working accordingly
what should i do ??
Monday, March 12, 2012
How to return all records when date filter parameter is missing
I'm using an objectDataSource connected to a strongly typed dataset to populate a GridView. I want to be able to show all the records, or let the user to select only those records that expire in a certain month. The expire field is of type date
I'm used to all records being returned when a parameter is missing. If I have Select * from table where last=@.last, only the records where the last name is 'Smith' will be returned if @.last = 'Smith', but all records are returned is @.last = "". But that's not how it's working with the date.
I'm passing an integer from 1 to 12 in a querystring. I have the equivalent of
select * from table where (MONTH([AD ENDS]) = @.month)
MONTH(datefield) always returns an integer from 1 to 12. If @.month is empty, I want all the records to be displayed, but nothing is. If @.month is an int form 1 to 12, it works fine. How can I get all the records if no month is selected? Can I have two objectdatasources and programmatically select which one populates the gridview depending on if I want to filter the data or not?
Diane
HI Diane,
It think there are two options that might be better than having two objectdatasources.
1:change the select statement programmatically
strSQL = "select * from table ";
if (strMyMonth == string.empty)
{ strSQL+= "where (MONTH([AD ENDS]) = @.month)"}
else
{srSQL += "where (MONTH([AD ENDS]) > Date('01/01/0001')}
2:use the databases own If Then Else capabilities (this is dependent on your DB.. I know oracle, sqlserver and even access allows this)
Access Example: If [targetgoal] <> 0 then ([Total Of $FeeBilled]/6)*12)/[TargetGoal] else [targetgoal]= 0
But I would try to use Select * from table where last=ISNULL(@.last,last).
For the month query,please try something like this:
WHEREMONTH(tDate)=ISNULL(@.month,MONTH(tDate))
|||Yup, those are much better options. I forgot about changing the select statement programmatically. Been at this too many hours I guess. I like the idea of using the database's capabilities though. If my current select statement is select * from table where (MONTH([AD ENDS]) = @.month) and I'm using SQL Server 2005, what would the new select statement be?
select * from table where ( If @.month <> 0 then (MONTH([AD ENDS]) = @.month) )?
or
select * from table ( If @.month <> 0 then (whereMONTH([AD ENDS]) = @.month) )?
Diane
|||SELECT * FROM Table WHERE MONTH([AD ENDS]) = ISNULL(@.month, MONTH([AD ENDS])|||Thank you Dinakar! That worked!
Linmo, in a strongly typed dataset (which are pretty much all I know in .NET so far), if an empty parameter is returned, the filter for that parameter isn't set. This behavior is a life saver IMHO. It kust had me stumped this time around.
Diane
Wednesday, March 7, 2012
How to retrieve sa password on Win98?
2000. That PC is connected to the Internet, and probably someone has
changed the sa password.
In fact, trying to connect to the sql server using "SQL Server
Enterprise Manager" results in this error message:
"A connection could not be established to SERVERNAME - Login failed for sa."
Query Analyzer instead gives: "Unable to connect to server. Server Msg
18456, Level 16, State 1. Login failed for user sa".
Searching on the net I have found a bunch of good ways to follow, even
if they all require to join into Windows as Administrator user (and
thus, using Windows Authentication mode).
However I can't proceed because the server that runs SQL Server is
Windows 98, thus Windows Authentication Mode is not available.
Can you help please?
TIA,
Paolo
Paolo wrote:
> Hi, we have a problem on a server of our customer running SQL Server
> 2000.
Hrm... sorry, I meant SQL Server 7 ;)
|||I was not aware that it is possible to install SQL Server on Windows 98.
Are you talking about MSDE? or perhaps the Developer Edition of SQL Server?
Since you did not take the appropriate steps to secure your "server" and you
already looked into other options but they will not work for you perhaps the
only option you have left is to contact Microsoft Support.
I do have one final idea: Shut down the "server" copy the database files,
and attach them to a new server. At least you will be able to access your
data.
Keith
"Paolo" <paolo@.red.it> wrote in message
news:%23EtmbfCkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> Hi, we have a problem on a server of our customer running SQL Server
> 2000. That PC is connected to the Internet, and probably someone has
> changed the sa password.
> In fact, trying to connect to the sql server using "SQL Server
> Enterprise Manager" results in this error message:
> "A connection could not be established to SERVERNAME - Login failed for
sa."
> Query Analyzer instead gives: "Unable to connect to server. Server Msg
> 18456, Level 16, State 1. Login failed for user sa".
> Searching on the net I have found a bunch of good ways to follow, even
> if they all require to join into Windows as Administrator user (and
> thus, using Windows Authentication mode).
> However I can't proceed because the server that runs SQL Server is
> Windows 98, thus Windows Authentication Mode is not available.
> Can you help please?
> TIA,
> Paolo
|||Keith Kratochvil wrote:
> I do have one final idea: Shut down the "server" copy the database files,
> and attach them to a new server. At least you will be able to access your
> data.
>
Thanks for the suggestion, it worked!
I copied a pristine master database from a vanilla sql server
installation to the "locked" sql server, then the databases containing
datas has been attached using sp_attach_db.
Finally I have specified a non blank password for user sa...
Regards,
Paolo
|||I am glad that you were able to figure things out!
Keith
"Paolo" <paolo@.red.it> wrote in message
news:%23a6VLoOkEHA.3844@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Keith Kratochvil wrote:
files,[vbcol=seagreen]
your
> Thanks for the suggestion, it worked!
> I copied a pristine master database from a vanilla sql server
> installation to the "locked" sql server, then the databases containing
> datas has been attached using sp_attach_db.
> Finally I have specified a non blank password for user sa...
> Regards,
> Paolo
How to retrieve sa password on Win98?
2000. That PC is connected to the Internet, and probably someone has
changed the sa password.
In fact, trying to connect to the sql server using "SQL Server
Enterprise Manager" results in this error message:
"A connection could not be established to SERVERNAME - Login failed for sa."
Query Analyzer instead gives: "Unable to connect to server. Server Msg
18456, Level 16, State 1. Login failed for user sa".
Searching on the net I have found a bunch of good ways to follow, even
if they all require to join into Windows as Administrator user (and
thus, using Windows Authentication mode).
However I can't proceed because the server that runs SQL Server is
Windows 98, thus Windows Authentication Mode is not available.
Can you help please?
TIA,
PaoloPaolo wrote:
> Hi, we have a problem on a server of our customer running SQL Server
> 2000.
Hrm... sorry, I meant SQL Server 7 ;)|||I was not aware that it is possible to install SQL Server on Windows 98.
Are you talking about MSDE? or perhaps the Developer Edition of SQL Server?
Since you did not take the appropriate steps to secure your "server" and you
already looked into other options but they will not work for you perhaps the
only option you have left is to contact Microsoft Support.
I do have one final idea: Shut down the "server" copy the database files,
and attach them to a new server. At least you will be able to access your
data.
--
Keith
"Paolo" <paolo@.red.it> wrote in message
news:%23EtmbfCkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> Hi, we have a problem on a server of our customer running SQL Server
> 2000. That PC is connected to the Internet, and probably someone has
> changed the sa password.
> In fact, trying to connect to the sql server using "SQL Server
> Enterprise Manager" results in this error message:
> "A connection could not be established to SERVERNAME - Login failed for
sa."
> Query Analyzer instead gives: "Unable to connect to server. Server Msg
> 18456, Level 16, State 1. Login failed for user sa".
> Searching on the net I have found a bunch of good ways to follow, even
> if they all require to join into Windows as Administrator user (and
> thus, using Windows Authentication mode).
> However I can't proceed because the server that runs SQL Server is
> Windows 98, thus Windows Authentication Mode is not available.
> Can you help please?
> TIA,
> Paolo|||Keith Kratochvil wrote:
> I do have one final idea: Shut down the "server" copy the database files,
> and attach them to a new server. At least you will be able to access your
> data.
>
Thanks for the suggestion, it worked!
I copied a pristine master database from a vanilla sql server
installation to the "locked" sql server, then the databases containing
datas has been attached using sp_attach_db.
Finally I have specified a non blank password for user sa...
Regards,
Paolo|||I am glad that you were able to figure things out!
--
Keith
"Paolo" <paolo@.red.it> wrote in message
news:%23a6VLoOkEHA.3844@.TK2MSFTNGP12.phx.gbl...
> Keith Kratochvil wrote:
> > I do have one final idea: Shut down the "server" copy the database
files,
> > and attach them to a new server. At least you will be able to access
your
> > data.
> >
> Thanks for the suggestion, it worked!
> I copied a pristine master database from a vanilla sql server
> installation to the "locked" sql server, then the databases containing
> datas has been attached using sp_attach_db.
> Finally I have specified a non blank password for user sa...
> Regards,
> Paolo
How to retrieve sa password on Win98?
2000. That PC is connected to the Internet, and probably someone has
changed the sa password.
In fact, trying to connect to the sql server using "SQL Server
Enterprise Manager" results in this error message:
"A connection could not be established to SERVERNAME - Login failed for sa."
Query Analyzer instead gives: "Unable to connect to server. Server Msg
18456, Level 16, State 1. Login failed for user sa".
Searching on the net I have found a bunch of good ways to follow, even
if they all require to join into Windows as Administrator user (and
thus, using Windows Authentication mode).
However I can't proceed because the server that runs SQL Server is
Windows 98, thus Windows Authentication Mode is not available.
Can you help please?
TIA,
PaoloPaolo wrote:
> Hi, we have a problem on a server of our customer running SQL Server
> 2000.
Hrm... sorry, I meant SQL Server 7 ;)|||I was not aware that it is possible to install SQL Server on Windows 98.
Are you talking about MSDE? or perhaps the Developer Edition of SQL Server?
Since you did not take the appropriate steps to secure your "server" and you
already looked into other options but they will not work for you perhaps the
only option you have left is to contact Microsoft Support.
I do have one final idea: Shut down the "server" copy the database files,
and attach them to a new server. At least you will be able to access your
data.
Keith
"Paolo" <paolo@.red.it> wrote in message
news:%23EtmbfCkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> Hi, we have a problem on a server of our customer running SQL Server
> 2000. That PC is connected to the Internet, and probably someone has
> changed the sa password.
> In fact, trying to connect to the sql server using "SQL Server
> Enterprise Manager" results in this error message:
> "A connection could not be established to SERVERNAME - Login failed for
sa."
> Query Analyzer instead gives: "Unable to connect to server. Server Msg
> 18456, Level 16, State 1. Login failed for user sa".
> Searching on the net I have found a bunch of good ways to follow, even
> if they all require to join into Windows as Administrator user (and
> thus, using Windows Authentication mode).
> However I can't proceed because the server that runs SQL Server is
> Windows 98, thus Windows Authentication Mode is not available.
> Can you help please?
> TIA,
> Paolo|||Keith Kratochvil wrote:
> I do have one final idea: Shut down the "server" copy the database files,
> and attach them to a new server. At least you will be able to access your
> data.
>
Thanks for the suggestion, it worked!
I copied a pristine master database from a vanilla sql server
installation to the "locked" sql server, then the databases containing
datas has been attached using sp_attach_db.
Finally I have specified a non blank password for user sa...
Regards,
Paolo|||I am glad that you were able to figure things out!
Keith
"Paolo" <paolo@.red.it> wrote in message
news:%23a6VLoOkEHA.3844@.TK2MSFTNGP12.phx.gbl...
> Keith Kratochvil wrote:
>
files,[vbcol=seagreen]
your[vbcol=seagreen]
> Thanks for the suggestion, it worked!
> I copied a pristine master database from a vanilla sql server
> installation to the "locked" sql server, then the databases containing
> datas has been attached using sp_attach_db.
> Finally I have specified a non blank password for user sa...
> Regards,
> Paolo