|
thank for help.I can solve my problem.thank again.
|
|
|
|
|
I want to update table, with this following code:
declare @parentid int<br />
select accountparentid=@parentid from account where accountid=@accountid<br />
<br />
while @parentid<> 0<br />
begin<br />
UPDATE [dbo].[account]<br />
SET [accountvalue] = [accountvalue]+@accountvalue<br />
where accountid=@parentid<br />
select accountparentid=@parentid from account where accountid=@parentid<br />
END
How do I create the function in SQL with the name UpdateAccountParent, I'm using C# express. This should be easy. Thanks.
|
|
|
|
|
consult MSDN[^]
Tirtha
Do not go where the path may lead, go instead where there is no path and leave a trail.
Author: Ralph Waldo Emerson (1803-82), American writer, philosopher, poet, essayist
|
|
|
|
|
Hi My name is Lee Hatcher and I am a newbie to Access and sql. This has probally already been asked but I am trying to create round control buttons for them. Any help will be appreciated.
Thanks,
Lee
|
|
|
|
|
Round buttons for sql??
What are you doing?
|
|
|
|
|
Patty
Thanks for the response. I have created a database for a company in sql with an access front end and would like round control buttons instead of squares and rectangles. It is not necessary but I would like some personal touches to it.
Thanks
Lee
|
|
|
|
|
Good luck customising an access front end. If it's not necessary, then i'd just save yourself a lot of pain and heartache and deploy it... If they want a pretty front end, make them pay you for it and do it in using decent tools...
|
|
|
|
|
Thanks again Paddy,
Ok what would you suggest for a front end VB?
Thanks
Lee
|
|
|
|
|
I am executing a DTSX from a VB.Net application. Problem is that when I built the DTSX to do importing of the flat files, it has hardcoded the locations of the Flatfiles. I want to be able to set a variable for the file's location and pass that variable in the vb coding. HOW CAN I SETUP THE FILE LOCATIONS TO BE VARIABLES PASSED IN? How do I pass it in?
'Here we import the files from the file location into Loader's tables
Dim app As New Application()
Dim vars As Variables
Dim AppPath As String
AppPath = My.Application.Info.DirectoryPath
Dim package As Package = app.LoadPackage(AppPath & "\AutoLoaderPkg.dtsx", Nothing)
vars = package.Variables
vars("fileLocation").Value = gsFileLocale
Dim result As DTSExecResult = package.Execute()
If result = DTSExecResult.Success Then
FileImport = True
Else
FileImport = False
End If
|
|
|
|
|
Does anybody know if I can run SQL query in A2T Application? and How? Thanks.
Jane
|
|
|
|
|
Pardon my ignorance, but what's an "A2T application?"
|
|
|
|
|
I'm trying to install the SQL 2008 VHDs from MSDN on WinXP MC running Virtual PC 2007. But it asks me for the archive "en_sql_server_2008_ctp_4_vhd_part_1_of_5_.rar", which doesn't exist on MDSN subscriber downloads. Has anyone else had trouble installing this? I googled the file name and there's only one post out there, with no response.
|
|
|
|
|
Yes, somehow they've mangled it. When it asks for each file, just give it the next part in sequence:
part_1_of_5.rar -> part_2_of_4.rar
part_2_of_5.rar -> part_3_of_4.rar
part_3_of_5.rar -> part_4_of_4.rar
Presumably they've used a self-extracting executable because a .vhd is generally very compressible and it shaves a lot off the download time. I can't recall if the MSDN downloader uses the Attachment Security stuff added in XP SP2 to give the download the 'mark of the web'. If it does, one reason for carving it into pieces might be to save having to check all 2GB of the file for a signature when you run the first piece.
They can't make it a standalone ZIP because the file's bigger than 4GB and the built-in 'Compressed Folders' in Windows XP and Server 2003 can't handle the ZIP64 extensions to get around the 4GB file limit.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
|
I downloaded this from MSDN[^] earlier today and it worked fine. Did you get another version or from a different location?
The file may have been corrupted.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
The version on MSDN Subscriber Downloads has the problem mentioned.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Hi Guys,
Is it possible to restore a backup of SQL Server 2005 Enterprise/Standard Edition onto a SQL Server 2005 Express Edition DB.
I have a small backup file. its really small. Can someone just restore the backup for me and generate an SQL script from it. I need the script. I'll be lost without it.
Thanks in advance everyone.
|
|
|
|
|
Mridang Agarwal wrote: Is it possible to restore a backup of SQL Server 2005 Enterprise/Standard Edition onto a SQL Server 2005 Express Edition DB.
I've never done this myself, but I'm almost 100% sure that it is possible.
Mridang Agarwal wrote:
I have a small backup file. its really small. Can someone just restore the backup for me and generate an SQL script from it. I need the script.
Can you restore a backup using a SQL Server Management Studio? If yes, you can generate an appropriate script automatically in SSMS. (Of course I could paste you the script here right away, but if you do it yourself you'll learn more.)
|
|
|
|
|
I need some advice.
I have 2 tables. They are not related in any way except that they are in the same DB. Now I need to write a select query where it returns the columns from table1 and columns from table2.
How can I achieve this?
My Query at the moment is:
SELECT Table1.Column1, Table1.Column2, Table2.Column1 AS EXPR1 FROM Table1 CROSS JOIN Table1 AS Table2
Thank you in advance!!
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Since the tables are not related in any way it probably makes sense to return multiple result sets. If you are calling a stored procedure, which I highly suggest, you could just do this:
Select column1, column2 from table1
select column1 as expr1 from table2
Then you would get two results sets to work with.
Hope that helps.
Ben
|
|
|
|
|
Hi
Anybody know how to reset/increase the connection timeout settings for Replication
By Default it is 15, I am getting time out error "When connecting to Subscriber"
[Since our network is very poor in speed it take more than 15 to connect even with Management Studio to Login/connect to a database from client machine. In case of Login/connect we could reset time in connection properties. For Replication the connection timeout is disabled]
|
|
|
|
|
I think you can specify in the connection string the timeout length.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
HI all,
I am creating a Procedure in which i need to take table name from user as input I m trying to achieve this but getting some errors please help me out.
here is the code....
<br />
set ANSI_NULLS ON<br />
set QUOTED_IDENTIFIER ON<br />
go<br />
<br />
<br />
<br />
<br />
<br />
<br />
ALTER procedure [dbo].[apo_GetQuestionsByInqTransId]<br />
--Passing inventory id as input variable <br />
--Generate all the questions of it<br />
@InqTransId int,<br />
@appId int,<br />
@option nvarchar(20),<br />
@schema nvarchar(30)<br />
<br />
As<br />
Begin<br />
<br />
if @option='All'<br />
begin<br />
select qm.QID,qm.[name],QM.ParentQID,itql.SequenceNo from QuestionMaster qm,InquiryTransaction it,<br />
InquiryQuestionLinkage itql <br />
where itql.qid=qm.qid and it.InquiryTransId=itql.InquiryTransId<br />
and it.InquiryTransId=@InqTransId order by QM.ParentQID<br />
end<br />
else<br />
begin<br />
declare @AnswerDetailTable as nvarchar(40)<br />
set @AnswerDetailTable =@schema+'.AnswerDetalTable'<br />
select qm.QID,qm.[name],QM.ParentQID,itql.SequenceNo<br />
from QuestionMaster qm,InquiryTransaction it,InquiryQuestionLinkage itql <br />
where itql.qid=qm.qid and it.InquiryTransId=itql.InquiryTransId<br />
and it.InquiryTransId=@InqTransId and qm.QID not in(select QID<br />
from @AnswerDetailTable<br />
where appId=@appId) <br />
order by QM.ParentQID<br />
end<br />
<br />
End <br />
In the above code I need ur help in the else statement where I am using @AnswerDetailTable in from clause.
I m geetin error "Msg 102, Level 15, State 1, Procedure apo_GetQuestionsByInqTransId, Line 33
Incorrect syntax near '@AnswerDetailTable'."
wating for suggestions....
Arun Singh
Noida.
|
|
|
|
|
You can't do this. You have to build a string that represents your SQL statement and execute it using the EXEC statement.
Paul Marfleet
|
|
|
|
|
SQl Server does not do a parameter substitution for Table Names in the SQL statement. To acheive this you need to build a dynamic sql and execute using sp_executesql or EXEC command.
try something like this...
DECLARE @SQLQuery AS NVARCHAR(500)
DECLARE @ParameterDefinition AS NVARCHAR(100)
DECLARE @appId AS INT
SET @appId = 10
SET @SQLQuery = 'SELECT * FROM ' + @AnswerDetailTable + ' WHERE appId = @appId'
SET @ParameterDefinition = '@appId INT'
EXECUTE sp_executesql @SQLQuery, @ParameterDefinition, @appId
Regards - J O N -
|
|
|
|