Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Friday, March 30, 2012

Release A Install Problems

We have packaged MSDE 2000 release A with our applicaiton. A user ran the
install, but when MSDE goes to start it says, MSDE is either currport or has
been tampered with, please uninstall and reinstall MSDE, invalid package ID.
We go to unstill MSDE and it says MSDE is not installed... We tried
reinstalling, since it thought it wasn't installed and when the installer
starts, we get the same invaled package id error... Does anyone have any
ideas, or thoughts on what is happening or what I can do to fix this? Thanks,
Brian
Did you define a strong password for SA using the SAPWD parameter? MSDE SP3A
setup.exe will not install a new instance without it.
joe.
"Brian" <Brian@.discussions.microsoft.com> wrote in message
news:C8D287B9-BCD6-4423-AF48-21455901D596@.microsoft.com...
> We have packaged MSDE 2000 release A with our applicaiton. A user ran the
> install, but when MSDE goes to start it says, MSDE is either currport or
> has
> been tampered with, please uninstall and reinstall MSDE, invalid package
> ID.
> We go to unstill MSDE and it says MSDE is not installed... We tried
> reinstalling, since it thought it wasn't installed and when the installer
> starts, we get the same invaled package id error... Does anyone have any
> ideas, or thoughts on what is happening or what I can do to fix this?
> Thanks,
> Brian
>

Relative Performance: Native SQL vs User Functions

Hi all,
I'm interested in knowing, for a fact, what the performance overhead of
using a functional-language based query e.g.
select * from customers where dbo.ufn_stringcontains(custname, 'ar')=1
is over a conventional SQL statement:
select * from addrb4 where custname like '%'+'ar'+'%'
From the execution plan in my SQL2000 query analyser, it shows the
functional query is slightly better costing the batch of 49.97%. However,
both queries take 28 seconds to execute. I was expecting the functional
query to be slower so I'm a bit surprised.
I know the perfomance of the functional query depends on how complex the
function is. In my applications, the functions will be quite simple and where
they will be complex, a convenctional equivalent will equally complex to
build.
Your opinions, experience and test runs are welcome.
--
NB: declaration for ufn_stringcontains:
create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
returns bit
as
begin
declare @.ret bit
if (@.m like '%'+@.s+'%')
set @.ret=1
else
set @.ret=0
return @.ret
endBecause of the like you are using, a table scan in involved, resulting in
mostly IO.
Try running the same query and function, but using only like to the right of
the search string (select * from addrb4 where custname like 'ar'+'%') and
have an index on custname.
You will find that the difference becomes clearer as soon as more records
can be eliminated by a index seek or scan.
Functions are faster sometimes, and sometimes they destroy performance. It
varies and there is no hard and fast rule.
Regards
Mike
"Sienko" wrote:
> Hi all,
> I'm interested in knowing, for a fact, what the performance overhead of
> using a functional-language based query e.g.
> select * from customers where dbo.ufn_stringcontains(custname, 'ar')=1
> is over a conventional SQL statement:
> select * from addrb4 where custname like '%'+'ar'+'%'
> From the execution plan in my SQL2000 query analyser, it shows the
> functional query is slightly better costing the batch of 49.97%. However,
> both queries take 28 seconds to execute. I was expecting the functional
> query to be slower so I'm a bit surprised.
> I know the perfomance of the functional query depends on how complex the
> function is. In my applications, the functions will be quite simple and where
> they will be complex, a convenctional equivalent will equally complex to
> build.
> Your opinions, experience and test runs are welcome.
> --
> NB: declaration for ufn_stringcontains:
> create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
> returns bit
> as
> begin
> declare @.ret bit
> if (@.m like '%'+@.s+'%')
> set @.ret=1
> else
> set @.ret=0
> return @.ret
> end
>|||"Sienko" <Sienko@.discussions.microsoft.com> wrote in message
news:0ABAE066-2E11-4679-9AAA-8E9B8A636DD2@.microsoft.com...
> create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
> returns bit
> as
> begin
> declare @.ret bit
> if (@.m like '%'+@.s+'%')
> set @.ret=1
> else
> set @.ret=0
> return @.ret
> end
You could speed it up a tad by doing early returns:
if (@.m like '%'+@.s+'%' )
return 1
else
return 0
Personally, I find this style easier to understand, as well.

Relative Performance: Native SQL vs User Functions

Hi all,
I'm interested in knowing, for a fact, what the performance overhead of
using a functional-language based query e.g.
select * from customers where dbo.ufn_stringcontains(custname, 'ar')=1
is over a conventional SQL statement:
select * from addrb4 where custname like '%'+'ar'+'%'
From the execution plan in my SQL2000 query analyser, it shows the
functional query is slightly better costing the batch of 49.97%. However,
both queries take 28 seconds to execute. I was expecting the functional
query to be slower so I'm a bit surprised.
I know the perfomance of the functional query depends on how complex the
function is. In my applications, the functions will be quite simple and wher
e
they will be complex, a convenctional equivalent will equally complex to
build.
Your opinions, experience and test runs are welcome.
NB: declaration for ufn_stringcontains:
create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
returns bit
as
begin
declare @.ret bit
if (@.m like '%'+@.s+'%')
set @.ret=1
else
set @.ret=0
return @.ret
endBecause of the like you are using, a table scan in involved, resulting in
mostly IO.
Try running the same query and function, but using only like to the right of
the search string (select * from addrb4 where custname like 'ar'+'%') and
have an index on custname.
You will find that the difference becomes clearer as soon as more records
can be eliminated by a index seek or scan.
Functions are faster sometimes, and sometimes they destroy performance. It
varies and there is no hard and fast rule.
Regards
Mike
"Sienko" wrote:

> Hi all,
> I'm interested in knowing, for a fact, what the performance overhead of
> using a functional-language based query e.g.
> select * from customers where dbo.ufn_stringcontains(custname, 'ar')=1
> is over a conventional SQL statement:
> select * from addrb4 where custname like '%'+'ar'+'%'
> From the execution plan in my SQL2000 query analyser, it shows the
> functional query is slightly better costing the batch of 49.97%. However,
> both queries take 28 seconds to execute. I was expecting the functional
> query to be slower so I'm a bit surprised.
> I know the perfomance of the functional query depends on how complex the
> function is. In my applications, the functions will be quite simple and wh
ere
> they will be complex, a convenctional equivalent will equally complex to
> build.
> Your opinions, experience and test runs are welcome.
> --
> NB: declaration for ufn_stringcontains:
> create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
> returns bit
> as
> begin
> declare @.ret bit
> if (@.m like '%'+@.s+'%')
> set @.ret=1
> else
> set @.ret=0
> return @.ret
> end
>|||"Sienko" <Sienko@.discussions.microsoft.com> wrote in message
news:0ABAE066-2E11-4679-9AAA-8E9B8A636DD2@.microsoft.com...

> create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
> returns bit
> as
> begin
> declare @.ret bit
> if (@.m like '%'+@.s+'%')
> set @.ret=1
> else
> set @.ret=0
> return @.ret
> end
You could speed it up a tad by doing early returns:
if (@.m like '%'+@.s+'%' )
return 1
else
return 0
Personally, I find this style easier to understand, as well.|||The problem is mostly in how you use them. You could inappropriately use a
system function as well and in this case the wildcard prefix only makes the
problem worse.
For example:
SELECT <something>
FROM <some table> AS t1
WHERE DAY(DATEADD(day, 1, t1.<some date column> )) = 12
These are system supplied functions but this query is going to be costly reg
ardless if the date column is indexed or not. User defined functions are no
exception.
In your query, not only are you doing a lousy string search using the wildca
rd prefix, you are attempting to use a function to encapsulate a criteria.
You shouldn't see any difference in performance at all. In this case, the h
aystack is going to swamp in needle differences between straw.
Sincerely,
Anthony Thomas
--
"Sienko" <Sienko@.discussions.microsoft.com> wrote in message news:0ABAE066
-2E11-4679-9AAA-8E9B8A636DD2@.microsoft.com...
Hi all,
I'm interested in knowing, for a fact, what the performance overhead of
using a functional-language based query e.g.
select * from customers where dbo.ufn_stringcontains(custname, 'ar')=1
is over a conventional SQL statement:
select * from addrb4 where custname like '%'+'ar'+'%'
From the execution plan in my SQL2000 query analyser, it shows the
functional query is slightly better costing the batch of 49.97%. However,
both queries take 28 seconds to execute. I was expecting the functional
query to be slower so I'm a bit surprised.
I know the perfomance of the functional query depends on how complex the
function is. In my applications, the functions will be quite simple and wh
ere
they will be complex, a convenctional equivalent will equally complex to
build.
Your opinions, experience and test runs are welcome.
--
NB: declaration for ufn_stringcontains:
create function ufn_stringontains (@.m varchar(8000) , @.s varchar(8000) )
returns bit
as
begin
declare @.ret bit
if (@.m like '%'+@.s+'%')
set @.ret=1
else
set @.ret=0
return @.ret
endsql

Relationships on MSDE

I am an Access user.
In Access when I create a relationship between 2 tables is use
Enforce Referential Integrity
Cascade Update Related Fields
Cascade Delete Related Records
If I change data in Primary Table is Update automaticaly in Foreign table.

I use a MSDE database, and I create 2 tabele
Table 1 - with a primary key (AUT_ID)
Table 2 (Foreign table) with 2 fields
Field :AUT_ID
Field: Field1
I use Access interfaces (adp Database) and I create a Diagram
Primary key table: Table_1; Field: AUT_ID
Foreign table: Table_2; Field: AUT_ID

PROBLEM: If I change data in Table_1 (field AUT_ID) data is not change in Table_2 and error occurs.[i]
PROBLEM: If I change data in Table_1 (field AUT_ID) data is not change in Table_2 and error occurs.

I see nothing that requests any sort of cascading-update.

Furthermore, Table_2 is clearly the master-table of the relationship and Table_1 the subordinate. Thus a change to Table_1 to introduce a key not in Table_2 would be disallowed, as you see.|||Is a version problem if I understud corectly
SQL vers.7 did not suport ON UPDATE NO ACTION / CASCADE
SQL vers.8 (suport ON UPDATE NO ACTION / CASCADE)
I installed vers.8 and everything is OK.

Thanks.

Monday, March 26, 2012

Relation to dbid in sysdatabases

What if i update a dbid from 14 to 24 say for example, is there a reference
to it in any system tables in the corresponding user database itself that i
would also need to update. Just curious.
Will the db go into suspect mode or will it just continue to function as
normal ?I don't think there are references in the database itself to the dbid, but
there are plenty of references in master to the database id, including in
sysxlogins, which you also asked about. Some of the tables are
pseudo-tables, so they would probably be fine, but many are real tables what
could be corrupted if you updated a dbid.
I have never done this, so I can't tell you for sure what might break.
This query will show you all the columns in tables in master that reference
dbid:
use master
select name, object_name(id), objectproperty(id, 'tableisfake') from
syscolumns where name = 'dbid'
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:ORSqfECdDHA.372@.TK2MSFTNGP11.phx.gbl...
> What if i update a dbid from 14 to 24 say for example, is there a
reference
> to it in any system tables in the corresponding user database itself that
i
> would also need to update. Just curious.
> Will the db go into suspect mode or will it just continue to function as
> normal ?
>|||Hi Hassan,
I've never tried this, a lot of the system uses the database name as it's
key, so maybe you would get away without breaking too much
......but any update to system tables is unsupported..........
Why would you want to do this ?
Regards,
Clive Challinor [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.

Friday, March 23, 2012

Re-installing SQL Server

A remote user messed up my installation of SQL SP3 and now the SQL Server property shows it has SP3 but in fact it never went though the process. I'm planning to re-isntll the SQL server then apply the SP3.
Is there an article or can someone give me some pointers of preparation prior to removing the current SQL server. Also, currently I only know to back up the database file. Can I backup and restore the Master DB and it will retore all users' login and pa
sswords to a particular database now on the server?
Thanks,
Alpha
Have you tried reinstalling sp3? If it still fails without a good reason, I
highly recommend you starting reinstallation from scratch because the
previous failed sp install may have corrupted the SQL instance, or at least
changed system schemas etc, leaving you in a inconsistent state. You can run
sp_help_revlogin to script out all user logins and save them. Also detach
all user dbs for future attach. You need to script out all jobs, alerts,
etc. also to avoid restoring msdb.
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:3D37FDD1-7C11-4DAE-99A6-E2E12CC11A76@.microsoft.com...
> A remote user messed up my installation of SQL SP3 and now the SQL Server
property shows it has SP3 but in fact it never went though the process. I'm
planning to re-isntll the SQL server then apply the SP3.
> Is there an article or can someone give me some pointers of preparation
prior to removing the current SQL server. Also, currently I only know to
back up the database file. Can I backup and restore the Master DB and it
will retore all users' login and passwords to a particular database now on
the server?
> Thanks,
> Alpha
|||I tried reinstalling sp3 twice and both time it won't go through. The sql server status shows it has SP3 when in fact the installation never went through. It is in a confused state. I will be removing the sql server installation, deleted the folder and
then re-install from scratch. I search the on-line book for more detail of sp_help_revlogin but it is not found. Is there a typo?
Thanks,
Alpha
"Richard Ding" wrote:

> Have you tried reinstalling sp3? If it still fails without a good reason, I
> highly recommend you starting reinstallation from scratch because the
> previous failed sp install may have corrupted the SQL instance, or at least
> changed system schemas etc, leaving you in a inconsistent state. You can run
> sp_help_revlogin to script out all user logins and save them. Also detach
> all user dbs for future attach. You need to script out all jobs, alerts,
> etc. also to avoid restoring msdb.
>
> "Alpha" <Alpha@.discussions.microsoft.com> wrote in message
> news:3D37FDD1-7C11-4DAE-99A6-E2E12CC11A76@.microsoft.com...
> property shows it has SP3 but in fact it never went though the process. I'm
> planning to re-isntll the SQL server then apply the SP3.
> prior to removing the current SQL server. Also, currently I only know to
> back up the database file. Can I backup and restore the Master DB and it
> will retore all users' login and passwords to a particular database now on
> the server?
>
>
|||Yes, you can backup and restore master, model, everything... But I think I
would open a PSS call to get MS support for this... Perhaps they can help
you get through without re-install... The cost is just $249 I think..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:58D9149D-F7B0-423F-9EE7-CA7E1AC62C13@.microsoft.com...
> I tried reinstalling sp3 twice and both time it won't go through. The sql
server status shows it has SP3 when in fact the installation never went
through. It is in a confused state. I will be removing the sql server
installation, deleted the folder and then re-install from scratch. I search
the on-line book for more detail of sp_help_revlogin but it is not found.
Is there a typo?[vbcol=seagreen]
> Thanks,
> Alpha
>
> "Richard Ding" wrote:
reason, I[vbcol=seagreen]
least[vbcol=seagreen]
run[vbcol=seagreen]
detach[vbcol=seagreen]
Server[vbcol=seagreen]
I'm[vbcol=seagreen]
preparation[vbcol=seagreen]
to[vbcol=seagreen]
it[vbcol=seagreen]
on[vbcol=seagreen]

Re-installing SQL Server

A remote user messed up my installation of SQL SP3 and now the SQL Server pr
operty shows it has SP3 but in fact it never went though the process. I'm p
lanning to re-isntll the SQL server then apply the SP3.
Is there an article or can someone give me some pointers of preparation prio
r to removing the current SQL server. Also, currently I only know to back u
p the database file. Can I backup and restore the Master DB and it will ret
ore all users' login and pa
sswords to a particular database now on the server?
Thanks,
AlphaHave you tried reinstalling sp3? If it still fails without a good reason, I
highly recommend you starting reinstallation from scratch because the
previous failed sp install may have corrupted the SQL instance, or at least
changed system schemas etc, leaving you in a inconsistent state. You can run
sp_help_revlogin to script out all user logins and save them. Also detach
all user dbs for future attach. You need to script out all jobs, alerts,
etc. also to avoid restoring msdb.
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:3D37FDD1-7C11-4DAE-99A6-E2E12CC11A76@.microsoft.com...
> A remote user messed up my installation of SQL SP3 and now the SQL Server
property shows it has SP3 but in fact it never went though the process. I'm
planning to re-isntll the SQL server then apply the SP3.
> Is there an article or can someone give me some pointers of preparation
prior to removing the current SQL server. Also, currently I only know to
back up the database file. Can I backup and restore the Master DB and it
will retore all users' login and passwords to a particular database now on
the server?
> Thanks,
> Alpha|||I tried reinstalling sp3 twice and both time it won't go through. The sql s
erver status shows it has SP3 when in fact the installation never went throu
gh. It is in a confused state. I will be removing the sql server installat
ion, deleted the folder and
then re-install from scratch. I search the on-line book for more detail of
sp_help_revlogin but it is not found. Is there a typo?
Thanks,
Alpha
"Richard Ding" wrote:

> Have you tried reinstalling sp3? If it still fails without a good reason,
I
> highly recommend you starting reinstallation from scratch because the
> previous failed sp install may have corrupted the SQL instance, or at leas
t
> changed system schemas etc, leaving you in a inconsistent state. You can r
un
> sp_help_revlogin to script out all user logins and save them. Also detach
> all user dbs for future attach. You need to script out all jobs, alerts,
> etc. also to avoid restoring msdb.
>
> "Alpha" <Alpha@.discussions.microsoft.com> wrote in message
> news:3D37FDD1-7C11-4DAE-99A6-E2E12CC11A76@.microsoft.com...
> property shows it has SP3 but in fact it never went though the process. I
'm
> planning to re-isntll the SQL server then apply the SP3.
> prior to removing the current SQL server. Also, currently I only know to
> back up the database file. Can I backup and restore the Master DB and it
> will retore all users' login and passwords to a particular database now on
> the server?
>
>|||Yes, you can backup and restore master, model, everything... But I think I
would open a PSS call to get MS support for this... Perhaps they can help
you get through without re-install... The cost is just $249 I think..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Alpha" <Alpha@.discussions.microsoft.com> wrote in message
news:58D9149D-F7B0-423F-9EE7-CA7E1AC62C13@.microsoft.com...
> I tried reinstalling sp3 twice and both time it won't go through. The sql
server status shows it has SP3 when in fact the installation never went
through. It is in a confused state. I will be removing the sql server
installation, deleted the folder and then re-install from scratch. I search
the on-line book for more detail of sp_help_revlogin but it is not found.
Is there a typo?[vbcol=seagreen]
> Thanks,
> Alpha
>
> "Richard Ding" wrote:
>
reason, I[vbcol=seagreen]
least[vbcol=seagreen]
run[vbcol=seagreen]
detach[vbcol=seagreen]
Server[vbcol=seagreen]
I'm[vbcol=seagreen]
preparation[vbcol=seagreen]
to[vbcol=seagreen]
it[vbcol=seagreen]
on[vbcol=seagreen]

Wednesday, March 21, 2012

ReInstall Sql Server

I lost access to sql server, "sa" is "Denied" "builtin"
is "Denied" before I have a login for a standart user but
I can't use it I get connection fail all the time. I want
to reinstall Sql Server am i going to lose the databases?
Is there any hope for this situation?
Please Help!!!!!!!!!
ShalomHello,
it depends on your NT-Account. If you have still access to the
server console you can login, shutdown the sql-services and
copy the database files to a secure place.
You can than use the rebuildm.exe tool to create new system-db's.
Reattach the user-db's and all is fine.
That would be my suggestion...but maybe some have a better one.
cu
p.s:
But how you have lost the rights?
You have made backups of your system and user databases?
"Shalom" <Telaviv7777777@.aol.com> wrote in message
news:009f01c3cbda$9c3c1c40$a301280a@.phx.gbl...
quote:

> I lost access to sql server, "sa" is "Denied" "builtin"
> is "Denied" before I have a login for a standart user but
> I can't use it I get connection fail all the time. I want
> to reinstall Sql Server am i going to lose the databases?
> Is there any hope for this situation?
> Please Help!!!!!!!!!
> Shalom
|||You have a couple of possible solutions.
1. Restore master from a backup
2. Rebuild master then re-attach the user databases.
3. Attempt a Windows NT Athenticated connection with the NT admin account
on the server.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||Hi Christian,
Thank You for trying to help.
1) I selected security from the console root I epanded the
server than selected security clcked on login than
selected "sa" than selected "denied" for "sa" user.
2)I did not make a backup.
Shalom
quote:

>--Original Message--
>Hello,
>
>it depends on your NT-Account. If you have still access

to the
quote:

>server console you can login, shutdown the sql-services

and
quote:

>copy the database files to a secure place.
>You can than use the rebuildm.exe tool to create new

system-db's.
quote:

>Reattach the user-db's and all is fine.
>That would be my suggestion...but maybe some have a

better one.
quote:

>cu
>p.s:
>But how you have lost the rights?
>You have made backups of your system and user databases?
>
>"Shalom" <Telaviv7777777@.aol.com> wrote in message
>news:009f01c3cbda$9c3c1c40$a301280a@.phx.gbl...
but[QUOTE]
want[QUOTE]
databases?[QUOTE]
>
>.
>

Tuesday, March 20, 2012

Reinserting certain records of a table in to the same table

Hi

How can I reinsert certain records of a table in to the same table and change only one column? This is story : I have a table that user enters daily records in it , most of these record are same as records of yesterday. So I want to reinsert them and let user to edit them if needed.

I have a other question too , there are 2 tables that are related to table above and I have to reinsert the related records too for example there are 4 records in second table that related to the fist row of the first table .

I can do all of it with asp.net using loops and connecting and disconnecting to database per insert but it doesn't seems to be so wisely , I rather do it with a stored procedure .

Thank you in advance

This ought to work:

insert into table (...columns...) select ...columns... from table where ....

Assumes you have an identity column that is NOT in the list of fields (ie, let sql server handle that for you)

I don't understand your second question, ie, how is it different than the first?

|||

Thank you David ,

Abut my first question, there is a column that I have to change it's value , It concerns abut date of report how do I handle that ?I gues it must be something like this :
insert into table (...columns...) ,[TodayReportID] select ...columns... from table where .... ? @.TodayReportIDFor better understanding see the example of question 2My second question :Assume these are table above columns :
? [Table1ID] ,[ column1], [ column2], [TodayReportID]
1 AAAA BBBB 1
2 CCCC DDDD 1
3 EEEE FFFF 1
And there is an other table I name it Table 2 and [Table1ID] is a foreign key in it related to table 1 so all records below are related to 2nd row of table one .
? [Table2ID] ,[Table1ID], [ column2]
1 2 GGG
2 2 HHH
3 2 KKK
Now assume I reinsert second row of table 1 it will be something like this :
? [Table1ID] ,[ column1], [ column2], [TodayReportID]

4 CCCC DDDD 2
Now I have to reinsert related row of Table2 too :
? [Table2ID] ,[Table1ID], [ column2]
4 4 GGG
5 4 HHH
6 4 KKK

Thank very much

|||

u can use trigger ... while inserting and data to a certain table it will then automatically call your trigger and update your second table.

/* */

in your table use data time field to separate your distinct date data.

|||Thank you ,But I still didn't get my answer of first question about extra column that I have to insert it manually (by a parameter ). And I'm not familiar with trigger yet so can you give a an example how to use a trigger to perform this task ? Thank you again

|||I don't think triggers was the best option, I need something like loop so I can select some records and from Table1 and reinsert records for each row.|||

If you want to change the date when the record is created it's easy, just supply the new value in the select list that's getting the original data, eg, this example puts current date into column 3

insert into table1 (col1, col2, col3, col4)
select col1, col2,getdate(), col4) from table1

I don't see any use for triggers in this example, btw

|||

thank you ,

I did this and it works :

Create PROCEDURE [dbo].[proc_DailyReport_CopyInformation](@.ReportIDDECIMAL,@.ReportNewDECIMAL)ASBEGINSET NOCOUNT ONDECLARE @.ErrintINSERT INTO DailyReport_Activity (ReportID,ActivityDesc,hajm,vahedID,Tozihat,WBS) SELECT ReportID=(@.ReportNew),ActivityDesc,hajm,vahedID,Tozihat,WBS From DailyReport_Activity where ReportID = @.ReportIDSET @.Err = @.@.ErrorRETURN @.ErrEND

but I didn't find out my secont question yet please help .

|||

I don't really understand your second question -- can you elaborate? How is it different than your first question, aren't you still just inerting records based on existing records?

|||The problem is I don't know how can I make loop so based on the records I reinserted in the first table I reinsert records in the second table .

Or I need reinsert related records to second table while I'm inserting in the first table .

re-insert / templating records

I have a problem. The project that I'm working on requires me to duplicate
records. As in a series of records are entered into the system the user then
click on a button to make these as 'Templates' so that they would not have
to re-enter alot of the information. So from a db perspective I would have
to re-insert these records into the database. The problem is there're over
20 tables and the relationship is complex. Is there a way to copy the parent
the record and have sqlserver automatically cascade and re-insert all
related and referenced records back into the database ?

or is there a easy way to do this ?

Thanks
TomDuplicating rows in a table should never be necessary or desirable and it
shouldn't even be possible since evey table should have unique/primary key
constraints that prevent this. I assume therefore you will want to maintain
uniqueness by changing some column values. Unfortunately you haven't told us
anything about keys, constraints or the data you want to modify.

> Is there a way to copy the parent
> the record and have sqlserver automatically cascade and re-insert all
> related and referenced records back into the database ?

I guess here that you are talking about copying rows between tables with
IDENTITY columns. This is easy provided you have declared natural (not
IDENTITY) keys on the tables. IDENTITY should not be the only key of a
table. Here is an example of moving a parent entity and its related rows
between tables while maintaining the surrogate keys.

CREATE TABLE Departments (deptid INTEGER IDENTITY PRIMARY KEY, deptname
VARCHAR(30) NOT NULL UNIQUE /* Note the Key */)

CREATE TABLE Employees (employeeid INTEGER IDENTITY PRIMARY KEY, ssn
CHAR(10) NOT NULL UNIQUE /* Note the Key */, employeename VARCHAR(30) NOT
NULL, deptid INTEGER NOT NULL REFERENCES Departments (deptid))

CREATE TABLE New_Departments (deptid INTEGER IDENTITY PRIMARY KEY, deptname
VARCHAR(30) NOT NULL UNIQUE)

CREATE TABLE New_Employees (employeeid INTEGER IDENTITY PRIMARY KEY, ssn
CHAR(10) NOT NULL UNIQUE, employeename VARCHAR(30) NOT NULL, deptid INTEGER
NOT NULL REFERENCES New_Departments (deptid))

INSERT INTO New_Departments (deptname)
SELECT D.deptname
FROM Departments AS D
LEFT JOIN New_Departments AS N
ON D.deptname = N.deptname
WHERE N.deptname IS NULL

INSERT INTO New_Employees (ssn, employeename, deptid)
SELECT E1.ssn, E1.employeename, D2.deptid
FROM Employees AS E1
JOIN Departments AS D1
ON E1.deptid = D1.deptid
JOIN New_Departments AS D2
ON D1.deptname = D2.deptname
LEFT JOIN New_Employees AS E2
ON E1.ssn = E2.ssn
WHERE E2.employeeid IS NULL

--
David Portas
SQL Server MVP
--|||Tom Gao (tomgaomail@.optushome.com.au) writes:
> I have a problem. The project that I'm working on requires me to
> duplicate records. As in a series of records are entered into the system
> the user then click on a button to make these as 'Templates' so that
> they would not have to re-enter alot of the information. So from a db
> perspective I would have to re-insert these records into the database.
> The problem is there're over 20 tables and the relationship is complex.
> Is there a way to copy the parent the record and have sqlserver
> automatically cascade and re-insert all related and referenced records
> back into the database ?

There's a whole lot of information missing here, but in any case, the
answer is: no.

Are you inserting into the same table, or from a table with templates?
Well, in most cases it makes sense to store templates in the same table
as the real rows.

But then there are at least two columns that are not to be copied to
the new rows: the key and the column that marks that the template is a
template.

And I would not be surprised if there are more columns. For instance,
say that there are auditing columns who tells which which user that
created the row and when. Such data is of course not possible to
inherit from the client.

So, I am sorry, you just have to start coding. And pay attention to
the business requirements, so that you copy what you should copy, no
more, no less.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Monday, March 12, 2012

Re-indexing required?

Hi, I'm developing a database driven application that, besides everything
else, it keeps a log file of all the actions a user has taken during his use
of the app.
This log file is stored in a database table that has a primary key of type
"bigint" that auto increments (1, 1).
If ~100 to ~500 actions (insertions, deletions) are made to this table per
day, how long before I need to re-index the table? Do I need to re-index it
at all?
Thanks in advance,
Peter
pnp,
When are your maintenance windows? Do you have ANY maintenance windows? If you get a chance it would be good to recreate your indexes using the CREATE INDEX statement and the DROP_EXISTING clause - however test this for performance against DBCC DBREINDEX.
Remember that these are OFFLINE operations and will lock tables.
If you don't have a maintenance window, then measure your defragmentation using DBCC SHOWCONTIG. Based on a value acceptable to you, you can rebuild your index with DBCC INDEXDEFRAG - this is an ONLINE operation and will not lock tables, however it is not
as thorough as the other methods.
My advice would be to run DBCC SHOWCONTIG first before doing a rebuild, and then decide when to do it based on your maintenance windows. From the activity you describe it sounds like you may need to monitor it daily with DBCC SHOWCONTIG.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
|||Hi,
Execute the below command with in the database to identify the
fragmentation,
DBCC SHOWCONTIG ('table_name') WITH FAST
DBCC SHOWCONTIG determines whether the table is heavily fragmented. Table
fragmentation occurs through the process of data modifications (INSERT,
UPDATE, and DELETE statements) made against the table. This
will cause additional page reads results in slow performance.
How to over come the Fragmentation:
1. Drop and re-create a clustered index.
2. DBCC INDEXDEFRAG (Refer books online)
Have a look into DBCC SHOWCONTIG in books online for more information.
Thanks
Hari
MCDBA
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:eoKusYJGEHA.3880@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm developing a database driven application that, besides everything
> else, it keeps a log file of all the actions a user has taken during his
use
> of the app.
> This log file is stored in a database table that has a primary key of type
> "bigint" that auto increments (1, 1).
> If ~100 to ~500 actions (insertions, deletions) are made to this table per
> day, how long before I need to re-index the table? Do I need to re-index
it
> at all?
> Thanks in advance,
> Peter
>
|||On a slighly different thread.
I'd be curious to know how SQL Server indexes deal with incremental keys.
Other RDBMS implemented hash indexes as btrees can become lopsided with
these keys.
Paul Cahill
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:eoOuuoJGEHA.1180@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Execute the below command with in the database to identify the
> fragmentation,
> DBCC SHOWCONTIG ('table_name') WITH FAST
> DBCC SHOWCONTIG determines whether the table is heavily fragmented. Table
> fragmentation occurs through the process of data modifications (INSERT,
> UPDATE, and DELETE statements) made against the table. This
> will cause additional page reads results in slow performance.
> How to over come the Fragmentation:
> 1. Drop and re-create a clustered index.
> 2. DBCC INDEXDEFRAG (Refer books online)
> Have a look into DBCC SHOWCONTIG in books online for more information.
> Thanks
> Hari
> MCDBA
>
> "pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
> news:eoKusYJGEHA.3880@.TK2MSFTNGP10.phx.gbl...
everything
> use
type
per
> it
>
|||To add to all the other (sound) advice, please checkout the excellent
whitepaper at
http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
It gives extensive details on how to diagnose and cope with fragmentation,
including working out which indexes to focus on and even whether you need to
bother, based on your workload.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:eoKusYJGEHA.3880@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm developing a database driven application that, besides everything
> else, it keeps a log file of all the actions a user has taken during his
use
> of the app.
> This log file is stored in a database table that has a primary key of type
> "bigint" that auto increments (1, 1).
> If ~100 to ~500 actions (insertions, deletions) are made to this table per
> day, how long before I need to re-index the table? Do I need to re-index
it
> at all?
> Thanks in advance,
> Peter
>

Re-indexing required?

Hi, I'm developing a database driven application that, besides everything
else, it keeps a log file of all the actions a user has taken during his use
of the app.
This log file is stored in a database table that has a primary key of type
"bigint" that auto increments (1, 1).
If ~100 to ~500 actions (insertions, deletions) are made to this table per
day, how long before I need to re-index the table? Do I need to re-index it
at all?
Thanks in advance,
Peterpnp,
When are your maintenance windows? Do you have ANY maintenance windows? If y
ou get a chance it would be good to recreate your indexes using the CREATE I
NDEX statement and the DROP_EXISTING clause - however test this for performa
nce against DBCC DBREINDEX.
Remember that these are OFFLINE operations and will lock tables.
If you don't have a maintenance window, then measure your defragmentation us
ing DBCC SHOWCONTIG. Based on a value acceptable to you, you can rebuild you
r index with DBCC INDEXDEFRAG - this is an ONLINE operation and will not loc
k tables, however it is not
as thorough as the other methods.
My advice would be to run DBCC SHOWCONTIG first before doing a rebuild, and
then decide when to do it based on your maintenance windows. From the activi
ty you describe it sounds like you may need to monitor it daily with DBCC SH
OWCONTIG.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk|||Hi,
Execute the below command with in the database to identify the
fragmentation,
DBCC SHOWCONTIG ('table_name') WITH FAST
DBCC SHOWCONTIG determines whether the table is heavily fragmented. Table
fragmentation occurs through the process of data modifications (INSERT,
UPDATE, and DELETE statements) made against the table. This
will cause additional page reads results in slow performance.
How to over come the Fragmentation:
1. Drop and re-create a clustered index.
2. DBCC INDEXDEFRAG (Refer books online)
Have a look into DBCC SHOWCONTIG in books online for more information.
Thanks
Hari
MCDBA
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:eoKusYJGEHA.3880@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm developing a database driven application that, besides everything
> else, it keeps a log file of all the actions a user has taken during his
use
> of the app.
> This log file is stored in a database table that has a primary key of type
> "bigint" that auto increments (1, 1).
> If ~100 to ~500 actions (insertions, deletions) are made to this table per
> day, how long before I need to re-index the table? Do I need to re-index
it
> at all?
> Thanks in advance,
> Peter
>|||On a slighly different thread.
I'd be curious to know how SQL Server indexes deal with incremental keys.
Other RDBMS implemented hash indexes as btrees can become lopsided with
these keys.
Paul Cahill
"Hari" <hari_prasad_k@.hotmail.com> wrote in message
news:eoOuuoJGEHA.1180@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Execute the below command with in the database to identify the
> fragmentation,
> DBCC SHOWCONTIG ('table_name') WITH FAST
> DBCC SHOWCONTIG determines whether the table is heavily fragmented. Table
> fragmentation occurs through the process of data modifications (INSERT,
> UPDATE, and DELETE statements) made against the table. This
> will cause additional page reads results in slow performance.
> How to over come the Fragmentation:
> 1. Drop and re-create a clustered index.
> 2. DBCC INDEXDEFRAG (Refer books online)
> Have a look into DBCC SHOWCONTIG in books online for more information.
> Thanks
> Hari
> MCDBA
>
> "pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
> news:eoKusYJGEHA.3880@.TK2MSFTNGP10.phx.gbl...
everything
> use
type
per
> it
>|||To add to all the other (sound) advice, please checkout the excellent
whitepaper at
http://www.microsoft.com/technet/pr...n/ss2kidbp.mspx
It gives extensive details on how to diagnose and cope with fragmentation,
including working out which indexes to focus on and even whether you need to
bother, based on your workload.
Regards.
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"pnp" <pnp.at.softlab.ece.ntua.gr> wrote in message
news:eoKusYJGEHA.3880@.TK2MSFTNGP10.phx.gbl...
> Hi, I'm developing a database driven application that, besides everything
> else, it keeps a log file of all the actions a user has taken during his
use
> of the app.
> This log file is stored in a database table that has a primary key of type
> "bigint" that auto increments (1, 1).
> If ~100 to ~500 actions (insertions, deletions) are made to this table per
> day, how long before I need to re-index the table? Do I need to re-index
it
> at all?
> Thanks in advance,
> Peter
>

Friday, March 9, 2012

Re-Index SQL Server Express User Instance?

Is there a way to re-index a SQL Server Express User Instance? If I try to open the .mdf while the website is still running, I get a message stating that the file is in use. If I shut down the web service and open the .mdf, then restart the website, then the website cannot access the .mdf while I have it open in VStudio (reminds me a lot of Access).

In the past I tried to open a user instance with SQL Server Management Studio, but then it goofed up my user-instance...so I am hesitant to try that again. Is there any way to re-index?

Thanks!

Backup and restore and adjust Web.Config, then ALTER Table drop INDEX and REINDEX, the reason is currently your User Instance is behaving like a separate instance of SQL Server and that is not valid. Hope this helps.

http://forums.asp.net/thread/1454694.aspx

regular expressions in transact sql

hi guys,

i need some help tp write code in order to search the string ( regular expressions) in t- sql.

e.g.

when a user enters [A-Z] it means any alphabet from 'A' to 'Z'...

similarly [0-9] means any digit.

the problem is: when user enters [0-6] and the string received contains digit 5 it should return true but if it contains 7 it should return false.

so how do i read the [A-Z] as a range of characters in t-sql?

hi,

In sql server it is not exactly regular expression, it is called wild card pattern. in other words it is simplified reqular expression,

as of now SQL Server Like operator only work with following operators

% - Zero or any number of chars

_ - Single Char

[] - Single Char in given range

Cake - Single Char not in given range

if you want to utilize the exact regular expression on your query then the best solution will be CLR Functions.(SQL Server 2005).

For fixed validation (only numbers & only alphabets) i achived the following function,


Create Function dbo.IsMatching(@.Value as varchar(1000), @.Pattern as varchar(100))
returns bit as
Begin
Declare @.Len as int;
Declare @.SearchPattern as varchar(8000);
Declare @.Result as Int;

Select @.Len = Len(@.Value);

While @.Len>0
Begin
Select @.SearchPattern = Isnull(@.SearchPattern,'') + @.Pattern;
Select @.Len = @.Len -1;
End
Select @.Result = Case When @.Value Like @.SearchPattern Then 1 Else 0 End;
Return @.Result;
End

Go

select dbo.IsMatching('SQLServer','[A-Z]') as Result

Result : 1

select dbo.IsMatching('SQL Server','[A-Z]') as Result

Result : 0 --Space on String

select dbo.IsMatching('SQL Server','[A-Z ]') as Result

Result : 1 --Space added on Pattern

select dbo.IsMatching('12453','[1-5]') as Result

Result : 1

select dbo.IsMatching('12463','[1-5]') as Result

Result : 0

|||

thanks mani,

got the [A-Z] and [^a-z] concept.

my other requirements are to match zero or more characters and to match one or more characters.

e.g. T*he should match he, the, tthe, ttttthe.. etc.

and t+ho should match tho, thho, thhhhhhho, thhhhhhhhhhhhhho.. etc.

the above operators i have used in VC++,

do they work in t-sql too?

|||If you need regular expression and your platform is sqlserver 2005 you can use a CLR strored procedure. If you need help on this post a question on the .net framework inside sql server forum
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=86&SiteID=1|||

Yes.. if you want to find the repeated chars you can use the following condtions....

columnname not like '%aaa%'
and columnname not like '%bbb%'
and columnname not like '%ccc%'
and columnname not like '%ddd%'
and columnname not like '%eee%'
and columnname not like '%fff%'
and columnname not like '%ggg%'
and columnname not like '%hhh%'
and columnname not like '%iiii%'
and columnname not like '%jjj%'
and columnname not like '%kkk%'
and columnname not like '%lll%'
and columnname not like '%mmm%'
and columnname not like '%nnn%'
and columnname not like '%ooo%'
and columnname not like '%ppp%'
and columnname not like '%qqq%'
and columnname not like '%rrr%'
and columnname not like '%sss%'
and columnname not like '%ttt%'
and columnname not like '%uuu%'
and columnname not like '%vvv%'
and columnname not like '%www%'
and columnname not like '%xxx%'
and columnname not like '%yyy%'
and columnname not like '%zzz%'

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=996813&SiteID=1

If you want to utilize the exact regular expression as i said earlier you can go for CLR Functions..

Regular Disconnection occurs in query analyzer??

Hi,
today we have a strange case, my developpers are disconnected from the
server under query analyzer only from remote stations.
The user must refresh the connection at the higher level to be connected
again.
but every 10 to 15 minutes my users are disconnected again!!!
From what I can see, this event occurs for all clients at the same time.
Any idea?
I'm connected through Terminal server to my server to see if there is any
problem, and I don't see anything wrong.
There is nothing in the event log and nothing in the SQL Server log.
Thanks for your help.
Jerome.
> From: "Jj" <willgart@._A_hAotmail_A_.com>
> Subject: Regular Disconnection occurs in query analyzer?
> Date: Tue, 27 Apr 2004 15:29:43 -0400
> Hi,
> today we have a strange case, my developpers are disconnected from the
> server under query analyzer only from remote stations.
> The user must refresh the connection at the higher level to be connected
> again.
> but every 10 to 15 minutes my users are disconnected again!!!
> From what I can see, this event occurs for all clients at the same time.
> Any idea?
> I'm connected through Terminal server to my server to see if there is any
> problem, and I don't see anything wrong.
> There is nothing in the event log and nothing in the SQL Server log.
> Thanks for your help.
> Jerome.
Hi Jerome,
Check the SQL Server errorlogs for any errors coinciding with the
disconnects. If nothing, you may have to capture a network trace to find
out why users are disconnecting.
Hope this helps,
Eric Crdenas
SQL Server senior support professional

Regular Disconnection occurs in query analyzer??

Hi,
today we have a strange case, my developpers are disconnected from the
server under query analyzer only from remote stations.
The user must refresh the connection at the higher level to be connected
again.
but every 10 to 15 minutes my users are disconnected again!!!
From what I can see, this event occurs for all clients at the same time.
Any idea?
I'm connected through Terminal server to my server to see if there is any
problem, and I don't see anything wrong.
There is nothing in the event log and nothing in the SQL Server log.
Thanks for your help.
Jerome.> From: "Jj" <willgart@._A_hAotmail_A_.com>
> Subject: Regular Disconnection occurs in query analyzer?
> Date: Tue, 27 Apr 2004 15:29:43 -0400
> Hi,
> today we have a strange case, my developpers are disconnected from the
> server under query analyzer only from remote stations.
> The user must refresh the connection at the higher level to be connected
> again.
> but every 10 to 15 minutes my users are disconnected again!!!
> From what I can see, this event occurs for all clients at the same time.
> Any idea?
> I'm connected through Terminal server to my server to see if there is any
> problem, and I don't see anything wrong.
> There is nothing in the event log and nothing in the SQL Server log.
> Thanks for your help.
> Jerome.
--
Hi Jerome,
Check the SQL Server errorlogs for any errors coinciding with the
disconnects. If nothing, you may have to capture a network trace to find
out why users are disconnecting.
Hope this helps,
Eric Crdenas
SQL Server senior support professional

Wednesday, March 7, 2012

Regular Disconnection occurs in query analyzer??

Hi,
today we have a strange case, my developpers are disconnected from the
server under query analyzer only from remote stations.
The user must refresh the connection at the higher level to be connected
again.
but every 10 to 15 minutes my users are disconnected again!!!
From what I can see, this event occurs for all clients at the same time.
Any idea?
I'm connected through Terminal server to my server to see if there is any
problem, and I don't see anything wrong.
There is nothing in the event log and nothing in the SQL Server log.
Thanks for your help.
Jerome.> From: "Jéjé" <willgart@._A_hAotmail_A_.com>
> Subject: Regular Disconnection occurs in query analyzer?
> Date: Tue, 27 Apr 2004 15:29:43 -0400
> Hi,
> today we have a strange case, my developpers are disconnected from the
> server under query analyzer only from remote stations.
> The user must refresh the connection at the higher level to be connected
> again.
> but every 10 to 15 minutes my users are disconnected again!!!
> From what I can see, this event occurs for all clients at the same time.
> Any idea?
> I'm connected through Terminal server to my server to see if there is any
> problem, and I don't see anything wrong.
> There is nothing in the event log and nothing in the SQL Server log.
> Thanks for your help.
> Jerome.
--
Hi Jerome,
Check the SQL Server errorlogs for any errors coinciding with the
disconnects. If nothing, you may have to capture a network trace to find
out why users are disconnecting.
Hope this helps,
--
Eric Cárdenas
SQL Server senior support professional

Registry Permissions for on demand pull subscription

To configure an on-demand pull subscription, the domain user account used by
the SQL Server Agent service must have full control permissions on the
registry key: HKLM\Software\Microsoft\Microsoft SQL
Server\80\Replication\Subscriptions. When I attempt to use the registry
editor to configure the permissions, the subscriptions portion of the key is
not present. I am running Win 2000 Server and SQL Server 2000. I am logged on
as an administrator, and I have sucessfully created a merge publication and a
push subcription. Any thoughts on what may be my problem? What SQL process
creates the subscriptions entry in the registery?
Tom McAvoy, MCP
The subscriptions portion of the key can be filled in by using reg files,
but the preferred way of doing it is having Windows Synchronization Manager,
or the ActiveX Controls make these changes.
When you create your push (only through the procs), or you pull (procs or
wizards), ensure you select on demand pull. This will register your
subscription and make the necessary registry entries.
If you did not do this, you will have to configure your pull subcription
withing WSM.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Tom McAvoy" <TomMcAvoy@.discussions.microsoft.com> wrote in message
news:7E02406B-F211-49F4-B1FD-41C2B6127F4A@.microsoft.com...
> To configure an on-demand pull subscription, the domain user account used
by
> the SQL Server Agent service must have full control permissions on the
> registry key: HKLM\Software\Microsoft\Microsoft SQL
> Server\80\Replication\Subscriptions. When I attempt to use the registry
> editor to configure the permissions, the subscriptions portion of the key
is
> not present. I am running Win 2000 Server and SQL Server 2000. I am logged
on
> as an administrator, and I have sucessfully created a merge publication
and a
> push subcription. Any thoughts on what may be my problem? What SQL process
> creates the subscriptions entry in the registery?
> --
> Tom McAvoy, MCP
|||Hillary, thank you for the response. I am unable to create the 'on-demand
pull' subscription due to the lack of permissions on the registry key. I
receive an 'access denied error'. I don't have the exact error info
avaialble right now. I'll review the problem on Monday and post more complete
error info.
"Hilary Cotter" wrote:

> The subscriptions portion of the key can be filled in by using reg files,
> but the preferred way of doing it is having Windows Synchronization Manager,
> or the ActiveX Controls make these changes.
> When you create your push (only through the procs), or you pull (procs or
> wizards), ensure you select on demand pull. This will register your
> subscription and make the necessary registry entries.
> If you did not do this, you will have to configure your pull subcription
> withing WSM.
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Tom McAvoy" <TomMcAvoy@.discussions.microsoft.com> wrote in message
> news:7E02406B-F211-49F4-B1FD-41C2B6127F4A@.microsoft.com...
> by
> is
> on
> and a
>
>
|||It seems that you need to be a power user or admin on the machine you are
trying to pull the subscription to.
Also the account which is doing the pulling should be in the PAL.
"Tom McAvoy" <TomMcAvoy@.discussions.microsoft.com> wrote in message
news:8518A10B-BFB3-4C4D-A6E4-8A605F129C22@.microsoft.com...
> Hillary, thank you for the response. I am unable to create the 'on-demand
> pull' subscription due to the lack of permissions on the registry key. I
> receive an 'access denied error'. I don't have the exact error info
> avaialble right now. I'll review the problem on Monday and post more
complete[vbcol=seagreen]
> error info.
> "Hilary Cotter" wrote:
files,[vbcol=seagreen]
Manager,[vbcol=seagreen]
or[vbcol=seagreen]
used[vbcol=seagreen]
registry[vbcol=seagreen]
key[vbcol=seagreen]
logged[vbcol=seagreen]
publication[vbcol=seagreen]
process[vbcol=seagreen]

Saturday, February 25, 2012

Registration failure in Enterprise Manager

I am in Enterprise Manager on ComputerA, logged in as user xyz. I am
attempting to add a new SQL Server registration for the SQL Server on
ComputerB, using SQL Server authentication based on SQL Server login abc. Th
e
registration fails, stating that the SQL Server does not exist or access is
denied. The Security Event Log on ComputerB indicates a login failure to the
account xyz, which does not exist on ComputerB. Why is the registration
attempt trying to log into a non-existent Windows account when I have
requested SQL Server authentication? TIA...Sounds like it could be that it's trying to connect using
named pipes. Check the order of the protocols using the
client network utility and try setting TCP/IP as the first
protocol if it already isn't the first one listed.
Or use the client network utility and create a TCP/IP alias
to ComputerB on ComputerA
-Sue
On Tue, 5 Jul 2005 12:19:05 -0700, "Steve B."
<SteveB@.discussions.microsoft.com> wrote:

>I am in Enterprise Manager on ComputerA, logged in as user xyz. I am
>attempting to add a new SQL Server registration for the SQL Server on
>ComputerB, using SQL Server authentication based on SQL Server login abc. T
he
>registration fails, stating that the SQL Server does not exist or access is
>denied. The Security Event Log on ComputerB indicates a login failure to th
e
>account xyz, which does not exist on ComputerB. Why is the registration
>attempt trying to log into a non-existent Windows account when I have
>requested SQL Server authentication? TIA...|||Thanks for your reply. Per your suggestion, I changed the order of the
protocols listed in the Client Network Utility, and I had already tried
creating the TCP/IP alias for ComputerB, but I tried it again. All to no
avail... :-(
"Sue Hoegemeier" wrote:

> Sounds like it could be that it's trying to connect using
> named pipes. Check the order of the protocols using the
> client network utility and try setting TCP/IP as the first
> protocol if it already isn't the first one listed.
> Or use the client network utility and create a TCP/IP alias
> to ComputerB on ComputerA
> -Sue
> On Tue, 5 Jul 2005 12:19:05 -0700, "Steve B."
> <SteveB@.discussions.microsoft.com> wrote:
>
>|||I thought I'd close this loop, in case others might benefit. The problem was
resolved by creating synchronized accounts on ComputerA and ComputerB.
ComputerB is a W2K3 system, and it appears that account synchronization is
required on W2K3 even when you're using SQL Server authentication. So I
wonder why you'd ever bother with SQL Server authentication on W2K3?
"Steve B." wrote:
[vbcol=seagreen]
> Thanks for your reply. Per your suggestion, I changed the order of the
> protocols listed in the Client Network Utility, and I had already tried
> creating the TCP/IP alias for ComputerB, but I tried it again. All to no
> avail... :-(
> "Sue Hoegemeier" wrote:
>|||It's not a requirement. Synching the accounts and passwords
is in non-domain settings sometimes but it's to allow
Windows authentication. If you are specifying SQL
authentication and Windows is used instead then you have
something else that's a problem. You may want to check what
protocol you are actually connecting with - the net library
is listed in sysprocesses. You may also want to run
component check to verify your MDAC installation. You can
download it from:
http://msdn.microsoft.com/data/mdac...ds/default.aspx
-Sue
On Tue, 12 Jul 2005 08:44:05 -0700, "Steve B."
<SteveB@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>I thought I'd close this loop, in case others might benefit. The problem wa
s
>resolved by creating synchronized accounts on ComputerA and ComputerB.
>ComputerB is a W2K3 system, and it appears that account synchronization is
>required on W2K3 even when you're using SQL Server authentication. So I
>wonder why you'd ever bother with SQL Server authentication on W2K3?
>"Steve B." wrote:
>

Registering User changing data

Hello there
I have many tables that i would like to kbow on each record who inserted,
updated data and when it happend?
For this i've learned about function call SUSER_SNAME() that always gives me
the current user who is in the system. For insert case i've solved it
simply: added two fields:
ChangeBy with the SUSER_SNAME() function as default value
ChangeAt with the GETDATE() function as default value
This works fine for Inserting.
But what i need to do for updating: do i have to use a trigger for this?> But what i need to do for updating: do i have to use a trigger for this?
Yes, you can use a trigger. You can also use SQL Profiler for auditing -
check
http://www.sqlservercentral.com/col...ityLearning.com