|
scorp_scorp wrote: What are those two???
You are getting the data from one place - that is data source one.
You are putting the data some place - that is data source two.
scorp_scorp wrote: Can you be more clear, what should i do ?? detailed plz ??
1. Get data - put it in a collection of some sort.
2. Write the data - by using the collection.
|
|
|
|
|
Thanks for your follow man, but seems that we r not on the same channel..
jschell wrote: You are putting the data some place - that is data source two.
Putting data in some place , could be considered as Data Source ??? i dont know
jschell wrote: 1. Get data - put it in a collection of some sort.
2. Write the data - by using the collection.
U i tried to use 2 recordsets also didnt work, u mean that they should be done in two events ??
Any article?? any explanation ?? any examples ?? if you can provide .... most thanksfull
0 will always beats the 1.
|
|
|
|
|
mail is configured in sql server and it sends mail properly but sometime when i send mail from sql server then i saw the message like "Mail queued." but i dont get the mail. so then i check the mail status by a sp like EXEC msdb.dbo.sysmail_help_queue_sp @queue_type = 'mail'; then i see the mail state is NOTIFIED. then i just stop and start the mail queue using sp called sysmail_stop_sp and sysmail_start_sp. it is often happening in my sql server mail is getting queued but not sending. i am not being able to catch the problem why often my sql server mail state becomes Notified. please help me that how could get come out from this problem.
thanks
tbhattacharjee
|
|
|
|
|
Hey guys, i have wroted some sp's on some server and they used to work well on that server. then i took a backup of the database and restored it on another server so when i tried to run my sp's i got the exception "Must Declare Scalar Variable".
for instance:
Declare @BankName int;
Set @bankname = 1;
Results in:
Must Declare Scalar Variable @bankname.
any help. thank you.
|
|
|
|
|
The SQL Server instance you restored to is set to case sensitive, therefore the you have not declared @bankname
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
ok Sir, i understand that but i want a solution.
|
|
|
|
|
So think about what I said, your sql server settings need to be changed, go find the setting and change it. Note depending on what database you have installed you may need to reinstall the sql server instance to change that setting.
I suggest you prove that I have identified the problem first!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
yes sir you have identified the problem.
My Database is MS SQL 2005 Developer Edition.
when I installed it in "Collation Sitting" step of the wisard i checed "Case - sensitive" checkbox.
|
|
|
|
|
I think with 2005 you need to reinstall the instance, you may want to look into changing the collation settings but I don't think you can change the case setting.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you, Sir.
100
|
|
|
|
|
Ali Al Omairi wrote: 100
What it mean it's a virtual points to Mycroft or bless of 100 year to live.
Regards,
Hiren.
be good(Help people in CP),do good(Vote if one finds helpful) all will happen good, In case happens bad(You are getting downvote for your best try to help OP) it will be good for later after(Countered with more points by humble member). - Gita sar in context of CP.
-So Guys don't care about downvote believe in you.
|
|
|
|
|
Sir, In Jordan we use the expression "A hundred of flowers" often to say that every thing is ok. we also use it to thank people and to say hi to them.
|
|
|
|
|
Interesting cultural tidbit, Ali. I never know what I'm going to learn when I stop by CodeProject.
Will Rogers never met me.
|
|
|
|
|
That's good to know, Ali.
Thanks 100 to you too for that.
Regards,
Hiren.
-"I don't know, I don't care, and it doesn't make any difference".
|
|
|
|
|
Sir, Since you told me so i was trying to reinstall the software
but i had some problem with some components
1- MSXML6
2- SQL Server Database Services
what can be the reson
Call me "Abu AlHassan", Please.
|
|
|
|
|
I am currently writing a stored proc for a database that will help create a new user. The logic I am using is something I had used before, but then I had used three separate stored procs and thought it would be more effecient to just call one stored proc to handle the whole job. Here are the tables I am using:
users:
userID (primary key, IsIdentity turned on)
firstName
lastName
sex
authenticationID (foreign key that points back to the authentication table)
contactID (foreign key that points back to the contact table)
authentication:
authenticationID (primary key, IsIdentity turned on)
userName
password
contact:
contactID (primary key, IsIdentity turned on)
street
city
state
emailAddress
In my stored proc, I pass in all of the parameters needed for each table (listed above, except, of course, the identity fields) and start the inserts. Since I need the contact and authentication inserts done first, I naturally would want to start with those tables, but how would I get the ID fields for each tables so I can insert them into the users table?
|
|
|
|
|
The sproc could return it using a output [^]-parameter. Or you could write a function instead of an sproc, and have that return the identity. Or you check the latest identity values for your transaction
I are Troll
|
|
|
|
|
Use the @@IDENTITY function within the SP
|
|
|
|
|
Nevermind. Did a little bit of experimentation and got it to work. Thanks for all the input though.
|
|
|
|
|
I think this is what you need.
Just fill the blanks....
<code>
-- =============================================
-- Author: Martin Arapovic
-- Create date: 19.01.2011
-- Description: ....
-- =============================================
CREATE PROCEDURE InsertUserData
(
-- Add the parameters for the stored procedure here
-- Define needed parameters
-- Contact Input Data
@Street VARCHAR(50),
@City VARCHAR(50),
@State VARCHAR(50),
@EmailAddress VARCHAR(50),
--Users Input Data
@UserName VARCHAR(25),
@Password VARCHAR(25),
-- User Input Data
@FirstName varchar(50),
@LastName varchar(50),
@Sex varchar(50)
-- Add other paramas if you have any
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @ContactID INT
DECLARE @AuthenticationID INT
--
-- Note: This is only skeleton of the proc that you want to implement
--
-- Do all in one transaction
BEGIN TRANSACTION
--
-- Insert Contact data and get ContactID
INSERT INTO [Contact]
([Street]
,[City]
,[State]
,[EmailAddress])
VALUES
(@Street
,@City
,@State
,@EmailAddress)
-- GET CointactID
SET @ContactID = SCOPE_IDENTITY()
--
-- Insert Authentication data and get AuthenticationID
INSERT INTO [Authentication]
([UserName]
,[Password])
VALUES
(@UserName
,@Password)
-- GET Authentication
SET @AuthenticationID = SCOPE_IDENTITY()
--
-- Insert Users data into users table.
INSERT INTO [Users]
([FirstName]
,[LastName]
,[Sex]
,[AuthenticationID]
,[ContactID])
VALUES
(@FirstName
,@LastName
,@Sex
,@AuthenticationID
,@ContactID)
-- Commit
COMMIT TRANSACTION
-- This is the general example and you need to add error handling and
-- other bussines logic if you have any... :)
END
GO
</code>
|
|
|
|
|
Hi!
Is there a way to compare data of the same table in two different databases?
Thanks!
|
|
|
|
|
Export to text files and use a difference tool on the files. Just one suggestion.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
You can do it that way but shame on you!
|
|
|
|
|
Actually it's not the only way I do it, but I have found it a useful way when 'migrating' an application from one physical DB to another. I usually automate it so that I have only to review a log report of any differences that are actually discovered. But considering that there are many reasons for comparing the data, until you know all the requiremens, sometimes the simple solutions work best.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
What database server are you using?
|
|
|
|