|
Hi i'm using a stored procedure ..
Which contain the function dbo.split(....)
When i try to use this stored procedure in the local it works fine.
when i try to use that stored procedure i get the error invalid object dbo.split
can some one please help
Thank you
Hepsi
|
|
|
|
|
This sounds to me like you've got a stored function on your system called Split, and you haven't deployed it to your live server. You need to copy it over before you can use it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you
i did that its working fyn
hepsi
|
|
|
|
|
What is the difference between typed and untyped datasets.
seema
|
|
|
|
|
http://www.interviewcorner.com/Answer/Answers.aspx?QuestionId=1136&MajorCategoryId=1&MinorCategoryId=2
http://www.velocityreviews.com/forums/t94794-difference-between-typed-dataset-and-untyped-dataset.html
|
|
|
|
|
Hi i have like this one table...,
id value1 edate
100 2000 5/21/2006
100 3000 7/14/2006
100 1600 12/12/2006
100 4000 5/17/2007
in this suppose i want to see the value in the month of 11 and year 2006
i will select like this:
select top 1 from tablename where empid=100 and (datepart(yyyy,edate) < 2006 or (datepart(yyyy,edate) = 2006 and datepart(mm,edate) <= 11)) order by edate desc
so it will give the value:
100 3000 7/14/2006
same like this suppose i want to update the month value...
how to do that...,
Plz help me..,
Regards,
Magi
|
|
|
|
|
update tblname set bassalary=10001
from (Select top 1 * from tblname where empid=100
and (datepart(yyyy,edate) < 2006 or (datepart(yyyy,edate) = 2006
and datepart(mm,edate) <= 11)) order by edate desc) as th
where tblname.edate=th.edate
it will work
Magesh
|
|
|
|
|
It would be better if you replace
(datepart(yyyy,edate) < 2006 or (datepart(yyyy,edate) = 2006)
with
(datepart(yyyy,edate) <= 2006)
I Love SQL
|
|
|
|
|
Hello,
I have two tables as below
Table1 (where id is Pk key)
Id Name
1 A
2 B
Table2
Id Reasons
1 X
2 Y
1 Z
I need output like as below
ID NAME REASON1 REASON2
1 A X Z
2 B Y Null
Amit
|
|
|
|
|
If you're using SQL Server 2005, take a look at the Pivot command.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
see the following example : it may help u (run it in sql query analyser)
CREATE TABLE #T1(id int,Name varchar(10))
insert into #T1 (id,Name) values (1,'Haris')
insert into #T1 (id,Name) values (2,'Arshad')
--select * from #T1
CREATE TABLE #T2(id int,Name varchar(5))
insert into #T2 (id,Name) values (1,'X')
insert into #T2 (id,Name) values (2,'Y')
insert into #T2 (id,Name) values (1,'Z')
insert into #T2 (id,Name) values (1,'X')
SELECT Id,Emp,X,Y,Z
FROM
(
SELECT #T1.Id,#T1.Name AS Emp,#T2.Name
FROM #T1
INNER JOIN #T2 ON #T2.Id = #T1.Id
) s
PIVOT
(
COUNT(Name)
FOR Name IN (X,Y,Z)
) p
drop table #T1
drop table #T2
fasih_is_my_signature
|
|
|
|
|
Thanks but i don't want to count. My rwq is little different and i would really appreciate if you could help me in this..
I have one table
CREATE TABLE #T1(id int,Name varchar(10))
insert into #T1 (id,Name) values (1,'Haris')
insert into #T1 (id,Name) values (2,'Arshad')
CREATE TABLE #T2(id int,Reason varchar(5))
insert into #T2 (id,Reason) values (1,'X')
insert into #T2 (id,Reason) values (2,'Y')
insert into #T2 (id,Reason) values (1,'Z')
insert into #T2 (id,Reason) values (1,'X')
Now i need output like
Id Name Reason1 Reason2 Reason3 ......ReasonN
1 Haris X Z X
2 Arshad Y NULL NULL
Thanks
Amit
|
|
|
|
|
I have never done a database search but am trying to search through a microsoft Access database with multiple tables. I am using visual studio 2005, and my project is a windows form based c++. Basically the user will enter what to search for and the program will go to the database and find all relevant entries. I just have no idea how to interact with the database. Any help will be appreciated. Thank you
|
|
|
|
|
You may want to research the LIKE keyword. If you have a table, lets call it Customers and it has a field called CustomerName, you could search for a customer who's name begins with the letter A by doing this SQL Select:
SELECT CustomerName FROM Customers WHERE CustomerName LIKE 'A%'
If you wanted all customers that have an A anywhere in their name:
SELECT CustomerName FROM Customers WHERE CustomerName LIKE '%A%'
Note that this is case sensitive, you would have to search for a and A if your data is not stored in all upper case...Like this:
SELECT CustomerName FROM Customers WHERE CustomerName LIKE '%A%' OR CustomerName LIKE '%a%'
Hope this helps.
|
|
|
|
|
I have simple situation...Here explicitly i am trying to insert char instead of integer and want to throw exception. But instead of printing "a" i am getting "Conversion failed when converting the varchar value 'a' to data type int." ....
ANY REASONS WHY???
CREATE TABLE Temp(C Int)
GO
INSERT INTO Temp VALUES('a')
IF @@ERROR <> 0
BEGIN
print 'a'
END
Amit
|
|
|
|
|
Use this way to to do so:
Declare @vError varchar(4000)
Select @vError = convert( varchar,@@Error)
IF @vError <> '0'
GOTO ErrorHandler
ErrorHandler:
IF @vError = '0'
BEGIN
Commit Tran
Return 0 -- On Success
END
Else
BEGIN
Rollback Tran
Return @vError -- On failure
END
fasih_is_my_signature
|
|
|
|
|
Hi all,
I want to add method that runs when i click DeleteButton on my GridView. Its button from <asp:CommandField ShowDeleteButton="true" />. I know how to solve it by simply adding new button on GridView for deleting and disabling the one from CommandField but thats not the way i want to solve it.
In GridView Load method row by row i choose DeleteButton and add OnClientClick method that shows ModalPopup and OnClick method (this method isnt firing when i click delete button).
<code>
protected void GridView1_Load(object sender, EventArgs e)
{
List<Control> myDeleteButtons = new List<Control>();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
Tools.addAllControls(GridView1.Rows[i], myDeleteButtons);
((ImageButton)myDeleteButtons[4]).OnClientClick = "showPopup(this); return false;"; // working =-]
((ImageButton)myDeleteButtons[4]).Click += new ImageClickEventHandler(GridViewDelete); // not working =7
myDeleteButtons.Clear();
}
</code>
If any1 know how to solve it id be grateful to read that advice.
-------------------
n00b @ pr0grAmiNg
|
|
|
|
|
HI
there is no query analyser in my sys
how can i run a stored procedure or...
i want to change the owner of table to dbo using sp_changeobjectowner
Thank You
Hepsi
|
|
|
|
|
Please don't repeat post. I answer your query below, so you don't need to repost. You need to understand that people get to your posts in their own time, so you have to have a little patience.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Hi there - hope someone can help with this...
Basically , I've created an app to migrate data from one database to another. Due to the large amounts of records involved, I decided to populate a dataset with the data from the original database and then update the destination by using the DataAdapter.
To show the user that something is going on, I have a progress bar. It's easy enough to increment the progress as each record is added to the dataset, but then there is a long wait as the dataset is being sent to the destination database.
Is there any event I can use to find out when each record has been added? Or can anyone else recommend a different approach?
EDIT: DOH! Have found the RowUpdated event - knew there'd be one somewhere!!!
Many thanks in advance
Baz
-- modified at 6:28 Tuesday 7th August, 2007
|
|
|
|
|
I don't know which database you are using, but this sounds like an extremely expensive operation. If you are using SQL Server, take a look at exporting data using DTS/SSIS. They are technologies that have been developed to cope exactly with this type of situation.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for the reply, but got it sorted in the end
BTW, need to do it this way as the data is being processed before being chucked into the new database
Thanks anyway
Baz
|
|
|
|
|
DTS/SSIS performs what is known as ETL or Extraction, Transformation and Loading. This means that it is perfectly possible to process (transform) data as it is being exported.
Deja View - the feeling that you've seen this post before.
|
|
|
|