Showing posts with label production. Show all posts
Showing posts with label production. Show all posts

Tuesday, March 20, 2012

change DB owner

I have several Production Databases on my SQL Server 2000 Standard Edition Server (mixed mode authentication) that I'd like to change DBO Permissions on. When I look at the Properties of the DB(s) from EM, the Database owner is showing up as a Windows NT USer who is no longer even with the company!!

Can I use the sp_changedbowner 'sa' command to change the database owner to sa without disrupting Production? Might sound like a dumb question.. but ya never know!!!!! Also, I had someone on another forum tell me that 'sa' as db owner is a bad idea but I don't know why??? can anyone elaborate on that???I am also interested in these questions (and so have posted to just put it back to the top of the list in the hope someone can answer - is that bad etiquette?)|||Yes, you can always change the database owner to sa. At least as far as I know, this is a good idea in almost every case.

As far as the person that thought it was a bad idea, I'd love to hear their reasoning... While I can concoct a case where it was a bad idea, it would take some considerable doing, and would probably never happen in "the real world".

-PatP|||Thank's Pat.

jpotucek, even though the user that own's the database has left, does their Windows account still exist? Does it cause you any issues?|||The only reason I ever had a person other than sa as dbo, was when I had a person who kept forgetting to put dbo in front of objects she created.

Tim S|||I don't manage the NT accounts here, just the logins on the SQL Server. The accounts still exist and they may even be disabled, i don't know. I'm going to change the DB Owner on all to sa and drop the users from my sql servers - then I know i won't have any problems!!!!

THank you one and all

Change DataSource between Development and Production

I have some existing .NET app, and so I'd like to integrate the RS w/
them.
Reports created by RS is very impressive, now I need to think about
integration. Two choices for me:
1. URL Access
2. Web Services
Option 1 is the fastest and efficient way, has the followings:
1) DataSource in dev and prod are different, doesn't seem like easy to
change them w/ modifying in the project.
2) SessionID, UserName and Password and other parameters are exposed in
URL unless using SSL, otherwise not secure.
Option 2 needs more coding just like a normal .NET projects but w/o
security concerns, still have to worry about changing DataSource stuff.
For example for .rdl
<DataSourceID>413d324e-1ddf-4c4d-8f2e-2dd50bd8d4ac</DataSourceID>
Our existing .NET has its own web.config file works like a .ini, we put
in all data source connection there, when move to production,
Production Release team needs to change SQL box name, UserID and
password inside of the web.config. Now, how do they change them in
.rdl?
Thanks in advance.Couple of things to consider. First, datasource should be a non-problem if
you use shared datasources (which I recommend). The shared datasource has to
have the same name in both production and dev but that is it. The default
when you deploy is to not overwrite the datasource so once you set it up in
production it will be undisturbed. Second, I suggest using a specific
username and password for retrieving the data from wherever you are getting
it. I create a special readonly user that is used by RS only. This is great
for security since it is readonly and you benefit from connection polling
which you would not if the user account of the user requesting the report is
used. If you report needs to include the user in the where clause (or you
need to use a filter with the username) then user the global variable
User!UserID.
As I said, rdl does not change at all for the datasource.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<hifchan@.yahoo.com> wrote in message
news:1108586517.346073.261520@.c13g2000cwb.googlegroups.com...
> I have some existing .NET app, and so I'd like to integrate the RS w/
> them.
> Reports created by RS is very impressive, now I need to think about
> integration. Two choices for me:
> 1. URL Access
> 2. Web Services
> Option 1 is the fastest and efficient way, has the followings:
> 1) DataSource in dev and prod are different, doesn't seem like easy to
> change them w/ modifying in the project.
> 2) SessionID, UserName and Password and other parameters are exposed in
> URL unless using SSL, otherwise not secure.
> Option 2 needs more coding just like a normal .NET projects but w/o
> security concerns, still have to worry about changing DataSource stuff.
> For example for .rdl
> <DataSourceID>413d324e-1ddf-4c4d-8f2e-2dd50bd8d4ac</DataSourceID>
> Our existing .NET has its own web.config file works like a .ini, we put
> in all data source connection there, when move to production,
> Production Release team needs to change SQL box name, UserID and
> password inside of the web.config. Now, how do they change them in
> .rdl?
> Thanks in advance.
>|||Bruce,
You meant
<DataSourceID>413d324e-1ddf-4c4d-8f2e-2dd50bd8d4ac</DataSourceID> will
not matter as long as the .rdl reference the same <Name> only?|||Yes this is correct. The data source ID is just an internal id used by
report designer only. That is also the reason why the DataSourceID element
is in the report designer namespace: <rd:DataSourceID>. The report server
ignores these ids.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
<hifchan@.yahoo.com> wrote in message
news:1108657866.193950.180150@.g14g2000cwa.googlegroups.com...
> Bruce,
> You meant
> <DataSourceID>413d324e-1ddf-4c4d-8f2e-2dd50bd8d4ac</DataSourceID> will
> not matter as long as the .rdl reference the same <Name> only?
>

Monday, March 19, 2012

Change Data type from Nvarchar to datetime

i have a sql db in production and i need to change the data type of one of m
y
fields. Can this be done? I have made several attempts but have failed.Probably because you have data in there that is not a valid datetime. This
is a common symptom for using a catch-all datatype like nvarchar for storing
inappropriate data, whether it be to ease the development/validation of end
user interfaces or to seamlessly integrate legacy data.
"Failed" could mean many things to me. Are you just saying ALTER TABLE
tablename ALTER COLUMN columnname DATETIME? If so, and that fails due to a
conversion issue, then you may want to consider trying this:
-- how many are bad:
SELECT COUNT(*) FROM TableName WHERE IsDate(ColumnName)=0;
-- a few samples:
SELECT TOP 50 ColumnName FROM TableName WHERE ISDate(ColumnName)=0;
You might be really hosed, or you my just have to tweak the data before
altering the table, by converting to a valid datetime format. It's tough to
get any more specific without valid DDL and sample data (see
http://www.aspfaq.com/5006
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:6BB5D430-FFF8-4BC9-BF59-DA27B3B83615@.microsoft.com...
>i have a sql db in production and i need to change the data type of one of
>my
> fields. Can this be done? I have made several attempts but have failed.|||Thank you for your suggestion. However, I do not have any data in this
particular field. This is the error I get...
'Contacts' table
- Warning: Data might be lost converting column 'MaritalStatus' from
'nvarchar(20)'.
The MaritalStatus field does not have any data. I would like to rename it
to PromoCodeEmail and change the data type to datetime.
"Aaron Bertrand [SQL Server MVP]" wrote:

> Probably because you have data in there that is not a valid datetime. Thi
s
> is a common symptom for using a catch-all datatype like nvarchar for stori
ng
> inappropriate data, whether it be to ease the development/validation of en
d
> user interfaces or to seamlessly integrate legacy data.
> "Failed" could mean many things to me. Are you just saying ALTER TABLE
> tablename ALTER COLUMN columnname DATETIME? If so, and that fails due to
a
> conversion issue, then you may want to consider trying this:
> -- how many are bad:
> SELECT COUNT(*) FROM TableName WHERE IsDate(ColumnName)=0;
> -- a few samples:
> SELECT TOP 50 ColumnName FROM TableName WHERE ISDate(ColumnName)=0;
> You might be really hosed, or you my just have to tweak the data before
> altering the table, by converting to a valid datetime format. It's tough
to
> get any more specific without valid DDL and sample data (see
> http://www.aspfaq.com/5006
>
>
>
>
> "Joe" <Joe@.discussions.microsoft.com> wrote in message
> news:6BB5D430-FFF8-4BC9-BF59-DA27B3B83615@.microsoft.com...
>
>|||Joe,
First, thats a warning, not an error. The warning is generated because
changing data types can result in loss of data, but that doesn't necessarily
mean they will.
Second, if you have a column that is not used, drop the column and add a new
column. There is no need to rename it and change the data type.
You are best off using a script for these changes rather than using the gui.
Scripts can be run against your development and test databases and debugged
before runnign them against production. Scripts also insure that the
changes made in all databases are the same, without having to worry about
user error from clicking on the wrong field in enterprise manager.
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:82D1F9C5-9AF9-4D3E-AC46-886F0E64CB4B@.microsoft.com...
> Thank you for your suggestion. However, I do not have any data in this
> particular field. This is the error I get...
> 'Contacts' table
> - Warning: Data might be lost converting column 'MaritalStatus' from
> 'nvarchar(20)'.
> The MaritalStatus field does not have any data. I would like to rename it
> to PromoCodeEmail and change the data type to datetime.
> "Aaron Bertrand [SQL Server MVP]" wrote:
>
This
storing
end
to a
tough to
of
failed.|||I have never written a script before. Is there some literature that will
assist me in doing you suggested?
"Aaron Bertrand [SQL Server MVP]" wrote:

> Probably because you have data in there that is not a valid datetime. Thi
s
> is a common symptom for using a catch-all datatype like nvarchar for stori
ng
> inappropriate data, whether it be to ease the development/validation of en
d
> user interfaces or to seamlessly integrate legacy data.
> "Failed" could mean many things to me. Are you just saying ALTER TABLE
> tablename ALTER COLUMN columnname DATETIME? If so, and that fails due to
a
> conversion issue, then you may want to consider trying this:
> -- how many are bad:
> SELECT COUNT(*) FROM TableName WHERE IsDate(ColumnName)=0;
> -- a few samples:
> SELECT TOP 50 ColumnName FROM TableName WHERE ISDate(ColumnName)=0;
> You might be really hosed, or you my just have to tweak the data before
> altering the table, by converting to a valid datetime format. It's tough
to
> get any more specific without valid DDL and sample data (see
> http://www.aspfaq.com/5006
>
>
>
>
> "Joe" <Joe@.discussions.microsoft.com> wrote in message
> news:6BB5D430-FFF8-4BC9-BF59-DA27B3B83615@.microsoft.com...
>
>|||What part of my suggestion are you having difficulty with?
"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:356065F7-EB6A-4304-9448-ECF8B0FB40F7@.microsoft.com...
>I have never written a script before. Is there some literature that will
> assist me in doing you suggested?
> "Aaron Bertrand [SQL Server MVP]" wrote:
>

Sunday, March 11, 2012

Change collation in tempdb

Hi,
I'm using MSSQL2000. Is there any way to change the collation of
tempdb database? I just realized that my devel and production tempdb
have different collation and would like to get them in synch,
Thanks,
RolandoRolando
Try something like this
alter database tempdb COLLATION
SQL_Latin1_General_CP1_CI_AS
Hope this helps
John|||John,
You cant run ALTER DATABASE against system databases.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"John Bandettini" <johnbandettini@.yahoo.co.uk> wrote in message
news:095801c35ce5$ae8035d0$a601280a@.phx.gbl...
> Rolando
> Try something like this
> alter database tempdb COLLATION
> SQL_Latin1_General_CP1_CI_AS
> Hope this helps
> John|||Rolando,
The collation that you selected on setup becomes the default collation for
tempdb as well as other system databases.To change that, you need to proceed
with the complex process of rebuilding master.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Rolando" <mrrd@.bigfoot.com> wrote in message
news:abcf80d8.0308070451.38eea467@.posting.google.com...
> Hi,
> I'm using MSSQL2000. Is there any way to change the collation of
> tempdb database? I just realized that my devel and production tempdb
> have different collation and would like to get them in synch,
> Thanks,
> Rolando|||OK, my mistake

Tuesday, February 14, 2012

Catastrophic Failure

I have a site that has had 70+ pc with msaccess frot end connected to sql200
0
server back end. This site has been in production for 12 months.
With in the last week we have experienced an increasing frequency of
-2147418113 Catastrophic Failure errors. The application writes data from a
tempory in access table back to a table in SQL server. The error doesnot
occur
I have run trace on the server and no sql errors are shown.
The registry on a few machines i have checked have data access version of
2.81.1117.0 the rollback version is 2.70.9001.0.
If i change the ado version in access to 2.5 or 2.1 from 2.8 the frequency
of the error diminishes. Also the adox version shows as 2.7 whenin the list
of available references after selection when re checked it chows as adox 2.8
.
Any ideas would be appreciated.
Craig BJust a thought, but have noted this error in the past when using MS
DTC, e.g. if the DTC service is stopped or crashes, or if a COM+
package is "Shut Down" while active transactions in the package are
running.|||Thanks,
I checked the things you mentioned, nothing obvious shows in services or the
event log.
I have been doing some more cheking and on sql side a trace showns no
errors.
One thing i have found is if say 6 records are writen back then things are
ok, when only 2 or less then the error occurs.
I am currently running an odbc log.
I have looked at kb q243349, but that problem was fixed in mdac 2.5
CraigB
"NonNB" wrote:

> Just a thought, but have noted this error in the past when using MS
> DTC, e.g. if the DTC service is stopped or crashes, or if a COM+
> package is "Shut Down" while active transactions in the package are
> running.
>|||i have will have my client check for client machines to see if dtc or com+
errors. on futher checking on my machine i found dtc had stoped the log was
missing. but every thing worked ok except for what appear to be random event
s
when low records rows are returned. Given the writeback code has been in
production for a year i am perplexed.
Thanks for youe input, something has changed or caused the issues.
CB
"NonNB" wrote:

> Just a thought, but have noted this error in the past when using MS
> DTC, e.g. if the DTC service is stopped or crashes, or if a COM+
> package is "Shut Down" while active transactions in the package are
> running.
>