|
Thanks for the reply Alomgir.
Can you pls elaborate? I think updated.colname will give the value after the execution of query. How can I get the previous value, so that I can compare both.
Regards,
Shah Adarsh.
|
|
|
|
|
I got the answer . deleted table contains the old record and the inserted table contains the newer one for update operation trigger.
Regards,
Shah Adarsh.
|
|
|
|
|
Hi there,
I am just trying to create an ENDPOINT to define a Web Service in Sql
server 2005. Here is my code
Create ENDPOINT AWService
STATE = STARTED
As HTTP
(
PATH = '/ADVENTUREWORKS',
AUTHENTICATION = (INTEGRATED),
PORTS = (CLEAR),
SITE = 'DEVI\SQLDM2005'
)
FOR SOAP
(
WEBMETHOD 'GetProductList'
(NAME = 'AdventureWorks.Dbo.GetProductList'),
DATABASE = 'AdventureWorks',
WSDL = DEFAULT
)
and when i run this T-SQL its complaining about
Msg 7807, Level 16, State 1, Line 1
An error ('0x80070057') occurred while attempting to register the
endpoint 'AWService'.
I am trying this code to run on Windows XP pro and Sql Server 2005. Any
clue why its complaining about this ?
Thanks
-D
|
|
|
|
|
Hi,
I'm using update trigger for inserting a record in a table(say table2) when the value of certain column(Column2) is changed in table1. My code executes UPDATE query on table1 everytime when any column is updated.
My SP is something like
UPDATE table1 SET Column1 = @Column1, Column2 = @Column2
WHERE ID = @ID
I have checked the following condition in Trigger
IF UPDATE(Column2)
INSERT INTO table2...........
So even if Column1 is updated the INSERT query in trigger will be fired.
So the record is inserted into table2 everytime the update query is executed on table1, irrespective of which column has changed.
Regards,
Shah A
|
|
|
|
|
As far as I can see in you UPDATE statement, both Column1 and Column2 are updated, so Column2 is always updated. Even if you put back the same value in Column2, as far as SQL is concerned, it is updated.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Yes but how can I compare the previous and current values for Column2 in the trigger to know that it has changed.
Thanks for the reply Marilyn.
Regards,
Shah Adarsh.
|
|
|
|
|
I got the answer . deleted table contains the old record and the inserted table contains the newer one for update operation trigger.
Regards,
Shah Adarsh
|
|
|
|
|
Hi:
I am connecting to my SQL server from my windows application localy using either SQLConnection or ODBCConnection and they are working fine but when i try to connect to the server from another PC in the Lan i cannot connect through SQLConnection from my application.
but what have i tried is to connect using odbcConnection and ODBCComand and it connected normally.
What Do i need to setup in the client computer So it Can connect from the Windows Application Normally By using SQL Connection and SQLCommands?
Do I need to setup:
1- A new ODBC System DSN with a SQL Server Driver!!
2- SQL Service Manager (How Do I Get It)
3- Define a new DB user for Clients (I am using it with ODBC Already)
4- Connection string in my application (I am using "Data Source=jedfin-nb0077;Initial Catalog=inventory;User ID=sharifin")
5-In the FORM in QUERY ("SELECT Count(*) FROM [jedfin-nb0077].inventory.sharifin.inventory_item")
Please Help and Thanks in Advance.
|
|
|
|
|
I have written a store procedure to insert a record which contains a parameter that contains loginname which is of type string. i want to trim this parameter in store procedure.
can any one help me in how to do this.
thnx.
|
|
|
|
|
LTRIM()[^]
RTRIM()[^]
SET @YourParam = LTRIM(RTRIM(@YourParam))
Jon Sagara
Look at him. He runs like a Welshman. Doesn't he run like a Welshman? Doesn't he? I think he runs like a Welshman.
Sagara.org | Blog | My Articles
|
|
|
|
|
Thanks for the suggestions, Jon
I tried it and my problem got solved.
Praveen.
|
|
|
|
|
I'm trying to create a view from the Visual Studio Server Explorer. One table I want to include belongs to a different database. When creating a view it only allows you to pick tables and views from within the database your working in. How can I pick a table from a different database for my view?
Thanks for any help on the matter.
|
|
|
|
|
Hi there. You can fully qualify each table with the syntax database.schema.table. For example, to fully qualify the Categories table in the Northwind database, you can use Northwind.dbo.Categories .
|
|
|
|
|
How do you do that within the Server Explorer? Thanks.
|
|
|
|
|
Does it work to make sure "Show SQL Pane" is turned on, then type in the fully qualified name in the sql itself?
|
|
|
|
|
Anyone can teach me how to connect two or more pc sql server together in a local area network?
chung
|
|
|
|
|
Please put a little more effort into your question and I will try to answer...
What type of connection?
What is the expected use?
Is the a fault tolerance question?
Most important, what have you tried???
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Sorry, i m still new in sql server.And i also new to this forum.
i want to connect few pc sql server together so my system can run at few pc and share same database.
i have tried to do new sql server registration but it fail to connect other pc sql server. i use window authentication and then the other pc i try to connect together also use windows authentication.
chung
|
|
|
|
|
I hope I undrstand what you are trying to do, you have several PC's that you want to connect to an SQL server.
You want to connect to them at an application layer not through code in a project.
Is that correct???
If you just want to connect to an SQL server at the application layer...
Create a DSN entry on "Data Source ODBC" and use the "sa" user to test connectivity.
Create a System DSN follow the wizard and then press "Test Connection" see if this works.
Check it is not XP SP2 or a firewall configuration that is stopping you, check the web there are several sites that can walk you through this.
http://support.microsoft.com/kb/841251/[^]
See how you go.
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Hi,
The records of the DataSet were loaded from Web Service. I wanna save the records to MS SQL Server table. How can I do? I get a idea: Save the data to xml documents by WriteXml() method, and load the data from xml into SQL Server table. If I do like this , how can I load the xml's records into table? Thanks!
|
|
|
|
|
Are you looking for this
using System.Data.SqlClient;
public DataTable ReturnDataTbl(string XmlFile)
{
DataSet dset = new DataSet();
FileStream fstr = new FileStream(XmlFile, FileMode.Open, FileAccess.Read);
dset.readXml(fstr);
DataTable dtbl = dset.Tables[0];
fstr.Close();
dset.Dispose();
return dtbl;
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hi
I have the below sub the reads a single row table and populates the results in a data grid. Some of the fields have numerical values to represent settings.
E.G.
SecurityLevel
1
1 may be admin, so how to I replace the 1 with admin before I populate my datagrid?
Dim Command1 As SqlCommand = New SqlCommand("SELECT [Name], Type, SecurityLevel, Version, CreatedDateTime, Driver, CabinetType, NetworkAddress, LoginFlag, DomainName, AuthenticationType, WebServerAddress FROM dbtab")
Command1.CommandType = CommandType.Text
Command1.Connection = SQLConnection1
myDataSet = New DataSet("myDataSet")
SQLAdapter1.SelectCommand = Command1
SQLAdapter1.Fill(myDataSet, "Document")
DataGrid2.SetDataBinding(myDataSet, "Document")
About 4 of the Columns in the above select statment have values that I would like to replace bases on a lookup list.
OK BIG point I CAN NOT make an intermediate table
Any thoughts
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Replace SecurityLevel in your Sql statement with a case statement structured as needed.
CASE
WHEN SecurityLevel = 1 THEN 'Administrator'
WHEN SecurityLevel = 2 THEN 'Supervisior'
ELSE 'User'
END As SecurityLevel,
|
|
|
|
|
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.webcontrols/browse_thread/thread/e3de64786d1684a2/be32e7aefcb96da6?lnk=st&q=DataGrid+display+custom+value&rnum=1&hl=en#be32e7aefcb96da6
Live Life King Size
Alomgir Miah
|
|
|
|
|
hi buddies
Can anyone help me to get connected with the Oracle 8i through c#. i am using asp.net1.1 and
1. not able to see the "OracleClient" namespace after the "system.Data ".How can i get it.
2. if I want to get connected through Oledb. how can i do that.
Thanks in advance.Please someone help me fast. its urgent.
bye
nauty
|
|
|
|