UPDATE D set D.feed_id = S.feed_id from DEST D, Source S where D.feed_id = 0 and S.invc_item_id = D.invc_item_id and S.feed_id > 0 Works with MSSQL
Archive for the ‘SQL’ Category
SQL 2005 and SQL2008 Enabling Notifications. SQL Chache Dependancy Part-I
Posted: February 18, 2008 in ASP.NET, C#, SQLTags: SQL Chache Dependancy, SQL Notification, SQL2005
The only configuration step you need to perform is to make sure your database has the ENABLE_BROKER flag set. Use Northwind ALTER DATABASE Northwind SET ENABLE_BROKER Notifications work with SELECT queries and stored procedures. However, some restrictions exist for the SELECT syntax you can use. To properly support notifications, your command must adhere to the [...]
Copy data Of One table to another table with trigger.
Posted: February 14, 2008 in SQL, Tips and TricksTags: SQL, Tips and Tricks, trigger
If you set up a spare log table, you can write the trigger to insert to it if the main log table is empty, like so: CREATE TRIGGER LogRecords ON myTable FOR INSERT AS BEGIN SET NOCOUNT ON IF EXISTS(SELECT * FROM mainLog) INSERT INTO mainLog SELECT * FROM inserted ELSE INSERT [...]
SELECT @@IDENTITY It returns the last IDENTITY value produced on a connection, regardless of the table that produced the value, and regardless of the scope of the statement that produced the value.@@IDENTITY will return the last identity value entered into a table in your current session. While @@IDENTITY is limited to the current session, it [...]
My First SQL Trigger in my life :-). Copy the inserted content to another temporary table with trigger
Posted: February 14, 2008 in SQLOk. This is My First Trigger written by me in life. I Had to copy the inserted content to another temporary table with trigger on insert on that table. Here Server table is the Source table and the tmpServer is the destination table. CREATE TRIGGER dbo.onInsertToServerTable ON dbo.Server AFTER INSERT AS BEGIN SET NOCOUNT ON; [...]
Most of the time I use tns.ora file for Oracle connection. But if i install oracle client or odac then tns.ora file is created and accessed. but some time your client may not have that component. so i need direct connection string. The syntax is: string connectionString = “Data Source =(DESCRIPTION = (ADDRESS_LIST = (ADDRESS [...]
I spent allmost all day spent to search how i return data as output parameter from oracle with the help of Data Access Application Block. Ultimatly I got the answer. Its only solution is the variable name should be cur_Out. The sample code is given bellow. ———————————– CREATE OR REPLACE PROCEDURE sp_EmployeeGetAll ( cur_Out OUT [...]