|
I have two database : Db1 and Db2
I want to fill tables of Db2 with some fields of Db1 tables
also I do`nt want to use from Import & Export wizard
do you have any idea
Hello Friends
|
|
|
|
|
If they're on the same server, you can prefix the owner.tablename with the database. So, suppose that you had Database1.dbo.MyTable and Database2.dbo.MyTable, you could do the following (as an example):
INSERT INTO Database2.dbo.MyTable<br />
SELECT * FROM Database1.dbo.MyTable
Obviously, you will need the relevant permissions in both dbs to do this.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My database table consists a Field (Called ApplyDate)store the integer data, like "20061122" represent 22 nov 2006. i need to filter the data for whole November 2006, but if i write SELECT....WHERE ApplyDate = 200611 , it cannot get the data out because the last two digit no specified. So , how i write the SQL Where statement if i want to select Whole Nov 2006 ? (for example, 20061101...20061130 also acceptable)
Best regards,
Chee ken
|
|
|
|
|
why dont you use like command
example
SELECT....WHERE ApplyDate like '200611%'
this will give you proper result
|
|
|
|
|
Thanks for your reply. I also have thinking using LIKE , but if the date is 20200611(11 Jun 2020 ), then my data is getting wrong already ! aLthough the date is many years later, but i just thinking have any other way to get the correct data, any idea ? thanks.
Best regards,
Chee ken
|
|
|
|
|
"Where ApplyDate >= 20061101 and ApplyDate < 20061201"
|
|
|
|
|
I have Created a FullText Indexed table to store the Doc files.
I want querying the DocAuthor,Size, etc.. from Full Text catalog, not from OS Physical file.
I am using Sql Server 2005.
Regards
Fenil
|
|
|
|
|
please, with code and thank u another time
|
|
|
|
|
|
|
|
You're welcome.
BTW, it is customary to just replay to the same post, rather than staring a new one. That makes it much more likely that the person you are replying to will actually see the post, since replying sends an anonymous email. If you create a new psot, it may scroll off the current page long before the person you are addressing revisits that forum.
|
|
|
|
|
Thank you Christian Graus but please, explain your answer as i am beginner and give me an example.
|
|
|
|
|
To rephrase Christian's answer:
1. create a table with a field of type LongVarBinary to hold the wave file (a blob field)
2. read the wave file into a byte array.
3. store the byte array in the LongVarBinary (blob) field using a parameterized query, with the byte array as the value of the parameter.
|
|
|
|
|
please,how can i insert wav data type " audio files " in sql server 2000 database ?
|
|
|
|
|
As binary data, probably a blob
Christian Graus - C++ MVP
|
|
|
|
|
im trying to create a get records function that searches the database for a value and returns all records that match that value. I originally had to working with pure sql, but my professor said i should make my function use parameters. My problem is searching strings. In my original sql statement i used the following to search for strings.
sqlString = "SELECT * FROM " & genTable & _
" WHERE (((" & genTable & "." & field & ")Like'?%'));"
My ill attempt to create a parameter based is as follows
sqlString = "SELECT * FROM " & genTable & _
" WHERE " & field & " Like '?%'"
Any ideas on whats wrong ???
|
|
|
|
|
Whoah. Don't go there. Do not do a query like that EVER. This just cries out for a SQL Injection attack. Search for Colin Angus Mckay's article on SQL Injection to see why this is a really bad idea.
I suspect that the parameters that your professor was talking about were SqlParameters (assuming that this is a .NET application) or some similar.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey everyone, im a little stuck here
basically i have a SQL 2000 function like this:
<br />
CREATE PROCEDURE GetTaskListForSupervisor<br />
as<br />
declare @rowcount int<br />
set @rowcount = select count(id) from TimeStudy<br />
<br />
GO<br />
Obviously, that doesnt pass the syntex check, but can you see what id like to do? just put the count of all the rows into a locally declared variable? Im a bit out of my depth here so could someone pull me back into shallow waters please
Cheers
Will
|
|
|
|
|
"select @rowcount = count(*) from TimeStudy" ;no advantage to count(id) over count(*)...
|
|
|
|
|
|
thanks guys
Excellent forum - excellent help!
|
|
|
|
|
you may use like this:
declare @ROWCOUNT int
select @ROWCOUNT = count(id) from syscolumns where id = 1
if @ROWCOUNT > 2
print @ROWCOUNT
else
print 'Less'
|
|
|
|
|
i have two tables in my data base named tableA and tableB
tableA and tableB have a filed named (Eid),, how do i know from tableB that it shows me that particular record which is not in tableA
hello
|
|
|
|
|
select * from tableB b where not exists ( select * from tableA a where a.Eid = b.Eid )
Chris Meech
I am Canadian. [heard in a local bar]
I agree with you that my argument is useless. [Red Stateler]
Hey, I am part of a special bread, we are called smart people [Captain See Sharp]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|