|
Hey Venu,
Please elaborate a bit more on what exactly are you looking for inside your C# code.
Are you trying to transfer data between different databases having identical schema from inside your C# code or you want to query different database at the same time???
Robin
|
|
|
|
|
hi robin.
actual i want to transfer the entire table structure along with datafrom local sqlserver to hosting sqlserver using c#
|
|
|
|
|
This is usually achieved by backing up the local database and restoring it on the host.
Additionaly you can script the database and uses SSIS to move the data
Or use SQL Compare from http://www.red-gate.com/index.htm?gclid=CLDSwcDM6JsCFcItpAod-kAU5Q to move the code and Data Compare to move the data. This is what I use.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi venu,
server1 database structure is static or dynamic??
icanmakeiteasy
|
|
|
|
|
|
then if the table structure is static create a script file for server1 database.., read that file from c#, then manipulate it...
icanmakeiteasy
|
|
|
|
|
Help!!!
How can I find specific value from a field in a select list where the specific value varies in position.
ex;
Record1 A-'Telec:144'
Record1 B-'Telecom:145'
How to find the ":" using the SQL so I can get the 2 value in one field.. pls..
Dabuskol
Dabsukol
|
|
|
|
|
Use substring to get the characters, and charindex to find the :
declare @a varchar(20)
set @a = 'Telec:144'
select substring(@a,1,charindex(':',@a)-1),substring(@a,charindex(':',@a)+1,len(@a))
will return Telec for the first 1 and 144 for the 2nd
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
You are correct... Thanks for the immediate reply you save me on my last minute.
Thanks...
Dabsukol
|
|
|
|
|
No problem
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Link Directory Submitter is the perfect solution for sending your sites to a multitude of pre-configured online directories. Link Directory Submitter comes with 2700+ link directories to submit to, more than half ranging from PR4 to PR7. Visit us at: http://www.clicknearn.net/3016-53.html
|
|
|
|
|
If you want to advertise, try paying for it - and if your product was that good you would be found straight away by anyone googling.
And its a rubbish web site, full of spelling and grammatical errors anyway.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I am using the following stored procedure to insert into two tables and it works fine
ALTER PROCEDURE createEmployee(@loginId VARCHAR (20), @username VARCHAR (25), @passwrd VARCHAR (25),@empId VARCHAR (20),@title varchar(5),@branchNo VARCHAR(20),@Fname VARCHAR(50),@idNo VARCHAR(13),@physicaladdress varchar(50),@province VARCHAR(50),@city VARCHAR(50),@telephone varchar(15),@cellNo VARCHAR(15),@Email VARCHAR(30),@employeetype varchar(15),@salary NUMERIC(11,2))
AS
INSERT INTO LoginInfo VALUES(@loginId,@username,@passwrd)
--SET @loginId=@@IDENTITY
INSERT INTO EMPLOYEE VALUES(@empId,@loginId,@title,@branchNo,@Fname,@idNo,@physicaladdress,@province,@city,@telephone,@cellNo,@Email,@employeetype,@salary);
But Note the @branchNo parameter to be inserted into the EMPLOYEE table. I need to get it from a table named BRANCH based on some criteria. Currently I have hard coded its(@branch parameter)its value.I've tried to use the column level Select subquery but it is not allowed. please give a junior developer some logic
ML Lingwati
|
|
|
|
|
How about:
INSERT INTO EMPLOYEE
SELECT
@empId,
@loginId,
@title,
branchNo,
@Fname,
@idNo,
@physicaladdress,
@province,
@city,
@telephone,
@cellNo,
@Email,
@employeetype,
@salary
FROM BRANCH
WHERE someCriteria
In case thats a bit confusing, you can pull the branchNo from another table while still using all your variable for the other columns to be inserted.
|
|
|
|
|
Hi
I have 2 tables, one is with primary key and the other is foreign key. There is one to many relation between the two tables.
i have written query by joining them as below.
But as the 2nd table has more than 1 row, duplicates are coming in the output.
Hence i want to query in such a way that no duplicates should come. Is there any way for this?
Is it possible to write as below....
select table1.col1, (loop through all the rows in table2 and form a srting of the values) as col2 from table1
Thanks in Advance
Regards
Naina
|
|
|
|
|
You can fix by using distinct or grouping.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
No i couldnt do so.....it is not fixed. Still there are duplicates coming out...
|
|
|
|
|
What you are trying to do is called pivoting. If you google for that you wll find loads of examples.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I dont know about pivot in sqlserver 2005. Thanks for giving me clue. I will check for that.
Regards
Naina
|
|
|
|
|
Pleased to help.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I am creating a C# web application to create dynamic forms. The user can define the form, generate its layout. This form would be availble for transaction.
I am having a query in saving the transaction details of the dynamic form. Can we build seperate tables for each form or can we use the same table to store data of all the forms. Which would be the effecient way?
The DB that we are using is Oracle 10g.
Thanks in advance.
|
|
|
|
|
Friends,
I stored my 200 values in an array and that 200 values represent one record.
It is easy to insert 'n' record, that i did N no. of times with MAX of 20 values but this is first time im supposed to insert this large no. of values.
So donno how to do...
HELP!!!
|
|
|
|
|
I'd look at your database design and see if a table with 200 columns is really necessary. If it is, you can create an SP with 200 parameters or generate a massive insert statement (both of which are not good solutions!)
|
|
|
|
|
You could pass the values into the stored proc as xml and work from that.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
I prefer a method that will handle generating the query and parameters automatically, that isn't hard-coded to any particular table.
|
|
|
|