Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts

Wednesday, March 28, 2012

Ok, really Dumb question but still new

I've got a user that needs to be able to get into the attach to the
SQL database server (SQL 2000) from desktop engines I guess it would
be to manage some databases. He was a user that used to have domain
admin priveledges but I took those away so he wouldn't screw other
things up. How can I give him permissions to get what he needs
without giving him Domain Admin permissions? Is there a SQL admin
group or an area within SQL Enterprise manager to delegate SQL Admin
rights?
Thanks.
On Jan 31, 11:20 am, "newsqlman" <ndit...@.yahoo.com> wrote:
> I've got a user that needs to be able to get into the attach to the
> SQL database server (SQL 2000) from desktop engines I guess it would
> be to manage some databases. He was a user that used to have domain
> admin priveledges but I took those away so he wouldn't screw other
> things up. How can I give him permissions to get what he needs
> without giving him Domain Admin permissions? Is there a SQL admin
> group or an area within SQL Enterprise manager to delegate SQL Admin
> rights?
> Thanks.
If you go to Security/logins in Enterprise manager you can add a login
and assign the system administrator server role. This will give them
full admin privileges on the sql server instance.
|||So under Enterprise Manager, the sql group and local area which lists
all the folders.
There is a security folder and underneath it there is a logins
option. I see you can add logins there.
So what I need to do if I understand correctly is add the login from
the domain list domain\user and then
under the properties of that login I go to the server roles tab and
check server administrators box. Is that all
I need to do or do I need to specify all the databases under the
database access tab as well?
Thanks for the help.
|||If you're a server administrator, you're "god" on all of the databases, yes.
newsqlman wrote:
> So under Enterprise Manager, the sql group and local area which lists
> all the folders.
> There is a security folder and underneath it there is a logins
> option. I see you can add logins there.
> So what I need to do if I understand correctly is add the login from
> the domain list domain\user and then
> under the properties of that login I go to the server roles tab and
> check server administrators box. Is that all
> I need to do or do I need to specify all the databases under the
> database access tab as well?
> Thanks for the help.
>
-Dave Markle
http://www.markleconsulting.com/blog
sql

Friday, March 23, 2012

Offline Backup

Sorry, this on may be a very easy question for this group but I've to find
the right answer until weekend.. : ))
I should take offline backup at midnight after stopping sql server 2000.
But it's prohibited to stop by writing a task like "net stop MSSQLSERVER"
How can I stop my clustered Sql Server and take backup at midnights?
The whole idea of having a cluster is to have high availability. Why can't
you just do regular SQL Server backups?
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"aculfa" <aaa@.aa.com> wrote in message
news:Od5%23jb6JEHA.2884@.TK2MSFTNGP12.phx.gbl...
Sorry, this on may be a very easy question for this group but I've to find
the right answer until weekend.. : ))
I should take offline backup at midnight after stopping sql server 2000.
But it's prohibited to stop by writing a task like "net stop MSSQLSERVER"
How can I stop my clustered Sql Server and take backup at midnights?
|||Ok, that what clustering means..
But what should I do to stop my Sql Server?
I don't want it to work between some hours let's say..
How can this be done?
Shutting down passive server and stopping Sql Server from the active server
seems a bad solution. Any idea?
"Tom Moreau" <tom@.dont.spam.me.cips.ca>, iletide sunu yazdi
news:ua6RHj6JEHA.952@.TK2MSFTNGP12.phx.gbl...
> The whole idea of having a cluster is to have high availability. Why
can't
> you just do regular SQL Server backups?
> --
> Tom
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "aculfa" <aaa@.aa.com> wrote in message
> news:Od5%23jb6JEHA.2884@.TK2MSFTNGP12.phx.gbl...
> Sorry, this on may be a very easy question for this group but I've to find
> the right answer until weekend.. : ))
> I should take offline backup at midnight after stopping sql server 2000.
> But it's prohibited to stop by writing a task like "net stop MSSQLSERVER"
> How can I stop my clustered Sql Server and take backup at midnights?
>
>
|||You can use cluster manager to bring the service offline.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"aculfa" <aaa@.aa.com> wrote in message
news:e6oCG$6JEHA.3292@.TK2MSFTNGP11.phx.gbl...
Ok, that what clustering means..
But what should I do to stop my Sql Server?
I don't want it to work between some hours let's say..
How can this be done?
Shutting down passive server and stopping Sql Server from the active server
seems a bad solution. Any idea?
"Tom Moreau" <tom@.dont.spam.me.cips.ca>, iletide sunu yazdi
news:ua6RHj6JEHA.952@.TK2MSFTNGP12.phx.gbl...
> The whole idea of having a cluster is to have high availability. Why
can't
> you just do regular SQL Server backups?
> --
> Tom
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "aculfa" <aaa@.aa.com> wrote in message
> news:Od5%23jb6JEHA.2884@.TK2MSFTNGP12.phx.gbl...
> Sorry, this on may be a very easy question for this group but I've to find
> the right answer until weekend.. : ))
> I should take offline backup at midnight after stopping sql server 2000.
> But it's prohibited to stop by writing a task like "net stop MSSQLSERVER"
> How can I stop my clustered Sql Server and take backup at midnights?
>
>
|||How can I schedule such a job?
I want to bring Sql Server offline from cluster manager at midnight...
Should I stop cluster service?
"Tom Moreau" <tom@.dont.spam.me.cips.ca>, iletide sunu yazdi
news:%23uwhsD7JEHA.1944@.TK2MSFTNGP10.phx.gbl...
> You can use cluster manager to bring the service offline.
> --
> Tom
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "aculfa" <aaa@.aa.com> wrote in message
> news:e6oCG$6JEHA.3292@.TK2MSFTNGP11.phx.gbl...
> Ok, that what clustering means..
> But what should I do to stop my Sql Server?
> I don't want it to work between some hours let's say..
> How can this be done?
> Shutting down passive server and stopping Sql Server from the active
server[vbcol=seagreen]
> seems a bad solution. Any idea?
> "Tom Moreau" <tom@.dont.spam.me.cips.ca>, iletide sunu yazdi
> news:ua6RHj6JEHA.952@.TK2MSFTNGP12.phx.gbl...
> can't
find[vbcol=seagreen]
MSSQLSERVER"
>

Wednesday, March 21, 2012

Odd results from query

The environment is ASP.Net accessing the SQL server through IIS.
While, I've been told that .Net does not create a cache the behavior I'm
observing for intensive purposes looks as if there is a cache. I'm at a bit
of a loss to explain this behavior. Also, if I wait five or ten minutes, and
refresh I get the correct value.
I have a stored procdure that returns a series of rows, from which I sum a
particular number.
There is an action which causes another row to be added.
However, when I make this change to the database the change is not returned
in a query immediatly following the update. I have simultaneously run sql
query analyzer and verified that the table was updated correctly.
When the form is first displayed and then shortly after I perfomr the update
the value is recalculated via the following mechanism:
Using the global connection string a new SqlConnection object is built. Then
a new SqlCommand object is built using the new SqlConnection. The command
type is stored procedure. After the SqlCommand is setup (the command text and
parameters filled in), a new SqlDataAdapter is built using the SqlCommand.
The SqlDataAdapter fills a new DataSet, via the Fill method.
When I say that the object is new I mean that literally, as in
SqlCommand cmd = new SqlCommand (ConnectionString);
I would very much like to get the correct result right away.
Thanks,
Dave
I think you should share more details about the nature of your stored proc.
Are any parameters being passed to the procedure? When you say 5 or 10
minutes have passed before it returns the correct sum, are you using the same
active browser window, or are you starting a new browser (thus starting a new
session, and perhaps refreshing the state with the server, thus passing new
parameters to the procedure).
Just a guess - I'm probably way off and you probably already thought of all
that
Brian
"Dave" wrote:

> The environment is ASP.Net accessing the SQL server through IIS.
> While, I've been told that .Net does not create a cache the behavior I'm
> observing for intensive purposes looks as if there is a cache. I'm at a bit
> of a loss to explain this behavior. Also, if I wait five or ten minutes, and
> refresh I get the correct value.
> I have a stored procdure that returns a series of rows, from which I sum a
> particular number.
> There is an action which causes another row to be added.
> However, when I make this change to the database the change is not returned
> in a query immediatly following the update. I have simultaneously run sql
> query analyzer and verified that the table was updated correctly.
> When the form is first displayed and then shortly after I perfomr the update
> the value is recalculated via the following mechanism:
> Using the global connection string a new SqlConnection object is built. Then
> a new SqlCommand object is built using the new SqlConnection. The command
> type is stored procedure. After the SqlCommand is setup (the command text and
> parameters filled in), a new SqlDataAdapter is built using the SqlCommand.
> The SqlDataAdapter fills a new DataSet, via the Fill method.
> When I say that the object is new I mean that literally, as in
> SqlCommand cmd = new SqlCommand (ConnectionString);
> I would very much like to get the correct result right away.
> Thanks,
> Dave
sql

Odd pivot table type query

I've been unable to find a way to write the following
query.
Assuming this table:
Year Quarter
-- --
1990 1
1990 2
1990 3
1990 4
1991 1
1991 2
1991 3
1991 4
Does anyone know how to write an SQL query to generate the
following results?
Year Quarter
-- --
1990 1,2,3,4
1991 1,2,3,4
For documented method, you will have to make use of procedural code to
achieve this. See following example. OR you will have to use some 3rd party
tool to do it(www.rac4sql.com).
Eg:
-- sample table
-- if object_id('tab') is not null
-- drop table tab
create table tab(ID int,
SEQ_NUM int ,
ROUTE varchar(50))
go
-- sample data
insert into tab values(1 ,1 ,'AA')
insert into tab values(1 ,2 ,'BB')
insert into tab values(1 ,3 ,'CC')
insert into tab values(2 ,1 ,'AA')
insert into tab values(3 ,1 ,'VV')
insert into tab values(3 ,2 ,'XX')
go
-- t-sql code for generating report
if object_id('tempdb..#tmp') is not null
drop table #tmp
create table #tmp(id int, tmpval varchar(50))
go
declare @.id int
declare @.seq_num int
declare @.route varchar(50), @.f_route varchar(50)
select @.id=0, @.seq_num=0, @.route='', @.f_route=''
while @.id is not null
begin
select @.id=min(id) from tab where id > @.id
while @.seq_num is not null
begin
select @.seq_num=min(seq_num), @.route=min(route)from tab where id = @.id
and seq_num > @.seq_num
If @.seq_num is null and @.id is not null
insert into #tmp values(@.id, @.f_route)
select @.f_route = @.f_route + case @.f_route when '' then '' else ','
end + @.route
end
select @.seq_num=0, @.f_route=''
end
select * from #tmp
truncate table #tmp
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com
|||Thanks for the response Vishal. Unfortunatly this
solution isn't going to work for me since I dealing with a
very large number of records the performace of populating
a new table is going to be too great.
I'm adding a "download" feature for the data so this would
result is a large number of records being retuned and
written to file.
What would be great is is I could use somethine like a
GROUP BY and SUM where the SUM would append strings
together.
SELECT year, APPEND(Quarter)
FROM mytable
GROUP BY year

>--Original Message--
>For documented method, you will have to make use of
procedural code to
>achieve this. See following example. OR you will have to
use some 3rd party
>tool to do it(www.rac4sql.com).
>Eg:
>-- sample table
>-- if object_id('tab') is not null
>-- drop table tab
>create table tab(ID int,
>SEQ_NUM int ,
>ROUTE varchar(50))
>go
>-- sample data
>insert into tab values
(1 ,1 ,'AA')
>insert into tab values
(1 ,2 ,'BB')
>insert into tab values
(1 ,3 ,'CC')
>insert into tab values
(2 ,1 ,'AA')
>insert into tab values
(3 ,1 ,'VV')
>insert into tab values
(3 ,2 ,'XX')
>go
>-- t-sql code for generating report
>if object_id('tempdb..#tmp') is not null
>drop table #tmp
>create table #tmp(id int, tmpval varchar(50))
>go
>declare @.id int
>declare @.seq_num int
>declare @.route varchar(50), @.f_route varchar(50)
>select @.id=0, @.seq_num=0, @.route='', @.f_route=''
>while @.id is not null
>begin
> select @.id=min(id) from tab where id > @.id
> while @.seq_num is not null
> begin
> select @.seq_num=min(seq_num), @.route=min(route)from
tab where id = @.id
> and seq_num > @.seq_num
> If @.seq_num is null and @.id is not null
> insert into #tmp values(@.id, @.f_route)
> select @.f_route = @.f_route + case @.f_route when ''
then '' else ','
>end + @.route
> end
> select @.seq_num=0, @.f_route=''
>end
>select * from #tmp
>truncate table #tmp
>--
>Vishal Parkar
>vgparkar@.yahoo.co.in | vgparkar@.hotmail.com
>
>.
>
|||Shawn,
There is no function as such which will do the things for you.
You may try following approach using User defined function. But remember,
this is not a documented method, so it can not be reliable under all
cirumstances.
CREATE FUNCTION EmpPhones (@.ID INT)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @.str VARCHAR(1000)
SELECT @.str = ISNULL(@.str + ',', '') + cats
FROM tab WHERE id = @.ID
RETURN (@.str)
END
-- sample data / result set.
if object_id ('tab') is not null
drop table tab
go
create table tab(ID int,
cats varchar(50))
go
insert into tab values(1 ,'1-001')
insert into tab values(1 ,'2-002')
insert into tab values(1 ,'3-003')
insert into tab values(2 ,'1-011')
insert into tab values(3 ,'1-012')
insert into tab values(3 ,'2-022')
go
--And then you would call this UDF from within a SELECT statement, as
follows:
select distinct id,dbo.empphones(id) 'comma seperated value' from tab
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com

Tuesday, March 20, 2012

Odd INSERT INTO issue with replication setup

I've got a db setup for replication. Replication works fine in both
directions. However ...
On the SQL2k backend, I can do an INSERT INTO to a particular table
(Results) with no problem. When I try to do the same INSERT INTO on the
Results table with SQLCE, I get the error message, "A duplicate value cannot
be inserted into a unique index". Note that I can do an UPDATE on the
Results table with no problem.
I do have one guidcol (uniqueidentifier, Non-null) on the SQL Server table.
To simplify matters, I have NO indexes (except the PK) and a single INT
primary key.
I've noticed in the Query Analyzer (SQLCE), that after a replication sync,
there are now 3 index (?) columns on the table, 2 of which are not in the
main SQLServer table.
s_Generation (int)
s_RowLineage (varbinary)
rowguid (uniqueidentifier)
Is this INSERT INTO failure somehow related to the extra columns added or is
this a rowguid problem?
Earl,
does your INSERT INTO specify the guid's value?
Rgds,
Paul Ibison
|||No it does not. My understanding is that this is a read-only column?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:eVEX24TVFHA.3044@.TK2MSFTNGP10.phx.gbl...
> Earl,
> does your INSERT INTO specify the guid's value?
> Rgds,
> Paul Ibison
>
|||If there's only one index on the PK and you're not entering a duplicate
record, then the problem must be with the system tables. I notice that you
have posted this same question some time ago without it being solved. Have
you reinitialized in the meantime? Does the error occur after
reinitialization? How about if you remove replication and set it up - is it
reproducible?
Rgds,
Paul Ibison
|||Yes, I actually removed replication from SQL2k, made sure everything was
cleaned out of the database and set it all back up (I drop the database
during the replication process on the subscriber/SQLCE side). I'm really
scratching my head on this one, because everything "looks" correct. I posted
the code for the INSERT INTO logic over in the
microsoft.public.dotnet.framework.adonet forum, just in case I missed
something on that side of it. Apparently it is accurate, as I've had no
responses to a request for input.
What is left? Does the SQLCE database not actually generate a guid for that
column?
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:eRws5BYVFHA.628@.TK2MSFTNGP09.phx.gbl...
> If there's only one index on the PK and you're not entering a duplicate
> record, then the problem must be with the system tables. I notice that you
> have posted this same question some time ago without it being solved. Have
> you reinitialized in the meantime? Does the error occur after
> reinitialization? How about if you remove replication and set it up - is
> it reproducible?
> Rgds,
> Paul Ibison
>

Wednesday, March 7, 2012

odbc sql native client

I've installed the SQL Server 2005 client utilities on a laptop that's used
for development. When I try to create an odbc connect to SQL Native Client
2005.90.1399.00 that specific driver doesn't appear in the list of drivers
available for selection. I've verified that it is in fact installed.
What's the problem, why doesn't it appear?
It's hard to say where exactly you are seeing this issue but
I would guess you are trying to create a DSN using the SQL
Native Client. Try updating your MDAC and verify that the
MDAC installation is correct on the laptop. You can check
the MDAC installation using component checker. You can
download component checker as well as the latest MDAC
versions from:
http://msdn2.microsoft.com/en-us/data/aa937730.aspx
-Sue
On Tue, 24 Jul 2007 09:12:01 -0700, gracie
<gracie@.discussions.microsoft.com> wrote:

>I've installed the SQL Server 2005 client utilities on a laptop that's used
>for development. When I try to create an odbc connect to SQL Native Client
>2005.90.1399.00 that specific driver doesn't appear in the list of drivers
>available for selection. I've verified that it is in fact installed.
>What's the problem, why doesn't it appear?
>
>
|||I have a similar issue with one desktop in our office. The SQL Native
Client doesn't appear in the ODBC list when opening up "User DSN".
Nothing seems to be different on this system from the 20 others that
it does appear on. MDAC is the latest one also. Have any other ideas
of what I might look for?
Sue Hoegemeier wrote:[vbcol=seagreen]
> It's hard to say where exactly you are seeing this issue but
> I would guess you are trying to create a DSN using the SQL
> Native Client. Try updating your MDAC and verify that the
> MDAC installation is correct on the laptop. You can check
> the MDAC installation using component checker. You can
> download component checker as well as the latest MDAC
> versions from:
> http://msdn2.microsoft.com/en-us/data/aa937730.aspx
> -Sue
> On Tue, 24 Jul 2007 09:12:01 -0700, gracie
> <gracie@.discussions.microsoft.com> wrote:

Monday, February 20, 2012

ODBC from SQL Server 2000 to Word 2003

I have a table of address data which I'd like to put into a mailmerge of
envelopes in Word 2003. When I select the Query which I've already set up,
an error message says "Record 1 contained too few fields".
This problem doesn't happen in Excel 2003, and it didn't happen at all
before we changed the SQL Server in January. I've installed all service
packs for the server and for Office.
I'm not sure whether this is a Word problem or not, so I've posted here and
in the Word group.
Tim
That's a word error and related to how word is interpreting
the fields you are using for the mail merge. Years ago, it
could happen with some odd characters in the data -
generally control characters if I remember right.
But it's something more on the word side or how word is
interpreting the data.
-Sue
On Tue, 22 Feb 2005 11:04:25 -0000, "Tim Gowen"
<tim.gowen@.rafmuseum.org> wrote:

>I have a table of address data which I'd like to put into a mailmerge of
>envelopes in Word 2003. When I select the Query which I've already set up,
>an error message says "Record 1 contained too few fields".
>This problem doesn't happen in Excel 2003, and it didn't happen at all
>before we changed the SQL Server in January. I've installed all service
>packs for the server and for Office.
>I'm not sure whether this is a Word problem or not, so I've posted here and
>in the Word group.
>
> Tim
>