|
Hi this is my query to auto generate one field value...,
select @empId=isnull(max(empId),100)+1 from tbltempemployee
This will generate the number 101,102,...etc
But i want to store the value as L101,L102,...,
It means while auto generate the value i wnat to add one more alphobet letter before that value and store...,
How to do that,
Plz any one hlp me,
Magesh
|
|
|
|
|
set @empID = 'L' + @empID
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Magesh,
The case when only one alphabet is used:
select @empId='L' + cast(isnull(max(substring(empId,2,len(empId))),100)+1 as varchar) from tbltempemployee
The above query will take the max of the existing records leaving the first character and will add "L" to it.
Senthil
|
|
|
|
|
halloo ..
i'm newbie in ADO.Net.
i want to ask about trigger in sqlserver2000.
i develop ado apps with c#. my case is ...
client 1 open add employee form, client 2 open list of data employee.
client 1 add employee data. if client 2 doesnt click button refresh, so new data is doesnt appear, right ? so i want sqlserver make the trigger to the client and auto refresh the list data so that the data auto appear in list without user in client 2 click resfresh button or the application make auto refresh with function.
thanks.
thanks vian.
|
|
|
|
|
Please don't cross post.
No, you can't.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
you can not do that
Rami Abdalhalim
|
|
|
|
|
so, i still must refresh in form list data ?
|
|
|
|
|
you need to timer at 1 sec refresh data just
Rami Abdalhalim
|
|
|
|
|
hi all,
i have a value entered by user into a text box, i want to search the table for the detail of the entered text.
plz provide me with the syntax to do such thing
Regards
|
|
|
|
|
you need to use LIKE operator to search for a given string.
SELECT Column1,Column2 from Table1 where SearchColumn LIKE '%' + @SearchString + '%'
hope this helps...
Regards John
|
|
|
|
|
this solution if you use string
Select * from tableName where ColumnName = '"+textbox.text+"'
this solution if you use integer
Select * from tableName where ColumnName = '+textbox.text+'
Rami Abdalhalim
|
|
|
|
|
Hi,
Which Rights are needed to create and replace view in oracle, that user already have rights to create view, but it get the insufficient privileges while creating a view.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
hi i have java script code for uploading images or files for a joomla component and i am not able to store this images or files in data base tell me the procedure for storing the images in a data base and i don't no data base in depth please let me know its urgent..........
|
|
|
|
|
Sorry, but there is no Access forum.
In a sub-form for detail lines, I'm trying to respond to the entry of a bar-code, using the After Update event of the bar-code combobox, where I set the Product name textbox in the same detail line to the ProductName value in the combobox. I'm sure I've done this before, and it only affects the current record, but now when I update the bar-code, the text the product name textbox in ALL lines gets updated.
Private Sub ddlProduct_AfterUpdate()
txtProductName = ddlProduct.Column(2)
End Sub
I do not believe they are right who say that the defects of famous men should be ignored. I think it is better that we should know them. Then, though we are conscious of having faults as glaring as theirs, we can believe that that is no hindrance to our achieving also something of their virtues. - W. Somerset Maugham
My New Blog
|
|
|
|
|
I couldn't add new registration in SQL Server2000 using SQL Server Authentication mode even I've already entered correct server name, username sa and correct password.
I've tried to ping this server from command line and it's ok.
But if I run Windows Explorer (\\servername) and put Windows'username and password then add new registration again, it's successful.
Please explain me why? I want to add new registraion from some server which I only have SQL Server username and password but don't have Windows username and password. Is it possible?
adfafafa
|
|
|
|
|
hdtrung wrote: Please explain me why?
Does the server process accept remote connections? Is there a firewall blocking the TCP port it is using?
Have you installed a named instance? If so, then you need to specify the name as well as the machine.
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
Hi Colin Angus Mackay,
I used default instance (MSSQLSERVER) when installing the server. I think there's no problem with TCP port or remote connections(no firewall,my computer and server are in the Wide area network).
The server is also running in SQL authentication mode. That's why I gave username sa and password when adding new registration.
Following are all the complicated steps I must do to add new registration:
Ping SERVERNAME to check connection
Add new registration, using SA and SApassword
The previous step failed, then run windows explorer (\\SERVERNAME)
Put windows logon info: SERVERNAME\trunghd & mypassword
Add new registration again and it's successful
If I add registration from some server that I've already entered windows logon info once, it's successful too.
The question is why I have to give Windows logon information to the server when it's running in SQL authentication mode. I found no relation between my Windows username in this server with the installed SQL server in it.
Thank you very much for your answer.
adfafafa
|
|
|
|
|
HI All,
I have a frustrating problem with continual login failures with SQLExpress 2005.
I have an application that behaved until yesterday when I started adding some extra Crystal reports.
I get either of two errors:
1. "Cannot open user default database. login failed for TECRA\Nigel"
Or
2. some big long system error (32) saying the file is in use.
When first entering VS, I can either create a dataset or open server explorer, but after that trying to do either throw the error(s).
To clear the error i have to close down VS, restart SQL server manager and reset IIS, but it is back next time I try to do anything with the DB.
Folder permissions are OK for both ASP.NET and NETWORK SERVICE. I have even resorted to deleting the new reports and datasets but now I get the errors regardless.
I am sure I must have done something to the DB, or maybe there is a dud connection somewhere, but I have limited knowledge of SQL Server Manager Express so don't know where to look to stop the errors.
Connection string is:
<add name="cs_BigShakti" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SHAKTI.MDF;Integrated Security=True;User Instance=True; Connect Timeout=30;Initial Catalog=SHAKTI" providerName="System.Data.SqlClient"/>
Many thanks in advance,
Nigel
|
|
|
|
|
big_nige wrote: Initial Catalog=SHAKTI" provider
Why do I see an extra quote after SHAKTI?
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
Hi,
How can I create a DTS Package using Sql-DMO in a Stored Procedure. I am
using Sql Server 2000.
Saswat.
|
|
|
|
|
1-To connect to the distribution database and provide published data to the DTS package (source connection), a special OLE DB provider, the Microsoft SQL Server Replication OLE DB Provider for DTS is used. When you create a transformable subscription, this provider is installed automatically on the
DTS package, and cannot be changed. This provider can be used only with transformable subscriptions.
The connection from the DTS package to the Subscriber (destination connection) does not use the Microsoft SQL Server Replication OLE DB Provider for DTS; it uses whatever OLE DB provider is required to connect to the Subscriber. For example, you would use the Microsoft OLE DB Provider for SQL Server to send transformed data to a Microsoft® SQL Server™ 2000 Subscriber.
2-Only SQL Server (the Microsoft OLE DB Provider for SQL Server) Subscribers and other OLE DB Subscribers can use transformable subscriptions; ODBC Subscribers will not work with transformable subscriptions.
Rami Abdalhalim
|
|
|
|
|
I'm writing an ASP .NET 2.0 application, and I have the following code:
Public Function GetRow(ByVal Id As Guid) As DataRow
Return Me.mDataSet.Table(0).Rows.Find(Id)
End Function
But an exception is thrown at the line: Return Me.mDataSet.Table(0).Rows.Find(Id). I copy the exception details bellow:
Error de servidor en la aplicación '/Proyecto03'.
--------------------------------------------------------------------------------
Se esperaban los valores 2 para la clave indizada, pero se han recibido valores 1.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
Detalles de la excepción: System.ArgumentException: Values 2 expected, but instead values 1 were received
This is anoying, because the Find method has two overloaded versions: one accepts an Object as parameter and the other accepts an array of Object, so a Guid object should pass without problems. The only thing that comes to my mind is this: There is a special way to make it with the Guid type, but I can't find anything neither the MSDN Library, nor the internet.
Please, help!!!
Bye
|
|
|
|
|
reinaldo.aru wrote: Se esperaban los valores 2 para la clave indizada, pero se han recibido valores 1.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
Detalles de la excepción:
To tell you the truth I dont understand any of that!
but as far as ur error is concerned I think what ur doin is that you're passing a single object of GUID type to Find and if you see its discription it says that the method takes the primary key value. I think your primary key must be something else and its datatype is not GUID hence the error... (I can be wrong too coz its an assumption)
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
I developed a web application usin c# and mysql as my database. Deploying it to my web server is giving me the following error message:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 20: <compilation debug="true">
Line 21: <assemblies>
Line 22: <add assembly="MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D">
Line 23:
|
|
|
|
|
Have you installed the MySQL provider libraries on the server? .NET does not support MySQL out-of-the-box, as far as I know.
|
|
|
|