|
Hi All,
I have an install of SQL2005 in my server machine and I want to configure it so that I can connect to the server instance from another box via SQL Server Management Studio (SSMS). The following article is meant to provide me with a straigtforward step by step guide of doing this.
http://www.codeproject.com/KB/database/SQL_Server_2005_remote.aspx[^]
Although I've followed the instructions, I still can't connect remotely (I can connect using SSMS on the server machine, which means the problem is not with the service). Anyone can point me to some other resource? Could it be some other configuration outside of SQL?
Both machines are connected directly to the router (which is connected to the internet, not that it's relevant to the question at hand)
Thanks in advance.
----------------------------------------------------------
Every nation state's armed forces call themselves 'Defence',
makes me wonder why there are conflicts in the world.
|
|
|
|
|
Do you have any desktop firewalls installed which could be blocking the SQL Server traffic? By default, SQL Server listens on port 1433.
Tim
|
|
|
|
|
Hai to all,
I have already installed sqlserver 2000 in my windowsXP.Now i hae installed vs2003 and vs2005.
Presently working on vs2003 framework1.1 with sqlserver 2000.
I want to upgrade from vs2003 to vs2005 with sqlserver2005.
So is there any problem occrs if i install sqlserver2005 when sqlserver2000 already existed.
Tell me which type precautions i have to take before installation.
I want both versions of .net and sqlserver.
kissy
|
|
|
|
|
Kissy16 wrote: So is there any problem occrs if i install sqlserver2005 when sqlserver2000 already existed.
No problem. They can co-exist. However, each must have a unique name. There can be only one default (unnamed) instance.
|
|
|
|
|
Or you should be able to install SQL Server 2005 in place of (i believe it is called) SQL Server 2000.
|
|
|
|
|
I have a textbox called "textBox6.text" in a C# Windows Application in Visual Studio, and i want that the text entered by the user in the textbox should be added to the "PURPOSE" field in a table "TABLE2_HDB1" in Oracle database "HDB1" on clicking a "submit" button.
the coding for submit button is as follows:-
private void button1_Click(object sender, EventArgs e)
{
string OracleStmt;
string ConString;
OleDbConnection cn = null;
OleDbCommand cmd = null;
try
{
OracleStmt = "insert into TABLE2_HDB1(PURPOSE) values(@PURPOSE)";
ConString = " Provider=MSDAORA;Data Source=HDb1;User Id=SYSTEM
;Password=*****;";
cn = new OleDbConnection(ConString);
cmd = new OleDbCommand(OracleStmt, cn);
cmd.Parameters.Add(new OleDbParameter("@PURPOSE", OleDbType.VarChar , 20));
cmd.Parameters["@PURPOSE"].Value = textBox6.Text;
cn.Open();
cmd.ExecuteNonQuery();
textBox8 .Text = "record inserted successfully";
}
catch (Exception ex)
{
textBox8 .Text = ex.Message;
}
finally
{
cn.Close();
}
}
on executing this code u get the error :-
ORA-00936:missing expression
plz. help
|
|
|
|
|
Try to use : instead of @. So in your example it would be like:
OracleStmt = "insert into TABLE2_HDB1 (PURPOSE) values(:PURPOSE)";
...
cmd.Parameters.Add(new OleDbParameter(":PURPOSE", OleDbType.VarChar , 20));
cmd.Parameters[":PURPOSE"].Value = textBox6.Text;
I'm not sure that if this correct when using OleDBConnection, but it works with native OracleConnection
Mika
|
|
|
|
|
Hi,
My Sql Server 2000 Table 'Feedback' structure is look like this.....Code, Q1, Q2, Q3 and records are like...
Code Q1 Q2 Q3
1 Good Good Average
2 Poor Average Average
3 Good Excellent Average
4 Excellent Good Good
etc.....
I need to write a single query, which will give result look like.
Excellent Good Average Poor
Q1 1 2 0 1
Q2 1 2 1 0
Q3 0 1 3 0
Actually, this table is used to get the feedback from the users. User has given their feedback by selecting options. I need the details that how many persons answered Excellent for Question1 (Q1), Question2 (Q2), etc...As well as How many answered Good for Q1,Q2,Q3, etc....I need this format. Please help me.
Balasubramanian K.
|
|
|
|
|
Hello,
I have written the following query in SQL Server but did not work saying error with the word PIVOT but worked with MS-Access
but I cannot create a table with the select statement.I want the Pivot Table to go in a table but the INTO [Table] doesn't work.
Following is the query
TRANSFORM Sum(Cap) AS AvgOfCap;
SELECT JobWorker FROM Cap GROUP BY JobWorker order by JobWorker PIVOT TimePeriod;
Regards
Prithaa
|
|
|
|
|
What version of SQL Server are you using?
|
|
|
|
|
Hi guys i want to find the last week is which saturday...,
It mean its 2nd or 4th saturday or odd saturday...,
Becoz based on that i want to calculate workdays
If its even(2nd or 4th) saturday then i want to show workdays 5
else if its odd(1st or 3rd) saturday then i have to show workdays 6 how to do that?,
Plz help me
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
modified on Tuesday, July 15, 2008 1:09 AM
|
|
|
|
|
i want to find the last week is which saturday...,
It mean its 2nd or 4th saturday or odd saturday...,
Becoz based on that i want to calculate workdays
If its even(2nd or 4th) saturday then i want to show workdays 5
else if its odd(1st or 3rd) saturday then i have to show workdays 6 how to do that?,
Plz help me
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
modified on Tuesday, July 15, 2008 1:12 AM
|
|
|
|
|
New one wrote: please don't forget to vote on the post
done
|
|
|
|
|
--This will return the week of the month
select datediff(week,(getdate()-datepart(dd,getdate())+1),getdate())+1
--This will return the first day of the week
SELECT DATEADD(wk, DATEDIFF(wk, 6, getdate()), 6)
--This will return the last day of the week
SELECT DATEADD(wk, DATEDIFF(wk, 5, getdate()), 5)
--This will return the Saturday date of the week
SELECT DATEADD(wk, DATEDIFF(wk, 4, getdate()), 4)
Hope this works for you
|
|
|
|
|
By the way, what are you doing if there is 5 weeks in a month
Declare @Date datetime
SET @Date='2008-07-28'
select
case
When (datediff(week,(@Date -datepart(dd,@Date)+1),@Date)+1) in (1,3) then 'Workdays 6'
When (datediff(week,(@Date -datepart(dd,@Date)+1),@Date)+1) in (2,4) then 'Workdays 5'
When (datediff(week,(@Date -datepart(dd,@Date)+1),@Date)+1)=5 then 'What Now'
End
|
|
|
|
|
I have to develop an application using SQL Server2000. It is a client server application having one server and at most 10 clients. Does SQL Server 2000 Desktop Edition support Client Server Architecture and what is maximum number of clients that may connect concurrently.
I wish not to use SQL Server Enterprise Edition as it requires Server operating system for its installation but my application is targeted to run on Windows XP Professional
Looking forward for timely responce please....
Regards
Waqas
rajawaqas
|
|
|
|
|
Hi all,
iam facing difficulty in writting query some thing like this.
i have caseno field in Database table and want to query that how much cases submitted weekly monthly and Quarterly.
i have tried but not sucedded because i use varchar(50) field for stroing Date into table
please help me in this regard any hint ?
Regards
Rameez
|
|
|
|
|
rameez Raja wrote: i use varchar(50) field for stroing Date
Mistake 1 - this going to plague you until you fix the problem - do it NOW. Convert the varchar to a datetime field.
When storing the date make sure you store the DATE only not the date and time.
Use datepart to identify the date segments you require. I would create a view with the additional calculated fields and denormalised your structure for your reporting requirements.
However unless you fix mistake 1 your progress will be delayed as you try to work around the format limitations. Datetime is your friend, he has lots of nice bits to play with.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for replying and give me good suggestion .
i have to convert varchar to datetime field and have to store only date part into database table named Date (varchar) or i have to taken Datetime field type for storing date.
please suggest me as i get solution .
then how would be my query?
Best regards
rameez
|
|
|
|
|
Create another column name DateT as a datetime field
Convert your existing date data into the DateT field
When storing date data only store the date (today) unless you need the time component (now).
If you store the time component then you cannot select on '2008-Jul-15' as the actual value may be '2008-Jul-15 04:23:11' with the time component. This will force you to use between or format whenever you use the DateT field.
Try this
SELECT TOP 100
DateT
DATEPART(d,datadate) [Day],
DATEPART(wk,datadate) [wk],
DATEPART(mm,datadate) [mth],
DATENAME(weekday,datadate)
FROM Tablename
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is an example of grouping data by year, quarter, month, week.
I know some of you will say *what a rubbish* ,
but, believe me, some people are looking at this rubbish and actually learn something.
So ... Don't say *Unhelpful Answer*
Just copy and test (in SQL 2005)...
;
CREATE TABLE #T (caseno INT IDENTITY(1,1), Date_Cr DATETIME);
DECLARE @Cases INT; SET @Cases = 10000 ;
WHILE @Cases > 0
BEGIN
INSERT INTO #T (Date_Cr) SELECT GETDATE()-RAND()*365*4 ;
SET @Cases = @Cases - 1 ;
END ;
;
;
;WITH case_stats AS (
SELECT Period = YEAR(Date_Cr) * 10000
, Cases = COUNT(*)
FROM #T
GROUP BY
YEAR(Date_Cr) * 10000
UNION ALL
SELECT Period = YEAR(Date_Cr) * 10000
+ (( MONTH(Date_Cr) + 2 ) / 3)*1000
, Cases = COUNT(*)
FROM #T
GROUP BY
YEAR(Date_Cr) * 10000
+ (( MONTH(Date_Cr) + 2 ) / 3)*1000
UNION ALL
SELECT Period = YEAR(Date_Cr) * 10000
+ (( MONTH(Date_Cr) + 2 ) / 3)*1000
+ MONTH(Date_Cr)*10
, Cases = COUNT(*)
FROM #T
GROUP BY
YEAR(Date_Cr) * 10000
+ (( MONTH(Date_Cr) + 2 ) / 3)*1000
+ MONTH(Date_Cr)*10
UNION ALL
SELECT Period = YEAR(Date_Cr) * 10000
+ (( MONTH(Date_Cr) + 2 ) / 3)*1000
+ MONTH(Date_Cr)*10
+ (1 + DATEPART(ww, Date_Cr) - DATEPART(ww, CONVERT(NVARCHAR(7),Date_Cr, 121)+'-01'))
, Cases = COUNT(*)
FROM #T
GROUP BY
YEAR(Date_Cr) * 10000
+ (( MONTH(Date_Cr) + 2 ) / 3)*1000
+ MONTH(Date_Cr)*10
+ (1 + DATEPART(ww, Date_Cr) - DATEPART(ww, CONVERT(NVARCHAR(7),Date_Cr, 121)+'-01'))
)
SELECT *
INTO #S
FROM case_stats ;
;
;
;
SELECT
Period
, STUFF( STUFF( STUFF( STUFF( Period ,1,0,'Y') ,6,0,'Q') ,8,0,'M') ,11,0,'W')
, Cases
FROM #S
ORDER BY LEFT(Period,4) DESC, Period ;
;
SELECT Period,
Year = 'Y '+CASE WHEN RIGHT(Period, 4) ='0000'
THEN LEFT(Period,4) ELSE NULL END
, Quarter = 'Q '+CASE WHEN RIGHT(Period, 4)<>'0000' AND RIGHT(Period, 3)='000'
THEN RIGHT( LEFT(Period,5) ,1) ELSE NULL END
, Month = 'M '+CASE WHEN RIGHT(Period, 4)<>'0000' AND RIGHT(Period, 3)<>'000' AND RIGHT(Period, 1)='0'
THEN RIGHT( LEFT(Period,7) ,2) ELSE NULL END
, Week = 'W '+CASE WHEN RIGHT(Period, 4)<>'0000' AND RIGHT(Period, 1)<>'0'
THEN RIGHT(Period,1) ELSE NULL END
, Cases
FROM #S
ORDER BY LEFT(Period,4) DESC, Period ;
;
DROP TABLE #S ;
DROP TABLE #T ;
|
|
|
|
|
Hi All,
Iam new to SQL Server. Could you please help me in writing the script to set the timer for SSIS package for every 10 seconds(say).
Thanks in advance.
Regards,
nag
|
|
|
|
|
What do you mean?
Do you want this package to execute every 10 seconds?
|
|
|
|
|
Yes. I need that package to be executed by itself for every 10 seconds.
Thanks,
Veni
|
|
|
|
|
Maybe you could use this trick[^].
But the idea of an SSIS package executed every 10 seconds keeps bugging me. What kind of package is it? What does it do? Does it take less to 10 seconds to execute it?
|
|
|
|
|