I am creating stored procedure in SQL Server 2008. I'm a little confused on how to group a specific column only when it meets the criteria below. Can anyone help? I have notes in the code below. Thanks.
Criteria:
1) @Coverage & @GroupByMain are optional i.e if a null value is passed for these...
Thanks everyone! George I changed my "IF EXISTS" statement (see the code below). It's no longer duplicating records, however the update function is not working now.
USE [cashNotification]
GO
/****** Object: StoredProcedure [dbo].[Upt_DCF_Balances] Script Date: 12/17/2010 13:33:17 ******/...
I can't change the table structure, so I'm forced to do this in the stored proc. What if I don't know which parameter would be null at any given time? How do I code this? I'm a newbie so I really appreciate your help!
Heather B...
Yes I am passing in a null value for "HiNetMinor". I changed the code (see below) and it still doesn't work. Any suggestions?
------------------------------------------------------------
USE [cashNotification]
GO
/****** Object: StoredProcedure [dbo].[Upt_DCF_Balances] Script Date...
I'm trying to create a stored procedure that updates records when they exist, and creates a new record when they don't. The code I'm using is duplicating the existing records. Can anyone help?
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
USE [cashNotification]
GO
SET ANSI_NULLS...
Thanks for everyone's help. I figured it out. The error was in my loop statement. Below is the corrected code.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Loop around the SQL recordset to populate the local recordset and update tblHiNet_Data
Dim intCount As Integer
If rs.EOF =...
Below is the code where I verified the rsSQL is pulling the correct # of records from Sybase. When I run this it prints the exact amount of records that should be put into the local Access tables. When I use this same SQL Statement in my main code (above), it doesn't work...
rsSQL" shouldn't be empty because the data is coming from "rsSQL.Open cmdSQL" which is the T-SQL code pulling the data from Sybase. I do want to delete all records from "rsL" (record set Local i.e. "tblHiNet_Data"), however "rsSQL" should have data in it. Can you tell me how to go about changing...
I'm trying to create local Access tables for data linked via ODBC from Sybase (I know the SQL code connecting to Sybase is correct. I tested it in a diff module and it returns the exact # of records). I would like to create tables within access, but I can't get the code to work. Any help would...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.