Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15889 articles
Browse latest View live

Missing green arrow on the sql server icon in object Explorer

$
0
0
I am using SQL Server 2008 R2 on windows 2008 server. i am able to get connected to management studio but the status light with white circle.

the status lights in my Enterprise manager are no longer working. I am connected to the databases.

I can't use right-click the instance icon to select "start", "stop", "pause", "resume" or "restart" because they are all grayed out. But all the rest operations are available.

Where should I look more into then?

Thanks for your inputs in advance!

iffi

cannot read unicode

$
0
0

hi, 

I want to perform a SELECT command and inside it i use a "unicode persian character" comparison like :[ SELECT * from products where Category = 'نام' ]

but sql server returns no data and just displays an empty result . i tested it with some other data which are not unicode and they worked fine . but whenever unicode characters are used , no result would be displayed . could anyone help please? tnx.

An error 1069 - )The service did not start due to logon failure) occurred while performing this service operation ...

$
0
0

Hi All,

 

We seem to be being plagued by the error below by our SQL Server agent. This happens almost everytime we restart the server that has been running for a day or two.

 

Our SQL Server Agent uses a none expiring domain credential. I understand that this problem only happens when the profile being used by the SQL Servr Agent has changed (password change). What puzzles me is that the login is A ok and no changes has been made to it's password.

 

We always resolve this problem by changing the login used in the SQL Server Agent to local and after that, returning it back to it's original domain login. Unfortunately, we cant always do this everytime something goes wrong.

 

Can anyone please help us shed a light on this? We're using SQL2k with SP3a. Thanks!

 

Error:

An error 1069 - )The service did not start due to logon failure) occurred while performing this service operation on the SQLServerAgent service.

 

 

Regards,

Joseph

Change compatibility level to 110 disables indexes with computed column on soundex

$
0
0

I have a very large DB which I need to change its compatibility level to 110.

I have 4 indexes on computed column on the function Soundex in this DB.

When changing the compatibility level, I get a message that the index with the soundex will be disabled.

The problem is that the index is very big, and the DB has alwaysOn on it, and one of the replicas is a far DR replica, and thus recreating the big index is not an option (it will take days to sync after this process).

Is there a way to change the compatibility level and force it not to disable the index?

Change Tracking: No access to parent table after delete.

$
0
0

Synopsis: 

I’m using Change Tracking to track changes in a Child table.  I’d like to group them by a Parent key, and keep track of one MAX value. Works great, except for deletes. 

Details:

Two tables,  

Categories:

               CategoryID, int      (PK)

               Name, varchar()

StoreItems:

               StoreItemID, int    (PK)

               CategoryID, int      (FK)

               Name, varchar()

The number of StoreItems per Category is rather small, and I want clients to just grab the ENTIRE list any time it detects ANY change to StoreItems assigned to a Category (insert, update or delete).

I have Change Tracking turned on for StoreItems. 

The following query works great:

SELECTS.CategoryID,MAX(c.SYS_CHANGE_VERSION)asMaxChangeNum

      FROMStoreItemsASS

CROSSAPPLYCHANGETABLE

   (VERSIONStoreItems,(StoreItemID),(S.StoreItemID))ASc

WHERES.CategoryID= 1

GROUPBYS.CategoryID

This yields:

CategoryID         MaxChangeNum

1                            72

This gives me the highest Change number for all StoreItems changed by Category, which each client could keep track of, but the problem is, it doesn’t include deleted records. 

When I use CHANGETABLE(CHANGES…) , I can see the deleted records, but I no longer have the Category they were in.  All it keeps is StoreItemID.

I tried a DELETE trigger, where I still have access to the CategoryID, but unfortunately the CHANGETABLE updates have not occurred yet.

Any suggestions on how to include deletes when tracking StoreItems changes BY Category?

You can be our next Spring SS DBE Guru !!

$
0
0



In the northern hemisphere at least, Spring is here! (apparently)

And at TechNet Wiki, we're hoping you're all hatching new ideas for this month's TechNet Guru competition!

We're looking for more shoots and leaves of wisdom to sprout forth from the great tree of MSDN/TechNet life.

We're also hoping some of our old Guru winners will be coming back out of hibernation and flexing their grey matter!

So, pick up your pen and MARCH into TechNet History! This could truly be the start of something BEAUTIFUL!

What delightful new arrival will YOU be bringing into this world?

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

Feel free to ask any questions below.

More about TechNet Guru Awards

Thanks in advance!
Pete Laker


#PEJL

Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to the one and onlyTechNet Wiki, for future generations to benefit from! You'll never get archived again!

If you are a member of any user groups, please make sure you list them in the Microsoft User Groups Portal. Microsoft are trying to help promote your groups, and collating them here is the first step.

Cannot connect to SQL Server 2008 Named Instance

$
0
0

Hello,

I am trying to connect to our internal sqlserver\tech instance (2008r2/sqlserver2008r2) from a 2008r2 server in our DMZ using sql authentication.  The error message is:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (.Net SqlClient Data Provider)

I can connect to the default instance from the DMZ server with no problem

I can connect to the sqlserver/tech instance from inside the firewall

I have port 1433 and 1434 open in the DMZ firewall

PortQuery from the DMZ server gives me the following:

==== End of SQL Server query response ====

UDP port 1434 is LISTENING
portqry.exe -n sqlserver -e 1434 -p UDP exits with return code 0x00000000.
=============================================

 Starting portqry.exe -n sqlserver -e 1433 -p TCP ...


Querying target system called:

 sqlserver

Attempting to resolve name to IP address...

Name resolved to 10.10.0.24

querying...

TCP port 1433 (ms-sql-s service): LISTENING
portqry.exe -n sqlserver -e 1433 -p TCP exits with return code 0x00000000.

I have TCP connections enabled on the sql server.

I have the sql browser service running.

I have tried turning off the firewall on the DMZ server - same error

I have opened ports 1433 and 1434 on the firewall in the dmz server - same error

The firewall on the SQL server is not enabled.

Any help you could offer on this problem would be greatly appreciated.

thank you in advance.



User defined DML

$
0
0

Hi,

 Is it possible to alter SQL DML commands(like select, insert.,) user defined, from DB architecture point of view?

For eg: use any words instead of select

SELECT * from table    // if SELECT= reap then REAP * from table. But we should obtain the same result. Can't that be done to prevent SQL injection?

Thank you


Unable to Connect Database Engine via Windows Authentication

$
0
0

Hi All,

When I try to login on SQL Server 2008 R2 via Windows Authentication I receive error.

TITLE: Connect to Server
Cannot connect to (local).
ADDITIONAL INFORMATION:
Login failed for user 'abcdomain\farhan'. (Microsoft SQL Server, Error: 18456)

 The user "farhan" has administrative rights on the domain and are able to log in "Analysis Services" and "Integration Services" successfully using SSMS 2008 R2.

Please help me on it as I don't know 'sa' password.

Thanks in Advance

Farhan Ahmed


If this answer is helpful to you .. Please mark as Answer....

Deadlock Issue

$
0
0

Hi,

Yesterday in our production environment we experienced a very weird occurrence. At a certain point and time in the day every query that would execute against our SQL 2008 R2 instance would become deadlocked. We cleared all of the locks; however, the locks would still persist once an application tried to execute any stored procedure or query. After some time we shut down all of our application servers, and eventually rebooted them, along with the SQL Server. We also removed every possible connection to the SQL instance, and tried executing a stored procedure manually with profiler turned on, but profiler itself would become locked. After several failed hours of attempting to determine, using every tool at our disposal, why simple stored procedures, or queries would suddenly create locks within a database, it just up and decided to start working again with no problem. Does anyone know why something like this would occur. The SQL logs looked fine, Perfmon showed the disks to be fine, and, like I said, Profiler would just lock up. Just a side note, the application servers are VMs using different versions of .net and uses IIS as a web server.

Thanks,

Jarred

How to program jobs for multiple databases.

$
0
0

Hi, my sql server 2005 server has many databases.

Im aplying jobs to do backups to the databases.

Since there are many databases i have to go one by one and it takes too long.

Is there a script that i can execute to add jobs to backup all databases?

thanks...

maintence plan

$
0
0

hello,

i configured 4 task of the maintence plan...

i want to see if they finished correctly...

where can i see it?

thanks

Maintanance backup plan fail

$
0
0

Hi all

I have a maintenance plan to backup ALL databases on everyday 11:00am. however it failed start from wednesday.

I see the log is so strange:

Executing the query "
declare @backupSetId as int
select @backupSetId = position from msdb..backupset
where
database_name=N'DB_A' and
backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'DB_A' )

if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''DB_A'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM 
DISK = N'H:\\DB_Backup\\DB_A\\DB_A_backup_201303132300.bak'
WITH 
FILE = @backupSetId, 
NOUNLOAD, 
NOREWIND
" failed with the following error: "Cannot open backup device 'H:\\DB_Backup\\DB_A\\DB_A_backup_201303132300.bak'.
Operating system error 32(The process cannot access the file because it is being used by another process.).
VERIFY DATABASE is terminating abnormally.".
Possible failure reasons: Problems with the query,
"ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

 ===================================================================================

Executing the query "
BACKUP DATABASE [DB_B] TO  DISK = N'H:\\DB_Backup\\DB_B\\DB_B_backup_201303132300.bak' WITH 
RETAINDAYS = 31,
NOFORMAT,
NOINIT, 
NAME = N'DB_B_backup_20130313230031',
SKIP,
REWIND,
NOUNLOAD, 
STATS = 10
"

failed with the following error:
"Cannot open backup device 'H:\\DB_Backup\\DB_B\\DB_B_backup_201303132300.bak'.
Operating system error 32(The process cannot access the file because it is being used by another process.).
BACKUP DATABASE is terminating abnormally.".
Possible failure reasons: Problems with the query,
"ResultSet" property not set correctly,
parameters not set correctly, or
connection not established correctly

Finally, the backup file is created on the disk, and the log above is display on 11:00:31pm....why verify is process before backup finish?

the backup file date is about 11:14pm...

really has no clue.

wednesday night and thursday night got the same problem, and the same database.

Database backup plan

$
0
0
Dear all,

I have not such experience as a DBA on database administration but I need to setup for our application an automatic backup of our different SQL server 2005 databases.

The simple quetsion I have is what is the best way to handle database backup in the sense of frequency and type ?

For example we have a database which permanently collect data from industrila machines how often that databqase needs to be backup ?

   Ex :

     1 full backup every week + 1 dayly incremental backup ?

Thanks for helping me setting up my backup process
regards
serge
Your experience is build from the one of others

Change Transaction log backup filename for Maintenance plan

$
0
0

Hello,

not sure if this is the correct section for this question but didn't find anything specially for Maintenance plans.

We have a setup to copy and restore full backups and transaction logs from our production servers to "recovery" servers.

The problem is some of our servers run SQL Server 2005 and some run SQL Server 2008.

Now, the transaction log backups filenames (backups are done with maintenance plan) differ between the 2 versions.

In SQL Server 2005 the filename format is YYYYMMDDHHmm.trn

In SQL Server 2008 the filename format is YYYY_MM_DD_HHmmSS_xxxxxxx.trn

Is there anyway to configure the format of these filenames. I know i could make scripts to create the transaction log backups, but it just seems to me that it should be configurable.

Thanks for the help!


Database backups and retention?

$
0
0
Is there any way in Sqlserver to take a full backup and only on successful completion delete the previous full backup?  I want to maintain a retention of 1 and have Sqlserver manage it without having to create a Maintainence History cleanup job that runs after the backup job. 

Backup maintenance plan not working on remote drive -SQLServer 2008 r2

$
0
0

We are using SQL Server 2008. We have a maintenance plan for data backup which places backups on local and remote drives.

We are getting error while specifying remote drive.


Regards,

Salman



unable to delete/remove the existing backup job under Maintenance Plan

$
0
0

We need to delete/remove the existing backup job in SQL 2005

We logged in MS SQL Server Management Studio Express as both SA and Administrator, expanded "Maintenance Plan", located the backup job, right click on it, neither of them gives us the option to delete/remove. The only options we saw were "Reports" and "Refresh".

The version of SQL Server is 9.0.5000

Thanks

DB Maint Plan - Cleanup old DB Backup files not working

$
0
0
I created a DB Maint plan with just a 'Maintenance Cleanup Task'; the job executes fine, but does not remove files.  The sql it says it's running is: EXECUTE master.dbo.xp_delete_file 0,N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup',N'.bak',N'9/11/2005 11:12:31 AM', any ideas?  The logfile says it worked.  June CTP.

Issue with Merge command not finishing

$
0
0

SQL Server Standard 2008 R2

I have a rather complex MERGE command with when matched, not matched target, and not matched source.  It runs just fine on a data set of 360K rows, but does not complete on a 500K data set.  sp_who2 indicates millions of pagelatch_sh waits.  Yet if on that same data set, I break the Merge up and run each part individually (insert, update, delete) they each run very quickly.

Has anyone seen this before?

Viewing all 15889 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>