|
|
Yes David,
thanks for your response, the only one so far that is meaningful! I do plenty of flow charting and process mapping so that's already been covered. I do understand our current system inputs/outputs/relations. I think the real questions center around whether there are some products out there that could be used/adapted to this or if not then what type of database structure/model would be recommended. In this case can any examples or samples from this board be referenced?
|
|
|
|
|
I guess company in which you are working,they need to buy new software to replace that old software.
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.
www.aktualiteti.com
|
|
|
|
|
Hi friends,
I am stucked in a problem. I am trying export the data to the server through export import wizard. The data is going but the primary key and the auto-incrementation on a column was not transfered.
I also tried through generating scripts but same results.
And on the server there is no provision to restore through .bak file.
So please assist me.
cheers,
sneha
|
|
|
|
|
I have used the method of scripting the table schema creating it in the receiving database and then do the copy. It will be interesting to see if there is a one step solution.
Buy the way if you create using MS SQL 2000 you might need to tell it to script the keys.
Good Luck
djj
|
|
|
|
|
You are talking about 2 very different things, the data and a database constraint (primary key).
Are you saying the primary key data is not exporting or that your scripting of the table does not include the primary key?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
In the Import/Export Wizard make sure that you select the contstraints for data transfer.
|
|
|
|
|
hai
what is the escape character for hyphen(-) in SQL?
thanks
mahe
|
|
|
|
|
Try this
\-
Use the backslash character(\) to escape a single character or symbol. Only the character immediately following the backslash is escaped. For example, a query of code\-project matches code-project and code project.
or if you don't at all the hyphen(-) try like this
[^-] . This will negate the character class.
For more information, look here
Regular Expression Basic Syntax Reference[^]
Niladri Biswas
|
|
|
|
|
Hi,
I have one stored procedure for inserting values to 5 tables at a time.So there are 5 insert statements in a single SP.Here some fields are common ie.there is customer address and sponsor address and all these addresses are stored in a single table.Firstly I insert customer details in the customer table and contact details to the contact table.Also sponsor contact addresses are stored in the contact table.How can I handle this
Thanks
Denny
|
|
|
|
|
I assume you have primary key/foreign key relationships happening... if you do, use select @@IDENTITY to find the identify of the item you have inserted, so you can use it in the next insert.
eg:
insert into table1(name) values('Fred')
go
insert into table2(address, nameid) select '10 Smith Street', @@IDENTITY
go
|
|
|
|
|
|
...or look at SCOPE_IDENTITY()
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
hai all
i am facing some problem in SQL.I am searching the one string(ex.roll-over) in table
its returning wrong results.
my table contains,
dable datas
table_1 is table name
number1 text1
1 notify us the day you roll check over.
2 notify us theday you roll check .
3 notify us the day you roll check roll-over.
4 notify us the day you roll check roll over.
my query is
select * from table_1 WHERE CONTAINS(text1, '"roll-over"')
select * from table_1 WHERE CONTAINS(text1, 'roll-over')
in both case i am getting below results.
results
number1 text1
1 notify us the day you roll check over.
2 notify us theday you roll check .
3 notify us the day you roll check roll-over.
4 notify us the day you roll check roll over.
here it should return only one result insted of four.
is there any thing wrong in Query if not can any one help to from the correct query.
i think Bcoz os hyphen the result is returinig either roll or over presents.
thanks
mahe
|
|
|
|
|
What about:
select * from table_1 where text1 like '%roll-over%'
|
|
|
|
|
thanks for ur reply
its working fine.
but
is there any way to form query with CONTAINS key word.
mahe
|
|
|
|
|
From BOL
Is a predicate used to search columns containing character-based data types for precise or fuzzy (less precise) matches to single words and phrases, the proximity of words within a certain distance of one another, or weighted matches.
So you used a fuzzy search key word, got a fuzzy return when you wanted a precise return. Wrong tool for the job.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I need some advice regarding replication of database tables which includes binary data stored as Images.
Currently the database in the server stores PDF files as binary Images in the tables. A web service is used to get data from the .NET application and to store it in the database. There is a new requirement to replicate all this data to another database in a server located at a different site.
Can someone please advise me on the following?
1. Do you think storing PDF files as binary images is the best approach or would it be good to store in a file server? Most PDF file sizes are less than 1MB, but there can be thousands of these created. Currently this is implemented as storing the PDF files as binary images in the database. But, I would like to know which would be the best solution.
2. How will the performance be if, Two-Way replication is used for databases located in different sites and which includes image data?
3. According to my understanding Two-Way replication can only be implemented using SQL Server 2005 and SQL Server 2008. Is that correct or can it be implemented using older versions as well?
4. Is there any other way than, using Two-Way replication to replicate data (which includes image types) to a database server located at a different site? Please note that image data on one server needs to be deleted after a certain action is made and it will remain on the other to gather the history.
5. What sort of an internet connection is required to perform replication between two sites?
I would greatly appreciate if someone could advice me on the above.
Thanks!
|
|
|
|
|
userid status phone_number
1 0 111
2 1 111
3 0 222
4 1 222
5 0 333
6 1 444
For the above table I want write a SQL query to swap the value of "status" column for duplicate rows. Duplicates can be identified if phone number is same. The output would look like as below (affecting only 1,2,3 and 4).
userid status phone_number
1 1 111
2 0 111
3 1 222
4 0 222
5 0 333
6 1 444
Any help is appreciated. I always find it always hard to write even a simple SQL query
|
|
|
|
|
You will need to do it in two parts...
First, create a query that returns duplicate phone numbers, like this:
select phone_number
from TABLENAME
group by phone_number
having count(phone_number) > 1
Then, you can use some white-man-magic to reverse your statii (assuming you want to switch 0 for 1, and 1 for 0), like this:
update TABLENAME
set status = abs(status - 1) -- This means if status is 0, you get abs(-1) which = 1
where phone_number in
(
select phone_number
from TABLENAME
group by phone_number
having count(phone_number) > 1
)
See how we use the first query to restrict the update query?
|
|
|
|
|
That was real quick! thank you!
|
|
|
|
|
No worries! Thanks for your feedback...
|
|
|
|
|
No need for abs: new = 1 - old suffices.
|
|
|
|
|
True...
|
|
|
|
|
I have a MQ-SQL 2005 stored procedure that returns a dataset that is fine except I would like to change the rows to the columns and the columns into the rows. Is there an easy command to do this, or is pivot the only option (which is not easy)?
Thanks,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|