|
You are most welcome
|
|
|
|
|
Hi All,
I have a stored procedure that is bound to a data grid.Every time there is a change of data on the stored procedure i want it to be reelected on the data grid automatically.
This can be done i think with SQL2005.Can you please adivce me on this?
In SQL Server 2005 there is native support for creating cache dependencies that expire when a change is made in the database.
How do you do it?
Please advice.
Thank you
|
|
|
|
|
Have you considered reading the documentation[^]?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Guys i am planning to develop a system that work on Pocket PC... becoz some of my client works at field which obviously can carry a computer.. so im planning to give them a system that works on Pocket PC... but im too much confuse what does Replication, Publication and Subcriptions (SQL Server 2005 and SQL Server Mobile) can do in my system.. does any can give a clear view or give me some to start with.. thanks..
|
|
|
|
|
Replication is a bit of a black art.
There is plenty out there on google.
Really the only way to go about it is to start and experiment.
The reason I say this is that the type of replication you use is dependent on lots of factors and experimentation is the best way IMHO.
My position is that I have never used it myself, but have worked for companies that use it and have seen how complex it can get.
I am considering using it and with the dearth of practical information out there it has become apparent to me that bar having a DBA with experience in replication at your side - experimentation is the best way.
You always pass failure on the way to success.
|
|
|
|
|
Hi,
I'm working in SQL Server 2005 and I'm trying to retrieve some records from a MySQL database using:
SELECT * FROM OPENROWSET(provider, connectionString, selectStatement)
I used MSDASQL as the provider. Can anyone tell me a good connection string?
Thanks
|
|
|
|
|
http://www.connectionstrings.com/[^]
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Hi.
In my application I have to select some records from a table for which the value of a date/time columns is within a certain range. So it comes down to comparing some dates in a SQL command.
How do you do that for Access and Sql Server databases? I also have to do it for MySql, but I understand that this is not the best place to ask MySql stuff.
So for Access and Sql Server what's the easiest and safest way to compare dates?
Thanks.
|
|
|
|
|
Never compare your dates when they are present; they'll get jealous and not date you anymore.
WHERE SomeDateField BETWEEN LowDate AND HighDate
should work for pretty much any SQL database.
|
|
|
|
|
Hi
I want to assign a xml field for the insertion like
insert into table1(t1,t2,t3)
select SequenceItem.query('t1').value('.','INT') AS t1
,SequenceItem.query('t2').value('.','Datetime') AS t2
,SequenceItem.query('t3').value('.','Datetime') AS t3
FROM @xmlJobSequence.nodes('/NewDataSet/Table1') AS xmlJobSequence(SequenceItem)
instead of assigning each and every field with the help of .QUERY, i want to assign all the fields like our usual query select * from table..
is it possible.. how to go about it.
|
|
|
|
|
Hi all i have developed an asp.net 2.0 application with sql2005. it is running ok at my pc. When i tried to deploy it at the customer site i am receiving an error when i hit login. I can acccess the login page but when i enter username and password and press login i get the following error:
System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
any ideas regaring this.
my connection string is as follows:
<connectionStrings><br />
<add name="conString" connectionString="Data Source=kassem;Initial Catalog=CDC;persist security info=False;user id=sa; password=kassem255;" providerName="System.Data.SqlClient"/><br />
<add name="AccessCon" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\current bdl Europe Schd\bdl_results.mdb" providerName="system.data.oledb"/><br />
</connectionStrings>
|
|
|
|
|
hmmm... well your first problem is your connection string referancess an access database, not sql2005.
MrPlankton
|
|
|
|
|
Actually i need both and i have put both SQL & OLEDB. Check well
|
|
|
|
|
Good Morning All
i have a Procedure that returns Nothing, i dont know why.
<br />
Create Proc Check_Geocode<br />
(<br />
@num_key varchar(10),<br />
@Extension int, <br />
@OUTRES varchar(10) oUTpUT<br />
)<br />
as <br />
set @OutRes = (select Geocode from sde.Boundary_Codes<br />
where Extension = @Extension And Numkey = @Num_key)<br />
<br />
And i will run this Procedure like this
<br />
declare @OutRes varchar(10)<br />
exec Check_Geocode 3,'0400',@OutRes Out<br />
select @OutRes as Geocode<br />
When i Execute the Procedure i dont get anything, but when i go to the table and Query it i get results.
<br />
<br />
select * from Boundary_Codes<br />
where Numkey = '0400' and Extension = 3<br />
i get results what is wrong with my Procedure
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswa wrote: And i will run this Procedure like this
declare @OutRes varchar(10)
exec Check_Geocode 3,'0400',@OutRes Out
select @OutRes as Geocode
I believe you'll have to execute it the following way:
Declare @DisplayOutput VARCHAR(10)
Exec Check_Geocode '3',0400,@OUTRES = @DisplayOutput OUTPUT
Select @DisplayOutput AS [GeoCode]
Please do ensure that the input params are passed with their appropriate entries because, I see a discrepancy here:-
Vuyiswa wrote: exec Check_Geocode 3,'0400',@OutRes Out
As your proc accepts only Varchar,Int,Output
|
|
|
|
|
Thanks ,
my mistake was the Order of i declared my variables in the Procedure. i never knew that it matters, but you opened my eyes, each an everyday we learn.
thank you very much my friend.
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Pleasure is mine
Glad that it worked. Good Luck
|
|
|
|
|
Hi,
I have a converted rdlc file that uses 3 datasets, all of which takes the same two parameters being passed from the requesting page. But when I run it - I get "parameter 'Parameter1' is missing a value" error. FYI, I set default values for both of them.
Any ideas?
Thanks.
Ekjon
|
|
|
|
|
private void button1_Click(object sender, System.EventArgs e)
{
OdbcConnection myconn = new OdbcConnection("DSN=test");
SqlConnection conn = new SqlConnection("server=.;database=techpaymaster;uid=sa;password=;Pooling=false;Connect Timeout=55;");
OdbcCommand da = new OdbcCommand("select * from tinfo",myconn);
myconn.Open();
OdbcDataReader dr=da.ExecuteReader();
while(dr.Read())
{
string i =(string)dr["Name"];
int j =(int)dr["Age"];
conn.Open();
SqlCommand cmd = new SqlCommand("insert into sadd(Namee,Agee)values('"+i+"',"+j+")",conn);
cmd.ExecuteNonQuery();
}
it is showing the message
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
modified on Thursday, January 24, 2008 1:28:54 AM
|
|
|
|
|
Which line of code is producing the error?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
It wouldn't be, by any chance a name in your database with a comma in it? You should parameterise your insert query.
|
|
|
|
|
I have a float column in a database that I want to add to, not set the value to. How do I do that?
Example:
Current value: 5.1
Add: 1.3
New value: 6.4
I know I can read the data, add the values, and then update, but that doesn't seem right.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Expert Coming wrote: I know I can read the data, add the values, and then update, but that doesn't seem right.
It is.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
UPDATE Table1 SET X = (X + 1.3)
|
|
|
|
|
I have a query which I am running accross several DB's to get information on several of our store's oulet. The query Below provided the info I need but I am not sure if it is the best way to do it and how it will be affected when we have millions of record in our DB. Or can I make it into a single query so when executed in C# I do do get two table in my dataset. Any comment or suggestion is appreciated.
Select 'My Business' AS BusName, sum(PassVer.PassedVerifier) AS 'Passed Verifiers', Sum(PassVer.CashFunded)AS 'Cash Funded', SUM(PassVer.OtherFunding) AS 'Other Funding', Sum(PassVer.CompletedApplications) AS 'Completed Applications', SUM(PassVer.CompleteFundedCash) AS 'Complete - Funded Cash', SUM(Passver.CompleteNotFundedCash) AS 'Complete-Not Cash', SUM(PassVer.Total) AS 'Total Applications',
cast((Sum(PassVer.PassedVerifier) * 100.00) / sum(PassVer.CompletedApplications) AS Float) AS '% Completed and verified',
cast((SUM(PassVer.CompletedApplications)* 100.00) / Sum(PassVer.Total) AS Float) AS '% of Completed from Total'
FROM (
--Selects Applications which Passed Verifier
Select 1 AS 'PassedVerifier', 0 As 'CashFunded', 0 As 'OtherFunding', 0 AS 'CompletedApplications', 0 AS 'CompleteFundedCash', 0 AS 'CompleteNotFundedCash', 0 AS 'Total'
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
where Q.QueueId= 'Pass Validation'
UNION ALL
--Selects Applications which passed the verifier and are funded by Cash.
SELECT 0 AS 'PassedVerifier', 1 AS 'CashFunded', 0 As 'OtherFunding', 0 AS 'CompletedApplications', 0 AS 'CompleteFundedCash', 0 AS 'CompleteNotFundedCash', 0 AS 'Total'
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
where A.fundingMethodId = 'Cash' and Q.QueueId= 'Pass Validation'
UNION ALL
--Selects Applications which passed the verifier and are funded by methods other than Cash.
SELECT 0 AS 'PassedVerifier', 0 AS 'CashFunded', 1 As 'OtherFunding', 0 AS 'CompletedApplications',0 AS 'CompleteFundedCash', 0 AS 'CompleteNotFundedCash', 0 AS 'Total'
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
where A.fundingMethodId != 'Cash' and Q.QueueId= 'Pass Validation'
UNION ALL
--Selects Applications which are completed.
SELECT 0 AS 'PassedVerifier', 0 AS 'CashFunded', 0 As 'OtherFunding', 1 AS 'CompletedApplications', 0 AS 'CompleteFundedCash', 0 AS 'CompleteNotFundedCash', 0 AS 'Total'
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
where Q.QueueId= 'Application Completed'
UNION ALL
--Selects Applications which are completed and are funded by Cash.
SELECT 0 AS 'PassedVerifier', 0 AS 'CashFunded', 0 As 'OtherFunding', 0 AS 'CompletedApplications', 1 AS 'CompleteFundedCash', 0 AS 'CompleteNotFundedCash', 0 AS 'Total'
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
where Q.QueueId= 'Application Completed' and A.fundingMethodId = 'Cash'
UNION ALL
--Selects Applications which are completed and are not funded by Cash.
SELECT 0 AS 'PassedVerifier', 0 AS 'CashFunded', 0 As 'OtherFunding', 0 AS 'CompletedApplications', 0 AS 'CompleteFundedCash', 1 AS 'CompleteNotFundedCash', 0 AS 'Total'
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
where Q.QueueId= 'Application Completed' and A.fundingMethodId != 'Cash'
UNION ALL
--Total amount of applications.
SELECT 0 AS 'PassedVerifier', 0 AS 'CashFunded', 0 As 'OtherFunding', 0 AS 'CompletedApplications', 0 AS 'CompleteFundedCash', 0 AS 'CompleteNotFundedCash', 1 AS 'Total'
FROM dbo.BK_Account) PassVer
SELECT 'My Business' AS BusName,
CASE WHEN GROUPING (CAST(MONTH(A.CreationDate) AS VARCHAR))= 1 THEN 'Grand Total'
else (CAST(MONTH(A.CreationDate) AS VARCHAR)) end as MonthCreated,
Count(*) AS TotalCompletedApplications,
SUM(A.FundingAmount) AS SumTotalCompletedApplications
FROM dbo.BK_Account A LEFT JOIN dbo.BK_AccountQueue Q ON
A.Guid=Q.AccountGuid
WHERE (A.Visible = 1) AND (Q.QueueId= 'Pass Validation' )
GROUP BY (CAST(MONTH(A.CreationDate) AS VARCHAR))
With rollup
Skan
If you knew it would not compile why didn't you tell me?!?!?!
|
|
|
|
|