Quantcast
Channel: SQLServerCentral » SQL Server 2008 » SQL Server 2008 - General » Latest topics
Viewing all 16406 articles
Browse latest View live

OLE DB Error

$
0
0
I am using 2008 R2 and trying to build an Excel file from data within SQLI am using the following codeSET @SQL=N'INSERT INTO OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Excel 8.0;HDR=YES;DATABASE='+@FILENAME+''',''Select * from [Whitelist$]'')SELECT PHRASE FROM dbo.TBL_PHRASE WHERE TID = '+@TID+''where @filename and @tid are declared varchar valuesi have to use @filename as the excel file is unique every time and has a changing filenameI get the following error :Cannot create an instance of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".My server is 64 bit and i have Microsoft.ACE.OLEDB.12.0 in the provider list within linked servers - all options are unchecked except Dynamic ParameterI think everything else is enabled on the serverthe folder in which the file sits has rights for everyone set to full access

Log File is full when reindexing... but not

$
0
0
running a reindexing job on three databases sitting on a two node cluster. Reindexing job runs weekly, just fine. But, once in a while the reindexing fails, saying the transaction log is full. But the transaction log is not full. its set to unlimited growth, and there are hundreds of gigs free on the data drive. any thoughts?

SQL Full Text Search

$
0
0
Hi,If I search in all indexed columns (varchar255, MSSQL2008R2) with CONTAINS + NEAR with:WHERE CONTAINS(*, 'bike NEAR performance');and bike and performance are in the same column I have got a hit.But when bike and performance are in two differen columns I haven't a match.Both have a fulltext index in the same table.Is this the right behavior?How can I search if bike and performance are in two different columns?thanks

exponential notation - Destination Flat File

$
0
0
Hello,i have created a Data transformation task that sends the contents of a table to a flat file, but some of the numbers end up having Exponential notation at the end. How can i stop this from happening?I tried creating a view and converting it to differnt values but it always end up with the notation. It was also changed in DTS without succesExample:0.0500000008032566ends up as:5.0000000803256624E-2Some of the numbers really need to have 13 decimalsPlease advise how to get rid of the E-2

MSSQL As Search Engine

$
0
0
Chatter around the office water cooler is that MSSQL is not great for driving search intensive applications, and that something like Postgres is better for some reason.Something like searching a big customer table, where there will be some character string searches, such as key words in description column. SQL can use full-text search in this case.Are there any "generalities" about 1 flavor of database being better running a search engine compared to others ??

Sql Servert Agent Not Run Help Me Please

$
0
0
This is the log to sql server agent2012-03-24 14:11:47 - ? [100] Microsoft SQLServerAgent version 10.0.5500.0 ((Unknown) unicode retail build) : Process ID 37322012-03-24 14:11:47 - ? [101] SQL Server TI5 version 10.00.5500 (0 connection limit)2012-03-24 14:11:47 - ? [102] SQL Server ODBC driver version 10.50.25002012-03-24 14:11:47 - ? [103] NetLib being used by driver is DBNETLIB.DLL; Local host server is 2012-03-24 14:11:47 - ? [310] 4 processor(s) and 3895 MB RAM detected2012-03-24 14:11:47 - ? [339] Local computer is TI5 running Windows NT 6.1 (7601) Service Pack 12012-03-24 14:11:49 - ? [432] There are 12 subsystems in the subsystems cache2012-03-24 14:11:51 - ! [364] The Messenger service has not been started - NetSend notifications will not be sent2012-03-24 14:11:51 - ? [129] SQLSERVERAGENT starting under Windows NT service control2012-03-24 14:11:51 - + [260] Unable to start mail session (reason: No mail profile defined)2012-03-24 14:11:51 - + [396] An idle CPU condition has not been defined - OnIdle job schedules will have no effect2012-03-24 14:32:36 - ? [130] SQLSERVERAGENT stopping because of Windows shutdown...2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, SQL Server Network Interfaces: The requested security package does not exist [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, SQL Server Network Interfaces: The requested security package does not exist [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, Client unable to establish connection [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [382] Logon to server '(local)' failed (SaveAllSchedules)2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, SQL Server Network Interfaces: The requested security package does not exist [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, SQL Server Network Interfaces: The requested security package does not exist [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, Client unable to establish connection [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [298] SQLServer Error: 773, A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [SQLSTATE 08001] 2012-03-24 14:32:38 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)2012-03-24 14:32:38 - ? [098] SQLServerAgent terminated (normally) :crying:

Need to add AM PM to a datestamp

$
0
0
New here, so if I did not follow a format, my bad.I have a query that I am using @startdate and @enddate.DECLARE @StartDate SMALLDATETIMEDECLARE @EndDate SMALLDATETIMESET @StartDate = '2016-08-30 08:00:00.000'SET @EndDate = '2016-08-30 11:59:59.997'WHERE (ORDERS.OrderReceivedDate >= @StartDate) AND (ORDERS.OrderReceivedDate < @EndDate)How do I add AM or PM for the time?Regards,

converting Oracle SQL used to convert HEX MSID to ESN to MS SQL

$
0
0
I am trying to convert this code below to MSSQL (from Oracle). I have tried several bad attempts but the TO_NUMBER / TO_CHAR is frustrating me. any one that can help I would REALLY appreciate it. I could not find any links about ms sql doing this, plenty of oracle. needs to be something out there for MS SQL!!! Convert from DEC to HEXLPAD(trim(TO_CHAR(substr(serial_number_dec,0,10), 'XXXXXXXX')),8,'0') || LPAD(trim(TO_CHAR(substr(serial_number_dec,11,8), 'XXXXXX')),6,'0')Convert from HEX to DEC LPAD(TO_NUMBER(substr(serial_number_hex,1,8), 'XXXXXXXXXX'),10,'0') || LPAD(TO_NUMBER(substr(serial_number_hex,9,6), 'XXXXXXXX'),8,'0')

SQL pre-login - reset

$
0
0
Hi,SOmetime connection to SQL port 1433 received error as below...any idea.. ?Attached is the sample wireshark captur with reset.... :)

Query to get status of log-shipping

$
0
0
We have custom log-shipping, i can easily find the time stamp when the t-log backup was taken and when the log was restored. As an additional check i thought i could take first and last lsns from source database and match it against first and last lsn's of target database. Apparently the lsn's match ( i.e source firstlsn = target first lsn and same for last lsn ) how ever in reality target database is 60 mins behind. Am i checking against wrong LSN's?

max text replication size

$
0
0
Our replication recently failed with the error "Length of LOB data ... to be replicated exceeds configured maximum ...". The maximum was the default 65536. I doubled it to 131072 and all was well. On investigating I found the occurrence of the TEXT column that was the likely culprit. However I also discovered that there have been numerous recent occurrences of this column > 65536 that did not cause replication to fail. Is there any rational explanation for this? It's a pull transactional replication with both publisher and subscriber at SQL 2008 R2 SP3.

Data gets truncated and breaked

$
0
0
while fetching data through Linked server column data not display full qualified rows.Source server: Property vendor database, this database data can't visible normally and viewing thru ODBC query tool only.Destination server: SQL 2K8R2 installed and created linked server via ODBC name.SQL box, installed AIMAPI 3.4.3 odbc driver and created ODBC name from that ODBC name created linked server in SQL instance. Linked server test connection successfully and data also fetching but not fully qualified column data.Could you suggest me if any alternative ways?Thanks.

Get notified when sql server agent isn't running?

$
0
0
Basically I have jobs on a server, which I dont control or the hardware its on. I have jobs like backups running. If agent isnt running, the jobs dont run?How can i get notified that teh jobs dont run? I can get nofication of failure - but that require ewth agent to be running doesnt it?I have multiple instances in variuos sites to monitor like this?Any advice appreciated. Thanks

PLE is too high (larger than uptime...)

$
0
0
Hi,Server has been restart this morning, i got[font="System"]object_name SQLServer:Buffer Managercounter_name Page life expectancy UPTIME_MIN 312PLE_SECS 3600143PLE_MINS 60002[/font]with this request[code="sql"]SELECT [object_name],[counter_name], UPTIME_MIN = CASE WHEN[counter_name]= 'Page life expectancy' THEN (SELECT DATEDIFF(MI, MAX(login_time),GETDATE()) FROM master.sys.sysprocesses WHERE cmd='LAZY WRITER') ELSE ''END, [cntr_value] AS PLE_SECS,[cntr_value]/ 60 AS PLE_MINSFROM sys.dm_os_performance_countersWHERE [object_name] LIKE '%Manager%' AND[counter_name] = 'Page life expectancy'[/code]and same PLE value with BrentOzar and Glenn Berry scriptsDid i misunderstood something ? google didn't help mesql version is 10.50.6529.0, on vmware with 4 vcpu and 16 GB ramthxAz'

CREATE INDEX statement rollback doesn't behave as expected

$
0
0
Hello everyone.Recently, I needed to apply a clustered index to a table. I first performed the operation in a Staging environment. The operation completed in about 20 minutes, so we planned for Prod to take approximately the same time, but we didn't take down any user apps. After I executed the statement, we let it run for about 4 minutes before we noticed some unanticipated blocking that was causing application queries to time out. Due to the timeouts, we decided to stop the execution, so I cancelled it.Now, I assumed that either one of two things would happen when I pressed the cancel button: 1) SQL Server would stop organizing the data on disk and leave anything it had already moved where it was, thereby causing the rollback to be almost instant.OR2) SQL Server would take the data it had already organized on disk and move it back to where it was before, thereby causing the rollback to take approximately as long as the statement had been executing. In this case, the statement had been running for 4 minutes, so the rollback should make the total time 8 minutes.Well, neither one of those things happened. The rollback actually took 20 minutes by itself, which was the amount of total time the index took to apply in Staging. This made the total time 24 minutes (execution for 4, rollback for 20).Now, I am no internals expert, but what I infer from this is that after I clicked the cancel button, SQL Server had to scan the entire index on disk to find what data it had moved, and then move it back.Does anyone have any more insight on this? Am I even in the ballpark here?FYI, the only thing different between the Staging and Prod environments is that Staging has about 1/6 of the RAM. Also, the table was around 28 million rows and was a heap. Thanks all!

How to get list of all tables/index that are not compressed for all Databases in an instance

$
0
0
How to find out which big tables and indexes are not compressed.Is there a standard report for this at the instance level? or db level?or anyone have a script for this? Please advise. Thanks.Report criteriaAny table with data > 800 MB not compressedAny index with disk usage > 80 MB not compressed

Kitchens For Sale Carlisle UK

$
0
0
Kitchens For Sale Carlisle UK Go to cheapkitchens•uk•com

Timeout for insert (table with full text search)

$
0
0
Hi I have a table with 11 G data space and 25,000,000 records.3 fields are configured for full text search, they are all nvarchar(4000) and the cataloge size is 22 G.every day about 1,000,000 records,are inserted into this table.But I have a lot of insert timeout.for example when i run sql profiler or in other times.1.does population is the reason for timeouts?or 2.does the size of cataloge have effect on performance of it?

Unless the log is being backed up is there a reason for setting a databse to the BULK LOGGED recovery model

$
0
0
I understand the benefits of using FULL and or BULK Logged recovery models in as far as backup/restore are concerned but if the log file for a DB is not being backjed up then is there any reason for setting a DB recovery Model to BULK LOGGED or FULL versus using SIMPLE? For some reason the DB that is used by a software/service we use is regularly changed from FULL to BULK LOGGED and back to FULL again throughout the day. I can see it in SQL Servers log files and I can see it happening if I turn on Profiler and capture the activity. I found a Stored procedure inside the DB that consists SET RECOVERY commands and its called numerous times throughout the day. Before we contact the vendor about this I'd like to know if there is a SQL SERVER reason/benefit to doing this seperate from whatever reason the software vendor provides. We have never backed up the log file for this DB so I'm puzzled as to why this thing is constantly changing the DB's recovery model.

Bulk copy from one database to another

$
0
0
Experienced developer but pretty new to SQL Server...About 8 times a year (roughly twice a quarter), I need to copy a subset of tables/columns from one database to another. This is due to data access security requirements over which I have no control (can't turn on cross database access). The copy involves ~ 1 billion records across 10 tables.Most of the source tables have no relationship (no FKs); 4 have FK's to another table. I've created indexes on the target tables to support the queries required by the application.My first attempt (TRUNCATE TABLE, INSERT INTO) filled the transaction logs. After a bit of Googling, I've written a Powershell script that uses the .Net Data.SqlClient.SqlBulkCopy class to copy the data from source to target database.When I tested the performance of this script copying to target heap tables, the results were great. Now that I've added the indexes, not so good.Any advice for improving the performance? Should I disable FK's, drop the indexes, truncate the tables, run the script, recreate the indexes, reenable the FK's? Is the *overall* processing time improved by first dropping the indexes, vs. just truncating the table and letting the indexes get recreated during the bulk copy? From my Googling, it doesn't appear that I can programmatically capture the current indexes and recreate them later. A pity, but this can be easily scripted.I just tested - it appears I have the access rights to change the target database logging mode.Any and all advice appreciated.
Viewing all 16406 articles
Browse latest View live