Quantcast
Channel: Fórum SQL Server Database Engine
Viewing all 15680 articles
Browse latest View live

how to identify PK violation values

$
0
0

I have an application that is trying it insert some duplicated PK values into a table and there was always an error due to the insert. I know which database and table is affected but how I can identify which fields are being inserted as duplication? I tried server profiler with the Errors and Warnings Exception event and it did show the errors, however, it didn't show what fields were being violated.

Any idea how I can identify those values?

Thanks


determine SQL CU level?

$
0
0

How do you do know which CU level is applied?  We have SP1 but not sure what the CU level is.

select @@version returns

Microsoft SQL Server 2008 (SP1) - 10.0.2757.0 (X64) 
Jan  8 2010 19:55:08 
Copyright (c) 1988-2008 Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

Using Unicode in SQL Server

$
0
0
Hi I'm have big problems trying to save Unicode information into my MS SQL Server 2000 Desktop Engine.

Alright, so the problem I'm having now is I'm working with MS SQL 7.0 and PHP5. I've trying to get information to save into MS SQL, however it is storing it all weird. When I save the information and try to view it in Enterprise Manager it shows it has random characters but for some weird reason I can output that information on the page correctly when I do a SELECT query.

Here's an example of my problems.
<?php
$insQ    
=  "INSERT INTO my_tblBusiness (
                pkID,
                fkbusinessID,
                ntitle,
                ndescr
             ) VALUES (
                 '1',
                 '1',
                 N'主要提供韓式菜餚的',
                 N'主要提供素食餐點或提供素菜菜餚的餐廳'
             )"
;

$DB->Query($insQ);

/**
  *  When I look at this information using Enterprize Manager
  *  it is showing 
  *  Title: "主要提供韓式菜餚的餐廳"
  *  Descr: "主要提供素食餐點或提供素菜菜餚的餐廳."
 */
?>


But to make everything that little bit more weird, when I output it it shows correctly.

<?php
$DB
->Query("SELECT 
               ntitle,
               ndescr
FROM my_tblBusiness"
);

while(
$rs $DB->fetch_assoc()){
    echo 
'Title:'.$rs['ntitle'].'<br />';
    echo 
'Descr:'.$rs['ndescr'];

}
/**
  *  Outputs in the Browser:
  *     Title: 主要提供韓式菜餚的
  *     Descr: 主要提供素食餐點或提供素菜菜餚的餐廳
 */
?>


Now here's the kicker. When I do the same INSERT with SQL Query Analyzer, it puts in it the DB correctly. AND when I look at using Enterprise Manager it shows "主要提供韓式菜餚的" and "主要提供素食餐點或提供素菜菜餚的餐廳".

Alright, so does any know how I can get PHP to be able to insert proper Unicode information into my MS SQL 7.0 DB?

what is the clustering?what is the difference's Active/Active and Active/Passive cluster and what is the main peruse clustering ?

problem with bulkcopy .mdb access file into sqlserver2008

$
0
0

hi...

here is my code.i have to bulkcopy access .mdb into sqldatabase. my data is persian.when i test this code in my computer it works fine. but when i do this in server(on the web) it works good but al my data format damaged like as "ÝæÞ ÇáÚÇÏå ÓÎÊí ÔÑÇíØãÍíØßÇÑ" ...

i can't find what this happaned.

please help me.

string s = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("~/.../" + fileName);
OleDbConnection OleDbConn = new OleDbConnection(s);

           

try
        {
            string sSQLTable = table;

            string myAccessDataQuery = "Select * from " + sSQLTable;

            OleDbCommand OleDbCmd = new OleDbCommand(myAccessDataQuery, OleDbConn);
            OleDbConn.Open();


            OleDbDataReader dr = OleDbCmd.ExecuteReader();
            SqlBulkCopy bulkCopy = 
                new        SqlBulkCopy(WebConfigurationManager.ConnectionStrings["mySqlConnectionStr"].ToString() ,
                    SqlBulkCopyOptions.KeepIdentity);

            bulkCopy.DestinationTableName = sSQLTable;

            bulkCopy.WriteToServer(dr);

            OleDbConn.Close();
            return "Done";
        }

SQL Server 2008 R2 SP1 CU8 patching error

$
0
0

I am applying SQL Server 2008 R2 SP1 CU8 on one of my cluster server and I am getting below error. The same error is appearing on all SQL Server 2008 R2 Cluster Server.

The file share for filesteam is <a href="file://\\?\GLOBALROOT\Device\RsFx0152\\SQL1">\\?\GLOBALROOT\Device\RsFx0152\<localmachine>\SQL1 under Cluster Fileshare

2012-11-18 18:57:31 SQLEngine: --ShareMgmt: Error removing current machine from the Filestream File Share resource's possible owners. Error: The private properties for resource 'SQL Server FILESTREAM share (SQL1)' could not be saved.  Error: The network path was not found. (Exception from HRESULT: 0x80070035)

Any Idea if someone has faced the same kind of issue ?


RS_DBA

Could not read meta deta

$
0
0

below is described error:

Microsoft.SqlServer.Management.Smo.SmoException: Could not read metadata, possibly due to insufficient access rights. at Microsoft.SqlServer.Management.SqlScriptPublish.GeneratePublishPage.worker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

some urgent help needed to fix this...

 

error while geneartign script for entire datbase and entire obbject case only.

Problems installing AdventureWorks

$
0
0

I am working with SQL Denali CTP3 and I am trying to download the AdventureWorks database however everytime that I try to download this even the older verision including SQL Server 2008 R2 AdventureWorks it gives me the following error

A fatal error occurred during installation. Details:

Failed object initialization(IsupportInitialize.EndInit). SQL Server WMI provider is not availiable on C_PBREVELANT. Error at object 'DatabaseSelection' in markup file 'DatabseInstaller;Component/databaseselection.xaml' Line 78 Position 3

 

Is there anything I can do or is there something I am doing wrong to download.


Bryan Revelant

sp_helpfile is showing wrong path

$
0
0

In logshipping I have backed up database from source and restored the database on destination server,

When I query for a database : sp_helpfile and sys.master_files

then sp_helpfile is showing wrong path and actually this path is of source mdf and ldf location.


Thanks


Describe the differences between the pessimistic SERIALIZABLE model and the optimistic SNAPSHOT model in terms of transactional isolation

$
0
0

 Describe the differences between the pessimistic SERIALIZABLE model and the optimistic SNAPSHOT model in terms of transactional isolation (i.e., not the concurrency differences, but instead how the exact same transactional modifications may result in different final outcomes).

plz answer this question

question on setting up alert

$
0
0
Hello All,

I want to set up an alert that sends out an email if a column value of a table is less than some value. Is it possible to create an alert based on tsql? 

Thanks in advance

What is OBJECTSTORE_LBSS?

$
0
0

My database instance was running slow. I logged into the machine to find SQLServer was taking 32GB of memory(out of 32GB), odd since I configured it to only take 14GB.

 

Ran the following:   

select name,
   type, SUM(single_pages_kb + multi_pages_kb)
   AS MemoryKB FROM sys.dm_os_memory_clerks
   GROUP BY name, type ORDER BY MemoryKB desc


Name        Type                         MemoryKB
LbssCache OBJECTSTORE_LBSS 46247928
Default MEMORYCLERK_SQLGENERAL 2439752
SOS_Node MEMORYCLERK_SOSNODE 2106560
Default MEMORYCLERK_BHF 288168   ...

 

This is SQL Server 2008 (10.0.2710) x64

Does anyone know whatOBJECTSTORE_LBSS are or do?

I ended up restarting the instance but would like to find a place to look before this happens again.

 

Thanks, Amy

Failover 2node cluster is not happening

$
0
0

Hello,

Am trying to failover the cluster which has 2node cluster.  The second node was not able to handle all the resources, but am trying to failover to other node it not able to handle the resources.  I could find the below error in event Viewer...

 

Event ID: 1177

Cluster service is shutting down because the membership engine failed to arbitrate for the quorum device. This could be due to the loss of network connectivity with the current quorum owner. Check your physical network infrastructure to ensure that communication between this node and all other nodes in the server cluster is intact.

 

The same question has  been asked earlier in the thread but i couldn't find the correct answer.  Please do help me on this.

An error occured during encryption - Views?

$
0
0

I ran the view on sqlserver 2008 R2 EE and getting the below error :

Msg 15466, Level 16, State 2, Procedure vw_entityRpt, Line 4

An error occured during decryption.

What is the issue?

Thanks,

Ron.

how to rename column name of a table using sql server command

$
0
0

dear sir plz tell us how to change my column name permanently using sql command???

note: I want to run it on sql server 2005


Today is the Great day


Updating Configuration Files using SQL Statements

$
0
0

In SQL, are there any direct SQL commands to update the configuration files.

I want to keep my configuration files away from users, and don't want any manual updates in them, but want to use some simple SQL commands fired from Admin console only to update the configuration files.


Vishal Soni

Cannot insert duplicate key row in object XXX with unique index YYY (Value,0x8be8070005000300)

$
0
0
Problem summary:
Server configuration: SQL Server 2008 R2 Sp2

Initial state:
We have several fact tables partitioned by a partitioning function. The partitioning function datatype is numeric and partition is done based on year. On the tables, we’ve been using nonclustered primary key  and all the non clustered indexes are partition aligned.  There are lots of foreign key reference to DIM tables from FACT tables. The ETL modifying these fact tables based on teh last week data change. Update is used to update the fact tables based on the primary key

Symptoms:
When loading the fact tables, especially the larger ones (wide tables with 30 to 50 columns, most of which are indexed dimensions), data modification to certain tables fails. The error message we get states “Cannot insert duplicate key row in object 'dbo.FACT TABLE' with unique index 'Index Name'”. The mentioned index is not unique although the message says so. But the primary key has unique primary key.By selecting the data we’ve been trying to insert we have checked that no duplicate unique data is being inserted.

Workaround:
Dropping all nonclustered indexes and then re-running the ETL to update the change dataand recreating the indexes works fine. The workaround is not acceptable in a daily manner due to size of the tables.





Maximum threads exceeded in SQL Server 2000

$
0
0

Dear all, 

We're using SQL Server 2000 sp3 in Windows Server 2003,

with 8 cores of processor and 12GB of memory.

In the moment, our server suffers from these errors:

- startsubprocess: Limit on 'Max worker threads' reached (sets max on 255, while on Task manager it reached 283)

- 1229 : Process ID xxx:xxx owns resources that are blocking processes on Scheduler x.

- Error: 17883, Severity: 1, State: 0

   The Scheduler x appears to be hung. SPID xx, ECID x, UMS Context xxxxxxxxxx.

- Error: 17884, Severity: 1, State: 0

   Potential deadlocks exist on all the schedulers.

What are the problems that can cause those error?

And what can cause the sql server threads to exceed the maximum threads default?

Regards,

Stan

Clustered Index Update or Insert Expensive Query Plan Operator

$
0
0

Hi Everyone,

I'm in the process of analyzing a sql 2008 database for performance reasons. I have discovered a significant number of DML query plans that seem to show a high operator cost for 'Clustered Index Update' as well for plans that have a 'Clustered Index Insert' operator. By high I mean the operator cost shows one for example of having an estimated cost of 0.030003 (912%). Is this something that I should be concerned about? I'm going to soon (hopefully this week) run 'SET STATISTICS PROFILE ON' to see if that helps explain what might be going on. This particular table's row count is approx 50K. The table has one clustered index on a uniqueidentifier (Random) and one unique non clustered index on a FK column which points to a table that has a row count of approx 260K. There is also a FK to another table with 24 million rows. Most other tables have a similar physical design (PK clustered on random uniqueidentifer surrogate column. FK to this other table with 24 million rows). The system is a OLTP system and is more read intensive than write intensive. About 5 users with write capability in the system at a time. About 10-15 users with read ability active at the same time. Some reports are written against this database.

The update statement does not attempt to update the clustered key column. It's possible it could update the non clustered key column though that typically never changes.

I could try to post the show query plan XML if needed if I can get it to fit into this thread.

Thank You.

Morgan

How to find empty views in a database in sql server2000

$
0
0

Hi all,

how to get list of views which doesn't contain any records  in a database in sqlserver2000

please help me

thanks in advance,

kishor.

Viewing all 15680 articles
Browse latest View live


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