Tuesday, March 20, 2012
Changing system time and Next run time for Jobs
couple days ahead, the SQL Server Job's Next Run Time
doesn't get updated. So the jobs never run again as an
affect. The only way to fix this is to stop and restart
SQL Agent or reboot the machine.
Does anyone know what to do with this?That is expected behavior. Changing the system time has no effect on the
entries stored in tables within SQL Server.
Rand
This posting is provided "as is" with no warranties and confers no rights.sql
Changing SSN Filed to match correct format
I asked this about a month ago and got a couple of answers but both were a
bit over my head so I am taking another shot, explaining it a bit more in
case I was not clear.
I inherited a database that did not put an input mask format in the ssn
field. The data entry people can now enter a persons ssn in any manner they
choose (123-45-6789, 123456789, abc123456, abc-12-3456, etc). Because I do
compare to other database sources that have it correctly formatted I get bad
matches (or worse no matches) because of the format. I need a way to
reformat the SSNum field so it is correctly formatted in the ###-##-####
manner (#'s in this case meaning alphanumeric, the dashes just need to be
there).
Any ideas?OK. I have it this far - -
If I use this formula:
SELECT LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum, 4)
as SSN, Clients.First_Name + ' ' + Clients.Last_Name
FROM Clients
It recodes the SSN as I need it. How do I get this result to the UPDATE
function inside the main db?
Possibly:
Update Clients
Set LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum, 4)
'
"JOHN HARRIS" <harris1113@.fake.com> wrote in message
news:8AE9A112-DA51-474C-B1C7-8AB34229A813@.microsoft.com...
> Hi All
> I asked this about a month ago and got a couple of answers but both were a
> bit over my head so I am taking another shot, explaining it a bit more in
> case I was not clear.
> I inherited a database that did not put an input mask format in the ssn
> field. The data entry people can now enter a persons ssn in any manner
> they choose (123-45-6789, 123456789, abc123456, abc-12-3456, etc). Because
> I do compare to other database sources that have it correctly formatted I
> get bad matches (or worse no matches) because of the format. I need a way
> to reformat the SSNum field so it is correctly formatted in the
> ###-##-#### manner (#'s in this case meaning alphanumeric, the dashes just
> need to be there).
> Any ideas?
Friday, February 24, 2012
Changing lost SA password
Here's my plan to change it:
1. I've run a trace for a couple of days to verify that there are no
jobs or processes that are connecting as SA and that would break if I
changed the password.
2. Before the changing the password I am going to bulk copy out the
sysxlogins row for SA so that if things go wrong I can reinset the old
data with the old unknown password (will that work?).
3. Log on to the console as Windows administrator and changing the SA
password.
Does that make sense? Anyone have any other suggestions?
Thanks.<patrickshroads@.hotmail.com> wrote in message
news:1108157543.004606.300840@.l41g2000cwc.googlegr oups.com...
>I just started a new job and no one seems to know the SA password.
> Here's my plan to change it:
> 1. I've run a trace for a couple of days to verify that there are no
> jobs or processes that are connecting as SA and that would break if I
> changed the password.
> 2. Before the changing the password I am going to bulk copy out the
> sysxlogins row for SA so that if things go wrong I can reinset the old
> data with the old unknown password (will that work?).
> 3. Log on to the console as Windows administrator and changing the SA
> password.
> Does that make sense? Anyone have any other suggestions?
> Thanks.
Assuming you've tested that the Windows Administrator account does have
sysadmin rights in MSSQL (it does by default), then you'll be able to change
the password with no problems - the only issue would be an application or
script that has the old password coded into it. But at least if something
does stop working, you know you've found a security issue which should be
fixed urgently.
As for going back to the old password, modifying data in system tables
directly is usually a bad idea and not supported by Microsoft (see "allow
updates Option" in Books Online), so if you update sysxlogins directly and
things go wrong, you'll probably have to restore master from a backup. But
it would almost certainly be better to fix whatever is using the old
password rather than messing with sysxlogins. If possible, I would set a
very strong sa password, change the server from mixed mode to Windows
authentication only, and forget about the sa login, but I appreciate that
that isn't always an option.
Simon
Thursday, February 16, 2012
Changing Filegroup for Text/Image Data SQL 2005
tables, but when I try to change the filegroup in management studio it always
changes back to the default filegroup. Any suggestions?
Thanks,
AdrewCan you be more specific on what you mean by try to change it? In order for
the LOBs to be stored on a specific Filegroup you need to specify that when
you create the table, not afterwards. And if you are in SQL2005 you should
be looking at using the new MAX datatypes and not Text & Image.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"chabotwvu" <chabotwvu@.discussions.microsoft.com> wrote in message
news:2688797F-1B5D-447D-AC5E-E79AF175ADF5@.microsoft.com...
>I have created a new filegroup to store text/image data for a couple of
> tables, but when I try to change the filegroup in management studio it
> always
> changes back to the default filegroup. Any suggestions?
> Thanks,
> Adrew