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

Logshipping and the time problem

$
0
0

Hi all

I set the logshipping for a database, however it only run for one time. And I found the time of the server change to another day after the first logshipping.

any idea about this issue ?


What all database operations are logged in transaction log

$
0
0

I would like to know that what all operations are used to logged in transaction log?

Please also suggest if any blog or white paper for this details.

advance thanks!


Regards Vikas Pathak

How to transfer data from 2008 to SQL Server 2012

$
0
0

I am setting up a new SQL Server 2012 trying to move data via backups from a SQL Server 2008.  The 2012 server says the backup data is not compatible.  What is the recommended method to do this?

Many thanks...

Todd

Unable to connect to the data source. Please verify the connection properties and credentials.The connection either timed out or was lost.

$
0
0

Hi All,

I am posting this information believing that it would certainly save someones time. We are using Sql Server Reporting Services 2008 R2, the objective is to generate the reports bu connection to Sql Server Services 2008 R2. We observed the below error while trying to use 'Test Connection' in Report Builder.

'Unable to connect to the data source. Please verify the connection properties and credentials.'

'The connection either timed out or was lost.'

We exactly don't know the reason for the issue, but we have accidentally figured out a solution for this issue. (a permutation and combination approach)

used fully qualified domain name for the SSAS server name in one environment and used strictly server name(without FQDN) in another environment. 

Both of them were working differently in the two cases, but were working fine. However the issue was resolved with no error. 


Best Regards, Paramesh.

Does Option recompile force the recompilation of all Nested/child stored procedures ?

$
0
0

Hi All,

I just wanted to find out if a top level stored procedure uses the with recompile keyword, does this force the recompilation of all child/nested stored proecdures or will those need the WITH RECOMPILE keyword as well ?

Thanks in advance.

linked server strange behavior

$
0
0

Hi

I just linked a server but when I browse the catalog I see the same dabases, it´s like I´m brwosing into the non linked server. No clue what´s going on. I have another linked server and it shows OK.

any idea?

thanks!

Powershell to import csv file

$
0
0

Hello all,

Running sql 2008 sp1

New to PowerShell. Can someone please check the syntax and tell me if something doesn't look right.

Trying to load a csv file into a table

The csv file is comma delimited and contains double quotes around values that have a comma in them.

        $Server = "MyServer"
        $Database = "MyDatabase"
        $Table = "MyTable"
        $ShareUNCPath = "\\MyShareUNCpath\MyTestfile.csv"
        $DataImport = Import-Csv -Path $ShareUNCPath
        $DataTable = Out-DataTable -$DataImport
        Write-DataTable -ServerInstance $Server -Database $Database -TableName $Table -Data $DataTable

Thanks

gv


Sword

login failed error

$
0
0

Hey friends,

In my SQL server 2008 R2, I have found in error log contineously following error:

Login failed for user 'domain\tomt'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: 192.9.200.18]

When I have try to find out the details using  trace (sys.trace_events) then I got application name only as ".Net SqlClient Data Provider".

I want to solve this issue. Please help me how to solve this Or wher can i get exact information that this request comes from?



Transaction Log backup error

$
0
0

We were trying to backup the transaction log for one of our databases that is in Full recovery mode. However, while trying to perform the backup we encountered the following error.

Backup detected log corruption in database livelink2. Context is Bad Middle Sector. LogFile: 2 'E:\SQLDATA\livelink2_1.ldf' VLF SeqNo: x23ef VLFBase: x56180000 LogBlockOffset: x56533000 SectorStatus: 2 LogBlock.StartLsn.SeqNo: x23ef LogBlock.StartLsn.Blk: x1d56 Size: xf000 PrevSize: xf000”

Any idea why this happens?

Statistics and Tempdb

$
0
0
OS - Windows 2008 R2

SQL Server - 2008 R2 SP2

I executed the following t-sql to gather statistics info on a server:

declare @temp1 table (DbName varchar(250), TableName varchar(250), IndexName varchar(250), IndexType varchar(100), Date_Updated datetime)
insert into @temp1
EXEC sp_MSForEachDB
'use [?]; SELECT  ''[?]'' AS DbName,
  t.name AS Table_Name
        ,i.name AS Index_Name
        ,i.type_desc AS Index_Type
        ,STATS_DATE(i.object_id,i.index_id) AS Date_Updated
FROM         
  sys.indexes i JOIN
  sys.tables t ON t.object_id = i.object_id
WHERE         
  i.type > 0
ORDER BY
  t.name ASC
 ,i.type_desc ASC
 ,i.name ASC '

select * from @temp1
order by DbName desc

I noticed some indexes on tempdb.





I was wondering if someone could shed some light on this tempdb activity and if I could trace theses indexes/table objects to original source database/table objects, if possible. In addition, is such an activity on tempdb a potential performance hazard?

Thank you.

-Jeelani

restore while backup job is running

$
0
0

We are using sql server 2008, planning to migrate to sql server 2012.

We have an ETL process (job 1) that runs each night to restore data from server-A to server-B; We also have a backup job (Job 2) set up by our DBA, that runs each night to backup server-A database. Depending on the time taken by job2, it sometimes overlaps with job 1 and locks job 1 out. Can we setup the back up job in a way that it allows job 1 to restore from server-A while the backup is still in progress? What do I need to do or instruct the DBA to do for this?

Thanks in advance.

The query has been canceled because the estimated cost of this query exceeds the ....

$
0
0

Hi Experts,
I am getting below error while executing the stored procedure.

The query has been canceled because the estimated cost of this query (3258) exceeds the configured threshold of 2500. Contact the system administrator.

I am importing the XML into the table. Actually, I am uploading CSV contacts in my application & then push the XML to sql server. Here, I extract the contacts using xpath query, & save into a table. In my local machine, this code works fine while I upload this code on production server, it raises the above error. below is the sample code which I am using:

INSERT INTO @TempTable(FullName, FirstName, LastName, Email, DateOfBirth, CountryCode)
SELECT FullName = T.Item.query('fullname').value('.', 'VARCHAR(256)'),
FirstName = T.Item.query('firstname').value('.', 'VARCHAR(256)'),
LastName = T.Item.query('lastname').value('.', 'VARCHAR(256)'),
Email = T.Item.query('email').value('.', 'VARCHAR(256)'),
DOB = CASE WHEN T.Item.query('dateofbirth').value('.', 'VARCHAR(10)') = '' THEN NULL
ELSE CONVERT(DATE, T.Item.query('dateofbirth').value('.', 'VARCHAR(10)'), 103)
END,
CC = T.Item.query('country').value('.', 'CHAR(2)')
FROM @xmlData.nodes('contacts/contact') AS T(Item);

above code works fine & takes only few milliseconds on my local system but throws an error on production server.

I have tried to search the reason & found that this error is due to long execution time. so, either I will have to increase the query governor execution time or I will have to optimize the query.

But I am not able to understand what can I do to optimize this query. This is basic XQuery syntax. Please guide me how can I fix this issue ?

Recovering 1TB of unallocated space?

$
0
0

Please read the post well. I posted somewhere and most of the posters assumed that the 1TB table is there. It's not. Also, the size of the MDF is 1.75TB, the HDD has 1.83TB used and 65.8GB is free.

So here: my problem: I needed to reduce my 1.8TB MDF, so I dropped a table that took up 1TB of space.

Now, according to sp_spaceused, I have 1TB of unallocated space and I want to recover it.

What I did:
1) I began executing dbcc shrinkfile yesterday, but "percent_completed" 24 hours ago was 39.75% and now it's 40.80%. At this rate it'll take over two months.

2) I ran shrinkdatabase with TRUNCATEONLY option (following code), and it went from 1.76TB to 1.74TB.

3) I cannot reindex anything because the table with the data is gone.

What other options do I have to recover the unallocated space?

Thanks.

Helping interpreting SQL 2008 deadlock graph

$
0
0

One our of ASP.NET web apps was a deadlock victim while trying to update a column value on a record (batch table in our case).

The app tried to update a column value for a single record to reflect an application lock prior to deleting the record.

I obtained the deadlock graph but not quite sure how to interpret.

How do I figure out who/what caused the deadlock from this graph?

thanks!

<deadlock><victim-list><victimProcess id="process30216b048" /></victim-list><process-list><process id="process30216b048" taskpriority="0" logused="0" waitresource="RID: 9:3:206695:32" waittime="4976" ownerId="8166315567" transactionname="UPDATE CURSOR" lasttranstarted="2013-01-26T12:34:54.293" XDES="0x1b214f970" lockMode="X" schedulerid="2" kpid="7936" status="suspended" spid="175" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2013-01-26T12:34:49.887" lastbatchcompleted="2013-01-26T12:34:49.887" clientapp="Index" hostname="AcmeZFPWEB2" hostpid="3108" loginname="Acmeuser" isolationlevel="read committed (2)" xactid="8166315567" currentdb="9" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"><executionStack><frame procname="" line="57" stmtstart="4426" stmtend="4586" sqlhandle="0x03000900f28e8b0183d457018a9d00000100000000000000" /><frame procname="" line="32" stmtstart="1740" stmtend="1958" sqlhandle="0x030009009eddfa162ba25e01129f00000100000000000000" /></executionStack><inputbuf> Proc [Database Id = 9 Object Id = 385539486] </inputbuf></process><process id="process5262bc8" taskpriority="0" logused="10000" waitresource="KEY: 9:626345259433984 (a8016a427524)" waittime="4999" schedulerid="11" kpid="5948" status="suspended" spid="174" sbid="0" ecid="0" priority="0" trancount="0" lastbatchstarted="2013-01-26T12:34:49.887" lastbatchcompleted="2013-01-26T12:34:49.887" clientapp="Index" hostname="AcmeZFPWEB2" hostpid="3108" loginname="Acmeuser" isolationlevel="read committed (2)" xactid="8166313140" currentdb="9" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"><executionStack><frame procname="" line="26" stmtstart="1988" stmtend="2234" sqlhandle="0x03000900f28e8b0183d457018a9d00000100000000000000" /><frame procname="" line="32" stmtstart="1740" stmtend="1958" sqlhandle="0x030009009eddfa162ba25e01129f00000100000000000000" /></executionStack><inputbuf> Proc [Database Id = 9 Object Id = 385539486] </inputbuf></process></process-list><resource-list><ridlock fileid="3" pageid="206695" dbid="9" objectname="" id="lock1cf48fc00" mode="U" associatedObjectId="63395306012672"><owner-list><owner id="process5262bc8" mode="S" /></owner-list><waiter-list><waiter id="process30216b048" mode="X" requestType="convert" /></waiter-list></ridlock><keylock hobtid="626345259433984" dbid="9" objectname="" indexname="" id="lock2927c5b80" mode="U" associatedObjectId="626345259433984"><owner-list><owner id="process30216b048" mode="U" /><owner id="process30216b048" mode="U" /></owner-list><waiter-list><waiter id="process5262bc8" mode="U" requestType="wait" /></waiter-list></keylock></resource-list></deadlock>


VS 2012 Pro - How to print values in Textbox

$
0
0
Is it possible to print the property values of a textbox?

ecb


SQL Server Agent Jobs not running 'SQL Server Agent is not currently running so it cannot be notified of this action. (Microsoft SQL Server, Error: 22022)'

$
0
0

Hello All,

We have sql 2008 R2 SP1 A/P cluster running on VM.

SQL Server Agent jobs are not running. If I manually try to run the job it gives below error

'SQL Server Agent is not currently running so it cannot be notified of this action. (Microsoft SQL Server, Error: 22022)'

I checked SQL server Agent service is running, and the service account under it is running has 'sa' access to sql server.

'Agent Xps' has been set to 1.

If I browse to SQLagent.out file. it is completely blank.

Any help on this will be appreciated. Thank You.

-Kranp.

Trouble with installing SQL management studios

$
0
0
Im trying to install SQL Management Studio on windows 7 but I keep getting an error saying it can not found or see Microsoft Native Client but when I check in my programs I do have it, any suggestions? I have SQL server 2008 and was trying to install Management Studio 2008 express and my OS is Windows 7 Pro with service pack 1.

SQL Express database file auto-creation error but web-config changed to Azure SQL-server

$
0
0

I have an app that is based on the new MVC4 template with SImple Membership provider.

I've deployed the app to an Azure website and changed the connection string from a local express-database to an Azure SQL database.

I use my Google Account to log on and It works perfect for a while. If I leave the browser on a page and come back later the Membership Provider somhow want's to create an express database even though in my web.config I'm pointing to the Azure SQL database which works fine if I log out and logon again.

Is there a setting or something or is it just not ment to be used with other databases than local sql express?

Thanks in advance!

/Tomas


Tomas Ekenman www.luxuryspa.se

Import data from Sql tables to Ms access

$
0
0

I need to transfer few tables from  sql to ms access using query.

Can some one please help in writing it

Mirroring status

$
0
0

hI all,

In our production environment mirroring is configured for 2 databases ABC and XYZ. When i see the mirroring status through TSQL SP_DBMMirroringResults the status is showing synchronized and there are no unsent logs are present. and in the same way if i see through GUI abc Database monitor showing synchronized and XYZ monitor showing disconnected. Its very starnge there is no errorrs present for this thing.

And in second scenario replication agents(Snapshot and Logreader) are running fine but when i see through monitor i m getting below error while connecting distributor from publisher.

TITLE: Connect to Server
------------------------------

Cannot connect to XXXXXXXXX.

------------------------------
ADDITIONAL INFORMATION:

Failed to connect to server XXXXXXXXX. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Cannot generate SSPI context. (Microsoft SQL Server, Error: 0)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=0&LinkId=20476

------------------------------
BUTTONS:

OK

Kidly help.

Viewing all 15872 articles
Browse latest View live




Latest Images