Showing posts with label advice. Show all posts
Showing posts with label advice. Show all posts

Tuesday, March 20, 2012

Could you please advice appropriate license for SQL Enterprise edition 2005

If CPU is Quad core it ‘s count to 4 or 1 license cpu. Could you please advice appropriate license for SQL Enterprise edition 2005 like server detail below. Actually i don't want to buy license per cpu. How many Cal for SQL enterprise 2005 license that bundle within first order SQL Svr Enterprise Edtn 2005 English .

Processor : QUAD Core 3.0GHZ X 2

Number of user : 4

Thank you for advance

The following link should have all the information you're after:

http://www.microsoft.com/sql/howtobuy/default.mspx

HTH!

Could Stored Procedure or Trigger choose another database?

Hello all, I need some advice or clue here.
I want to crate a stored procedure or trigger from database A that will
change of have effect on another database B. Is this could be done? I
try to use sql syntax "use B;" in stored procedure that created on
database A, but it said that use syntax couldn't be used in stored
procedure."Lemune" <alfredosilitonga@.gmail.com> wrote in message
news:1147850181.634882.15120@.i39g2000cwa.googlegroups.com...
> Hello all, I need some advice or clue here.
> I want to crate a stored procedure or trigger from database A that will
> change of have effect on another database B. Is this could be done? I
> try to use sql syntax "use B;" in stored procedure that created on
> database A, but it said that use syntax couldn't be used in stored
> procedure.
>
Do you mean something like
create procedure FOO as
(
select * from bar
)
where bar is in a different database?
If so, 3-part names
select * from dbname.owner.table
so
create procedure FOO as
(
select * from baz.dbo.bar
)|||Lemune,
yes you can change the datbase context inside a stored procedure even
thought the "Use" keyword is not allowed.
One way is creating a string variable and build up the syntax you need,
when execute it through sp_executesql.
Declare @.myQuery nvarchar(2000)
set @.myQuery = ' USE ' + @.dbname + CHAR(13) + 'SELECT * from myTable'
Exec sp_executesql @.myQuery
Another option is symply using the 3 part name:
Select * from myDb.dbo.myTable
If you try to loop through all datbases on a server have a look at
sp_MSforeachDB. It gives you an easy way to run the same command on all
databases.
Markus|||Thanks for your information and MarkusB too, I try booth your method
and it work well.
But I have another problem, assume that I want to create stored
procedure that work from A.dbo.Incomming to check a value from
B.dbo.Data and than the result value is send to A.dbo.Outgoing in one
stored procedure. I'm using MS Sql Server 7. I also have read that in
MS SQL 2003 have stored functions that return value.|||I have another question, how stored procedure in SQL Server 7 could
return value (like function)?|||Inside the proc, you do:
RETURN -101
And the calling code, of TSQL:
DECLARE @.retval int
EXEC @.retval = myproc
Return codes are int only and should be used to communicate status (success
or fail). You can also
return values through output parameters:
CREATE PROC myproc @.parm varchar(5) OUT
AS
SET @.parm = 'Hello'
GO
DECLARE @.x varchar(5)
EXEC myproc @.parm = @.x OUT
Both return codes and out parameters can both be retrieved from your program
ming API (ADO.NET, for
example) as well.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Lemune" <alfredosilitonga@.gmail.com> wrote in message
news:1147948815.225334.130080@.i40g2000cwc.googlegroups.com...
>I have another question, how stored procedure in SQL Server 7 could
> return value (like function)?
>|||Thank you very much.|||I have another question again :-). Could Stored Procedure or Trigger
choose another database that is on difference engine? For example, I
have database A on engine or instance name Server1 that has a stored
procedure Stored_Proc_1 and in this stored procedure I want to access
some table on database B on engine Server2. I have username and
password on Server2.

Could Stored Procedure or Trigger choose another database?

Hello all, I need some advice or clue here.
I want to crate a stored procedure or trigger from database A that will
change of have effect on another database B. Is this could be done? I
try to use sql syntax "use B;" in stored procedure that created on
database A, but it said that use syntax couldn't be used in stored
procedure."Lemune" <alfredosilitonga@.gmail.com> wrote in message
news:1147850181.634882.15120@.i39g2000cwa.googlegroups.com...
> Hello all, I need some advice or clue here.
> I want to crate a stored procedure or trigger from database A that will
> change of have effect on another database B. Is this could be done? I
> try to use sql syntax "use B;" in stored procedure that created on
> database A, but it said that use syntax couldn't be used in stored
> procedure.
>
Do you mean something like
create procedure FOO as
(
select * from bar
)
where bar is in a different database?
If so, 3-part names
select * from dbname.owner.table
so
create procedure FOO as
(
select * from baz.dbo.bar
)|||Lemune,
yes you can change the datbase context inside a stored procedure even
thought the "Use" keyword is not allowed.
One way is creating a string variable and build up the syntax you need,
when execute it through sp_executesql.
Declare @.myQuery nvarchar(2000)
set @.myQuery = ' USE ' + @.dbname + CHAR(13) + 'SELECT * from myTable'
Exec sp_executesql @.myQuery
Another option is symply using the 3 part name:
Select * from myDb.dbo.myTable
If you try to loop through all datbases on a server have a look at
sp_MSforeachDB. It gives you an easy way to run the same command on all
databases.
Markus|||Thanks for your information and MarkusB too, I try booth your method
and it work well.
But I have another problem, assume that I want to create stored
procedure that work from A.dbo.Incomming to check a value from
B.dbo.Data and than the result value is send to A.dbo.Outgoing in one
stored procedure. I'm using MS Sql Server 7. I also have read that in
MS SQL 2003 have stored functions that return value.|||I have another question, how stored procedure in SQL Server 7 could
return value (like function)?|||Inside the proc, you do:
RETURN -101
And the calling code, of TSQL:
DECLARE @.retval int
EXEC @.retval = myproc
Return codes are int only and should be used to communicate status (success or fail). You can also
return values through output parameters:
CREATE PROC myproc @.parm varchar(5) OUT
AS
SET @.parm = 'Hello'
GO
DECLARE @.x varchar(5)
EXEC myproc @.parm = @.x OUT
Both return codes and out parameters can both be retrieved from your programming API (ADO.NET, for
example) as well.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Lemune" <alfredosilitonga@.gmail.com> wrote in message
news:1147948815.225334.130080@.i40g2000cwc.googlegroups.com...
>I have another question, how stored procedure in SQL Server 7 could
> return value (like function)?
>|||Thank you very much.|||I have another question again :-). Could Stored Procedure or Trigger
choose another database that is on difference engine? For example, I
have database A on engine or instance name Server1 that has a stored
procedure Stored_Proc_1 and in this stored procedure I want to access
some table on database B on engine Server2. I have username and
password on Server2.

Monday, March 19, 2012

Could not locate file 'data01_log' in sysfiles

I need to shrink this log file, and setup some maintenance tasks, but I am
getting the above error. Any advice is greatly appreciated.
sp_helpdb output:
DATA01
1 e:\mssql\data\data01.mdf
PRIMARY 4102976 KB Unlimited 10% data only
DATA01_log
2 c:\logfiles\data01_log.ldf
NULL 327296 KB 460800 KB 10% log only
When I run shrinkfile I get this:
dbcc shrinkfile (data01_log,320)
Server: Msg 8985, Level 16, State 1, Line 1
Could not locate file 'data01_log' in sysfiles.
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.Hi
If you do a SELECT * from sysfiles , what is the NAME returned ?
Are you then using the exact - case sensitive spelling?
Jack Vamvas
__________________________________________________________________
Receive free SQL tips - register at www.ciquery.com/sqlserver.htm
SQL Server Performance Audit - check www.ciquery.com/sqlserver_audit.htm
New article by Jack Vamvas - SQL and Markov Chains -
www.ciquery.com/articles/art_04.asp
"Rick Billingsley" <RickBillingsley@.discussions.microsoft.com> wrote in
message news:35983A24-DD51-43EA-A644-BA857A76F29B@.microsoft.com...
> I need to shrink this log file, and setup some maintenance tasks, but I am
> getting the above error. Any advice is greatly appreciated.
> sp_helpdb output:
> DATA01
> 1 e:\mssql\data\data01.mdf
>
> PRIMARY 4102976 KB Unlimited 10% data only
> DATA01_log
> 2
c:\logfiles\data01_log.ldf
>
> NULL 327296 KB 460800 KB 10% log only
> When I run shrinkfile I get this:
> dbcc shrinkfile (data01_log,320)
> Server: Msg 8985, Level 16, State 1, Line 1
> Could not locate file 'data01_log' in sysfiles.
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
>|||the select query returns the mastlog. This is not the log I am trying to
shrink/backup.
I believe the problem is that the log I want is on a different logical drive
(c vs. e) than the database.
I have tried running the shrinkfile with the exact case-sensitive spelling
with the same results.|||Change your database context to Data01. The select statement
indicates that you are trying to do this from the master
database. Shrinkfile applies to files in the current
database so you need to be in the appropriate database.
-Sue
On Mon, 23 Jan 2006 08:58:03 -0800, "Rick Billingsley"
<RickBillingsley@.discussions.microsoft.com> wrote:
>the select query returns the mastlog. This is not the log I am trying to
>shrink/backup.
>I believe the problem is that the log I want is on a different logical drive
>(c vs. e) than the database.
>I have tried running the shrinkfile with the exact case-sensitive spelling
>with the same results.

Thursday, March 8, 2012

Could not find the index entry for RID

Hi all, got this error and well want some advice really. Cheers
The process could not enumerate changes at the 'Subscriber'.
(Source: Merge Replication Provider (Agent); Error number: -2147200999)
------
Could not find the index entry for RID
'16f8db910fd437730d2cca409ba472f23ca363ef200' in index page (1:353425),
index ID 0, database 'VMR'.
(Source: BBSERVER-SAT1 (Data source); Error number: 644)
------
The merge process encountered an unexpected network error. The connection to
Subscriber 'BBSERVER-SAT1' is no longer available.
(Source: Merge Process (Agent); Error number: -2147199469)
------
Put the database in single user mode and run a dbcc dbreindex, this normally
solves this problem.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"andrew bourne" <andrewbourne@.vardells.com> wrote in message
news:OoLVGQN9FHA.4076@.tk2msftngp13.phx.gbl...
> Hi all, got this error and well want some advice really. Cheers
> The process could not enumerate changes at the 'Subscriber'.
> (Source: Merge Replication Provider (Agent); Error number: -2147200999)
> ------
> Could not find the index entry for RID
> '16f8db910fd437730d2cca409ba472f23ca363ef200' in index page (1:353425),
> index ID 0, database 'VMR'.
> (Source: BBSERVER-SAT1 (Data source); Error number: 644)
> ------
> The merge process encountered an unexpected network error. The connection
> to Subscriber 'BBSERVER-SAT1' is no longer available.
> (Source: Merge Process (Agent); Error number: -2147199469)
> ------
>

Friday, February 17, 2012

Corruption Problem- need some advice

Hi all,
we have been using SQL7 for a number of years on a Win2K box without so much
as one hiccup. Recently went out bought a new HP Server and SQL2000.
Installed it all, moved all the databases - and everything seemed to be
working fine.
A couple of weeks ago we had a problem with our biggest database (about 1gb
in size). Users were getting some errors from the app that uses it. I did a
DBCC CHECKDB on that database and it was coming up with almost 1000
inconsistencies etc etc. Tried Repair, to no avail and in the end just had
to Restore form backup - lost about a half a days work - not critical for
us.
Spoke to a few DBA's who said that it sounded Hardware related. Spoke to our
local IT support who we got the HP's from and they did a quick look and
everything came up OK.
A couple of days ago the same problem occurred. At a loss to explain what is
happening, so I'm hoping a few of you may be able to help.
One thing I did notice was that Write Cache was set on the server to 50%
Read 50% Write. I have only now changed it to 100% and No Write caching.
Could the above have caused it (50% Read 50% Write), or is it more than
likely I could have further corruption ? We haven't , I believe, had any
power outages or system crashes leading up to these corruptions.
Any help you could give me would be greatly appreciated.
cheers,
Adam
Adam,
While it's quite possible that you are hitting some SQL bug which corrupts
your database, it is far more likely that you may have some hardware or
driver related problem on that server. I would advise you to install the
latest SQL hotfix and update all your firmware and drivers. If you have
enabled /PAE in BOOT.INI then apply the PAE fix Q838765. Also review your
event logs in detail for ANY hardware-related errors and warnings. Use
SQLIOSTRESS to try to flush out I/O problems.
Going to the latest SQL build (i.e. 1007 or higher) will fix all known SQL
corruption bugs, but also enable new SQL Server I/O auditing features, such
as detection for stale read and lost writes, and perform consistency checks
on all pages read from the disk. Check all your database for corruption
before applying the hotfix. Then enable trace flags -T818 and -T806.
Lastly, the following articles contain more information about SQL I/O
requirements and how hardware problems may lead to corruption.
http://support.microsoft.com/kb/841776
http://support.microsoft.com/kb/826433
http://support.microsoft.com/kb/231619
http://www.microsoft.com/technet/pro...lIObasics.mspx
Adrian
"acs68" <adamst@.NOSPAMlaidley.qld.gov.au> wrote in message
news:eGuhUzPUFHA.2056@.tk2msftngp13.phx.gbl...
> Hi all,
> we have been using SQL7 for a number of years on a Win2K box without so
> much as one hiccup. Recently went out bought a new HP Server and SQL2000.
> Installed it all, moved all the databases - and everything seemed to be
> working fine.
> A couple of weeks ago we had a problem with our biggest database (about
> 1gb in size). Users were getting some errors from the app that uses it. I
> did a DBCC CHECKDB on that database and it was coming up with almost 1000
> inconsistencies etc etc. Tried Repair, to no avail and in the end just had
> to Restore form backup - lost about a half a days work - not critical for
> us.
> Spoke to a few DBA's who said that it sounded Hardware related. Spoke to
> our local IT support who we got the HP's from and they did a quick look
> and everything came up OK.
> A couple of days ago the same problem occurred. At a loss to explain what
> is happening, so I'm hoping a few of you may be able to help.
> One thing I did notice was that Write Cache was set on the server to 50%
> Read 50% Write. I have only now changed it to 100% and No Write caching.
> Could the above have caused it (50% Read 50% Write), or is it more than
> likely I could have further corruption ? We haven't , I believe, had any
> power outages or system crashes leading up to these corruptions.
> Any help you could give me would be greatly appreciated.
> cheers,
> Adam
>
|||Thanks for that advice Adrian, will look into it now.
cheers,
Adam
"Adrian Zajkeskovic" <azajkeskovic@.hotmail.com> wrote in message
news:Wp-dnacXw-zo4-TfRVn-3A@.rogers.com...
> Adam,
> While it's quite possible that you are hitting some SQL bug which corrupts
> your database, it is far more likely that you may have some hardware or
> driver related problem on that server. I would advise you to install the
> latest SQL hotfix and update all your firmware and drivers. If you have
> enabled /PAE in BOOT.INI then apply the PAE fix Q838765. Also review your
> event logs in detail for ANY hardware-related errors and warnings. Use
> SQLIOSTRESS to try to flush out I/O problems.
> Going to the latest SQL build (i.e. 1007 or higher) will fix all known SQL
> corruption bugs, but also enable new SQL Server I/O auditing features,
> such as detection for stale read and lost writes, and perform consistency
> checks on all pages read from the disk. Check all your database for
> corruption before applying the hotfix. Then enable trace flags -T818
> and -T806.
> Lastly, the following articles contain more information about SQL I/O
> requirements and how hardware problems may lead to corruption.
> http://support.microsoft.com/kb/841776
> http://support.microsoft.com/kb/826433
> http://support.microsoft.com/kb/231619
> http://www.microsoft.com/technet/pro...lIObasics.mspx
> Adrian
>
>
> "acs68" <adamst@.NOSPAMlaidley.qld.gov.au> wrote in message
> news:eGuhUzPUFHA.2056@.tk2msftngp13.phx.gbl...
>

Corruption Problem- need some advice

Hi all,
we have been using SQL7 for a number of years on a Win2K box without so much
as one hiccup. Recently went out bought a new HP Server and SQL2000.
Installed it all, moved all the databases - and everything seemed to be
working fine.
A couple of weeks ago we had a problem with our biggest database (about 1gb
in size). Users were getting some errors from the app that uses it. I did a
DBCC CHECKDB on that database and it was coming up with almost 1000
inconsistencies etc etc. Tried Repair, to no avail and in the end just had
to Restore form backup - lost about a half a days work - not critical for
us.
Spoke to a few DBA's who said that it sounded Hardware related. Spoke to our
local IT support who we got the HP's from and they did a quick look and
everything came up OK.
A couple of days ago the same problem occurred. At a loss to explain what is
happening, so I'm hoping a few of you may be able to help.
One thing I did notice was that Write Cache was set on the server to 50%
Read 50% Write. I have only now changed it to 100% and No Write caching.
Could the above have caused it (50% Read 50% Write), or is it more than
likely I could have further corruption ? We haven't , I believe, had any
power outages or system crashes leading up to these corruptions.
Any help you could give me would be greatly appreciated.
cheers,
AdamAdam,
While it's quite possible that you are hitting some SQL bug which corrupts
your database, it is far more likely that you may have some hardware or
driver related problem on that server. I would advise you to install the
latest SQL hotfix and update all your firmware and drivers. If you have
enabled /PAE in BOOT.INI then apply the PAE fix Q838765. Also review your
event logs in detail for ANY hardware-related errors and warnings. Use
SQLIOSTRESS to try to flush out I/O problems.
Going to the latest SQL build (i.e. 1007 or higher) will fix all known SQL
corruption bugs, but also enable new SQL Server I/O auditing features, such
as detection for stale read and lost writes, and perform consistency checks
on all pages read from the disk. Check all your database for corruption
before applying the hotfix. Then enable trace flags -T818 and -T806.
Lastly, the following articles contain more information about SQL I/O
requirements and how hardware problems may lead to corruption.
http://support.microsoft.com/kb/841776
http://support.microsoft.com/kb/826433
http://support.microsoft.com/kb/231619
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlIObasics.mspx
Adrian
"acs68" <adamst@.NOSPAMlaidley.qld.gov.au> wrote in message
news:eGuhUzPUFHA.2056@.tk2msftngp13.phx.gbl...
> Hi all,
> we have been using SQL7 for a number of years on a Win2K box without so
> much as one hiccup. Recently went out bought a new HP Server and SQL2000.
> Installed it all, moved all the databases - and everything seemed to be
> working fine.
> A couple of weeks ago we had a problem with our biggest database (about
> 1gb in size). Users were getting some errors from the app that uses it. I
> did a DBCC CHECKDB on that database and it was coming up with almost 1000
> inconsistencies etc etc. Tried Repair, to no avail and in the end just had
> to Restore form backup - lost about a half a days work - not critical for
> us.
> Spoke to a few DBA's who said that it sounded Hardware related. Spoke to
> our local IT support who we got the HP's from and they did a quick look
> and everything came up OK.
> A couple of days ago the same problem occurred. At a loss to explain what
> is happening, so I'm hoping a few of you may be able to help.
> One thing I did notice was that Write Cache was set on the server to 50%
> Read 50% Write. I have only now changed it to 100% and No Write caching.
> Could the above have caused it (50% Read 50% Write), or is it more than
> likely I could have further corruption ? We haven't , I believe, had any
> power outages or system crashes leading up to these corruptions.
> Any help you could give me would be greatly appreciated.
> cheers,
> Adam
>|||Thanks for that advice Adrian, will look into it now.
cheers,
Adam
"Adrian Zajkeskovic" <azajkeskovic@.hotmail.com> wrote in message
news:Wp-dnacXw-zo4-TfRVn-3A@.rogers.com...
> Adam,
> While it's quite possible that you are hitting some SQL bug which corrupts
> your database, it is far more likely that you may have some hardware or
> driver related problem on that server. I would advise you to install the
> latest SQL hotfix and update all your firmware and drivers. If you have
> enabled /PAE in BOOT.INI then apply the PAE fix Q838765. Also review your
> event logs in detail for ANY hardware-related errors and warnings. Use
> SQLIOSTRESS to try to flush out I/O problems.
> Going to the latest SQL build (i.e. 1007 or higher) will fix all known SQL
> corruption bugs, but also enable new SQL Server I/O auditing features,
> such as detection for stale read and lost writes, and perform consistency
> checks on all pages read from the disk. Check all your database for
> corruption before applying the hotfix. Then enable trace flags -T818
> and -T806.
> Lastly, the following articles contain more information about SQL I/O
> requirements and how hardware problems may lead to corruption.
> http://support.microsoft.com/kb/841776
> http://support.microsoft.com/kb/826433
> http://support.microsoft.com/kb/231619
> http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlIObasics.mspx
> Adrian
>
>
> "acs68" <adamst@.NOSPAMlaidley.qld.gov.au> wrote in message
> news:eGuhUzPUFHA.2056@.tk2msftngp13.phx.gbl...
>> Hi all,
>> we have been using SQL7 for a number of years on a Win2K box without so
>> much as one hiccup. Recently went out bought a new HP Server and SQL2000.
>> Installed it all, moved all the databases - and everything seemed to be
>> working fine.
>> A couple of weeks ago we had a problem with our biggest database (about
>> 1gb in size). Users were getting some errors from the app that uses it. I
>> did a DBCC CHECKDB on that database and it was coming up with almost 1000
>> inconsistencies etc etc. Tried Repair, to no avail and in the end just
>> had to Restore form backup - lost about a half a days work - not critical
>> for us.
>> Spoke to a few DBA's who said that it sounded Hardware related. Spoke to
>> our local IT support who we got the HP's from and they did a quick look
>> and everything came up OK.
>> A couple of days ago the same problem occurred. At a loss to explain what
>> is happening, so I'm hoping a few of you may be able to help.
>> One thing I did notice was that Write Cache was set on the server to 50%
>> Read 50% Write. I have only now changed it to 100% and No Write caching.
>> Could the above have caused it (50% Read 50% Write), or is it more than
>> likely I could have further corruption ? We haven't , I believe, had any
>> power outages or system crashes leading up to these corruptions.
>> Any help you could give me would be greatly appreciated.
>> cheers,
>> Adam
>