Filtering Duplicates In SQL2005 Doesn't Work Anymore

Aug 18, 2006

Hi,

Made the jump from SQL2000 to 2005 - i'm not a DBA but like to play around with such nice tools- and tried to convert my DTS package into a 2005 one.

I've got a csv file containing some log in information.

As users log in everyday, this keeps getting added to the file.

I'm only interested in the latest appearance of a certain machine on the network so i filter by creating an unique Index

the CSV file get's imported into a temporary table first and then i executed the following on SQL2000



CREATE TABLE [patchings].[dbo].[allfilter] (

[username] varchar (20) NULL,

[machine] varchar (20) NULL,

[os] varchar (20) NULL,

[sp] varchar (20) NULL,

[date] smalldatetime NULL,

[time] varchar(10) NULL,

[logonserver] varchar (20) NULL,

[country] varchar (20) NULL,

[domain] varchar (20) NULL,

varchar (20) NULL,

[brand] varchar (20) NULL,

[model] varchar (20) NULL,

[speed] int NULL

)

CREATE unique INDEX [my filter] ON [dbo].[allfilter]([machine], [os]) with ignore_dup_key ON [PRIMARY]

go

insert into "Allfilter" select * from temptable order by date desc

This worked perfectly in SQL2000.

when i try to do the same in SQL2005, it doens't start inserting the most recent machines (filtered on the date) but machines at random



selecting the select * from temptable order by date desc shows me the correct order for the machines by date so i'ld presume that it adds the most recent combination of machine and operating system from "today" and ignores the older appearances.

if the temptable contained for instance..

MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/13 10:02:34 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593
MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/15 9:59:59 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593
MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/16 12:33:09 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593
MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/19 10:48:56 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593
MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/20 11:03:49 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593



under SQL2000 i'ld see one record in the final "allfilter" table

MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/20 11:03:49 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593

under SQL2005 i don't see the last one though coding is the same

MY-MACHINE MY_USER Windows XP Service Pack 2 2006/06/16 12:33:09 Mydomaincontroller BE MY_DOMAIN my_ip IBM type 2593


I guess i'm missing something here but what?

Tnxs

K

View 1 Replies


ADVERTISEMENT

Package Doesn't Run Anymore On SP2

Feb 26, 2007

Hi all,

I've installed SP2 on my server. If I run the package on the server, the package worked there before the installation of SP2. Now with SP2 it doesn't work anymore. In VS2005 on my computer the package works before and after the installation of SP2.

He gives an error with the execution of a sql-task on an oracle server:

Error :Executing the query "insert into cube_content values (trim(?), trim(?), trim(?), trim(?), trim(?), sysdate) failed with the following error: "ORA-01401: inserted value too large for column". Possible failure reasons: Problems with the query, "ResultSet property not set correctly, parameters not set correctly, or connection not established correctly.

Anybody an idea?



Thanks,

Dennis





View 3 Replies View Related

SSIS Doesn't Start´anymore After SP1 Installation

May 2, 2006

Hi everyone,

I've a problem which I think a lot of SQL Server 2005 users had already ...however I didn't found any answers so far. Maybe anyone of you might know.

I have installed SP1 for SQL Server 2005 on 2 systems, one is an Enterprise Edition (english) on a Win. 2003 SP1 system and one is a Developer Edition (also english) on a Win. XP Prof. system.

On both systems the installation process of the SP1 worked fine except that it gave me the message "Reboot required" on the step installation of SQL Server Native Client.

After my reboot I reexecuted the installation of SP1 with the result of no error nor reboot message. Everything seemed fine....

However when I checked the status of the services I recognized that the SSIS has switched from LOG ON AS ...my specific login.... to NT AUTHORITYNetworkService and the automatic startup failed.

I tried to change the login to my previous login which also failed. It tried to change it to any other possible login but the startup with all logins failed with the error message:

The service did not respond to the start or control request in a timely fashion.

The event log of the system does tell me the same error message. The summary log of the SP1 installation doesn't show any error or warning message except "Failed to read registry key: Debug". Enclosed is the log file:

05/02/2006 22:11:09.609 ================================================================================
05/02/2006 22:11:09.625 Hotfix package launched
05/02/2006 22:17:22.296 Attempting to install instance: SQL Server Native Client
05/02/2006 22:17:22.312 Attempting to install target: MHPA0F7C
05/02/2006 22:17:22.312 Attempting to install file: sqlncli.msi
05/02/2006 22:17:22.328 Attempting to install file: e:de43f41a74855a4cfc41014b760758HotFixSqlncliFilessqlncli.msi
05/02/2006 22:17:22.328 Creating MSI install log file at: D:WINNTHotfixRedist9LogsRedist9_Hotfix_KB913090_sqlncli.msi.log
05/02/2006 22:17:22.343 Successfully opened registry key: SoftwarePoliciesMicrosoftWindowsInstaller
05/02/2006 22:17:22.343 Failed to read registry key: Debug
05/02/2006 22:17:38.437 MSP returned 3010: A restart is required to complete the install. This message is indicative of a success. This does not include installs where the ForceReboot action is run. This error code is not available on Windows Installer version 1.0.
05/02/2006 22:17:38.515 Successfully opened registry key: SoftwarePoliciesMicrosoftWindowsInstaller
05/02/2006 22:17:38.515 Failed to read registry key: Debug
05/02/2006 22:17:38.515 Pending reboot, successfully installed file: e:de43f41a74855a4cfc41014b760758HotFixSqlncliFilessqlncli.msi
05/02/2006 22:17:38.515 Successfully installed target: MHPA0F7C
05/02/2006 22:17:38.515 Successfully installed instance: SQL Server Native Client
05/02/2006 22:17:38.515
05/02/2006 22:17:38.515 Product Status Summary:
05/02/2006 22:17:38.515 Product: SQL Server Native Client
05/02/2006 22:17:38.515 SQL Server Native Client (RTM ) - Reboot Required
05/02/2006 22:17:38.515
05/02/2006 22:17:38.515 Product: Setup Support Files
05/02/2006 22:17:38.515 Setup Support Files (RTM ) - Not Applied
05/02/2006 22:17:38.531
05/02/2006 22:17:38.531 Product: Database Services
05/02/2006 22:17:38.531 Database Services (RTM 1399 ENU) - Not Applied
05/02/2006 22:17:38.531 Analysis Services (RTM 1399 ENU) - Not Applied
05/02/2006 22:17:38.531 Reporting Services (RTM 1399 ENU) - Not Applied
05/02/2006 22:17:38.531
05/02/2006 22:17:38.531 Product: Notification Services
05/02/2006 22:17:38.531 Notification Services (RTM 1399 ENU) - Not Applied
05/02/2006 22:17:38.531
05/02/2006 22:17:38.531 Product: Integration Services
05/02/2006 22:17:38.531 Integration Services (RTM 1399 ENU) - Not Applied
05/02/2006 22:17:38.531
05/02/2006 22:17:38.531 Product: Client Components
05/02/2006 22:17:38.531 Client Components (RTM 1399 ENU) - Not Applied
05/02/2006 22:17:38.531
05/02/2006 22:17:38.531 Product: MSXML 6.0 Parser
05/02/2006 22:17:38.531 MSXML 6.0 Parser (RTM ) - Not Applied
05/02/2006 22:17:38.531
05/02/2006 22:17:38.562 Product: SQLXML4
05/02/2006 22:17:38.593 SQLXML4 (RTM ) - Not Applied
05/02/2006 22:17:38.687
05/02/2006 22:17:38.687 Product: Backward Compatibility
05/02/2006 22:17:38.687 Backward Compatibility (RTM ) - Not Applied
05/02/2006 22:17:38.687
05/02/2006 22:17:38.687 Product: Microsoft SQL Server VSS Writer
05/02/2006 22:17:38.687 Microsoft SQL Server VSS Writer (RTM ) - Not Applied
05/02/2006 22:17:38.687


I know there are a lot more LOG files in the directory ..HotFix.. which might tell more about the problem. However I don't know in which file I have to look.

Can anyone help me?



Regards,

Stefan

View 8 Replies View Related

Auto Grow For DB Doesnt Work Anymore

Jul 3, 2001

Hello all!

I've a problem with my database. Till yesterday the option for Auto Grow of Database (10 %) was working very fine, but now it seems to be some problems with it. Finally I had to specify a restricted size for the database and then it again startd to give me some space in the database to write in. Ideally it should have worked automatically, isnt it ???

There is no problem with the space on the drive, I still have some 76 gb of free space there ...

Thanks in advance ...

Anjä

View 1 Replies View Related

After Set New_broker, It Works For Half Hour And Don;t Work Anymore, Please Advise, Thanks!

Sep 10, 2006

I use ASP.NET 2.0 and SQL 2005, the SQLCacheDependency didn't work stable for me, it usually works and after a while, it stops working. Recently, It doesn't work. Today I reset service broker by

Alter DB set new_broker

It seems all work, but too early to be happy, it doesn't work now anymore. I don't see any record in

sys.transmission_queue

And I don't see new entries in

sys.dm_qn_subscriptions neither when I modify a record which bind to SQLCacheDependy.

I see some errors in log like


Message
The query notification dialog on conversation handle '{8F8CC642-6340-DB11-8F09-0014227B7B80}.' closed due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8490</Code><Description>Cannot find the remote service &apos;SqlQueryNotificationService-f79776f7-9ca5-4c5f-8a66-0d81f7673683&apos; because it does not exist.</Description></Error>'.

Any idea how to find out the problem?

thanks!

View 1 Replies View Related

SQL 2000 Stops To Increment @cpu_busy Value, Sp_monitor Does Not Work Anymore

Apr 29, 2006

1) After a couple of months of work SQL 2000 server stops to increment @@cpu_busy. If you query it you€™ll get a constant value as well as error:

select @@CPU_BUSY

Arithmetic overflow occurred.
134217727

2) If you execute sp_monitor you'll get nothing but errors:

Arithmetic overflow occurred.
Arithmetic overflow occurred.
Arithmetic overflow occurred.

This happens only on multiprocessor machines. SQL Service pack 3. The only way to fix it is to restart the SQL service. If you have a performance tool based on that value, like Idera's SQLdm- sorry, it will show zero.

Is there a fix from MS for that?

View 6 Replies View Related

Filtering Duplicates / Using MAX

Mar 13, 2008

Hi all,


I have generated a table of data (currently 81,000 rows, but will be double each week) that looks similar to the following:

CaseNo NewPer NewAmt OldPer OldAmt
334 1/07/08 200 22/01/08 150
334 1/07/08 200 10/12/07 180
334 1/07/08 200 07/07/06 220
2767.......
.
.
.

this table provides an amount for the case set at 1/7/08, combined with any periods and amounts prior to that. The NewPer date is always set, but the OldPer date could be anything up to 15 months prior, and there may be multiple dates in that 15 month period.

The output I want is for each case number, I need to select the single row with the highest OldPer date. (So for each case, what is the NewAmt on 1/7/08, and what was the OldAmt in the immediately prior period.)

When I use max(OldPer), I still get multiple lines for each case number.

Any suggestions?

thanks in advance

View 8 Replies View Related

SQL Server Express: Restore, Backup And Attach Do Not Work Anymore &&amp; Database Locations Fault

May 7, 2008

Hello there,

I've some really big problems with SQL Server 2005 Express. I Recently, I had 2 instances on my machine, one was a SQL Server 2000 Developer and the other a 2005 Express Version. The 2000 version was not necessary anymore, so I unstalled it, since then, the Express version keeps having probems.

Under the Server Properties -> Database settings -> Database Locations I've changed the path to D:sqldatamssql, but now, the programm always takes the "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData" to store and load the databases, no matter what I do.

And there are more problems see here:

Restoring does not work=======================
I wanted to restore a database called "fw40_admin" from a backup file (.bak), but that didn't work at all, it always says this as an error:

"System.Data.SqlClient.SqlError: The operating system returned the error '5(error not found)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'D:sqldatamssqlfw40_admin.mdf'. (Microsoft.SqlServer.Express.Smo)"

But as soon as I type in the installation path "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData" inside the "Restore As" under "Options", it works.

Why does the backup only work in "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData", BUT the database locations under the server properties is indicated with "D:sqldatamssql"????


Attaching does not work=======================
Attaching an existing database does not work either. Most databases (mdf) are located on the path D:sqldatamssql, but as soon as I press

Attach Databases -> Add

The dialog window appears with the "D:sqldatamssql" path, but it is unable to find any *.mdfs altough THERE ARE .mdfs in this directory. But Express can find databases in the selected installation: "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLData".
Why can't Express see the directory on the D: partition???


What is wrong? Here? Can anybody help me?

View 5 Replies View Related

Sql2005 SSIS - Doesn't Transfer The PKs And Indexes Of Tables

Jul 23, 2007

Hello,



I created ssis package to transfer tables from one DB to another.

However, I don't find the option where I can make that the transfer with the indexes and pks of the tables. in sql2000 I had this option.



appriciate your help.



Kubyustus



View 9 Replies View Related

DTS Doesn't Work Through Job

Sep 15, 2005

I'm pretty new to DTS, so forgive me if this is basic. I created a simple DTS package to run a query and export it to a text file. I can execute the package fine from my workstation through EM, but when I try to execute the job to run the package I get this error:
Error = -2147467259 (80004005) Error string: Error opening datafile: Access is denied.

I think that maybe SQL Agent doesn't have the right permissions to write to that network drive. What should the permissions be?

View 3 Replies View Related

IIF Doesn't Work

Nov 10, 2004

This is probably very simple, but I can't get passed this problem.

I have a report in MS Access that uses info generated by a query. One of the text fields in the query contains either the word 'Select' or the name of a course.
The report should display a space if the value is 'Select', or the actual value of the field in any other case. The field can never contain a null value.

I've used:
=IIf([optVoc1]="Select","",[optVoc1])
in the text box on the report, but this only returns #error regardless of the actual content of the field.

What am I doing wrong?

Regards,

BD

View 5 Replies View Related

Sql Job Doesn't Work

Aug 27, 2004

Hi all,

I create and schedule a SQL job to run every minute to update a table base on certain condition but it doesn't work. Job history says successful every time but the table doesn't get updated.

However if I move it to Query Analyzer and run it under dba, it will work. Thinking that it may have to do with the user the job run as, I then change run as user from self to dba. But still SQL job won't update my table.

Anything about user permission or security that I can check? Or it there any other possibility?

TIA

View 1 Replies View Related

Why Doesn't This Work

Apr 26, 2007

When I run the select its fine but I cannot delete..... i have done this many times and it has worked.... I cannot see the error what am i missing

select
eqnow.empnumber,
eqnow_names.empnumber,
eqnow_names.names
--delete
from
eqnow
inner join eqnow_names
on eqnow.empnumber = eqnow_names.empnumber
where
eqnow_names.names is null



i get this error
Server: Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'inner'.

View 3 Replies View Related

Doesn't Work

Oct 21, 2007



Msg 15123, Level 16, State 1, Procedure sp_configure, Line 78

The configuration option 'user instances enabled' does not exist, or it may be an advanced option.



Valid configuration options are

View 1 Replies View Related

Help! LIKE Doesn't Work!!!

Apr 19, 2008

Hi to all, I'm building (and learn) an application with VB Express. In "edit dataset with designer" I've build this sql query:

SELECT tbl_soggetto.[ID Soggetto], tbl_soggetto_tipo.Tipo, tbl_soggetto.[Cognome/Denominazione], tbl_soggetto.Nome, tbl_soggetto.Indirizzo, tbl_soggetto.CAP, tbl_soggetto.Città , tbl_soggetto.Provincia, tbl_soggetto.[Telefono 1], tbl_soggetto.[Telefono 2], tbl_soggetto.[Telefono 3], tbl_soggetto.[Telefono 4], tbl_soggetto.[eM@il 1], tbl_soggetto.[eM@il 2], tbl_soggetto.Note
FROM tbl_soggetto INNER JOIN tbl_soggetto_tipo ON tbl_soggetto.[ID Tipo] = tbl_soggetto_tipo.[ID Tipo]
WHERE (tbl_soggetto.[Cognome/Denominazione] LIKE '%' + @Testo + '%')


The LIKE doesn't work!
I call the query with Me.griglia.DataSource = Me.TA_tbl_soggetto_ricerca.Search_Cognome(Me.txt_trova.Text.Trim)

But with LIKE '%ABC%' work!

Me.griglia.DataSource = Me.TA_tbl_soggetto_ricerca.Search_Cognome()

Someone can help me? Thanks...

View 12 Replies View Related

SET Doesn't Work

Dec 11, 2006

When I try to install the problem I get the following error.

The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."

The log tells me nothing useful. I can't start the thing manually because after clicking cancel on the error message, the installer proceeds to roll back the installation.

How do I fix this problem?








View 3 Replies View Related

Force Protocol Encryption In SQL2005 Client Configuration Doesn't...

Feb 5, 2007

I am accessing a SQL2005 Express SP1 Server via TCP/IP (all machines fully up to date with windows update). For ease of configuration the Server IP is mapped to an Alias in Native Client Configuration Manager. On the Client Force Protocol Encryption is set to Yes and Trust Server Certificate is set to No. The clients are accessing the DB via SQL 2005 Management studio express and Ms Access 2003 (an access adp front end to the sql database).

As a test i turned off force encryption on the server. A Network trace shows no encryption! Turning on force encryption on the server corrects this.

As a further test I configured the server with a certificate the client doesn't trust. No error is generated by the un-trusted certificate! The only way to generate the certificate error is to enable encryption in the connection properties of each application. Why isn't the Native Client Configuration Manager utility enforcing this???

This brings me on to a second (off-topic problem). In my access adp file, if I enable €œuse encryption for data€? advanced option under the database connection dialog all works as expected (encryption + certificate verification). However, I am programmatically updating the connection in VBA

Application.CurrentProject.OpenConnection "Provider=SQLOLEDB.1;Data Source=AliasName;Use Encryption for Data=True;..."

If I do this no encryption is enabled!!! Access seems to just ignore the encryption statement.

Has anybody got any ideas as to why either of these issues are occurring or if there are any workarounds?

Thanks

Stuart



View 3 Replies View Related

Sum In Subquery Doesn't Work Well

Jun 8, 2005

This is the autogenerated code from the SelectCommand of my DataAdapter, except the red text. This DataAdapter is used to fill a DataGrid. What I want to do, is to calculate the total memory (4 slots) / PC.This code makes the sum of all memory of all PC's together.I'm not sure if the group by clause is needed here ...Me.OleDbSelectCommand1.CommandText = "SELECT PC.ID, PC.Nummer, PC.Netwerknaam, Case_Type.Type AS Case_Type, Processor_T" & _"ype.Type AS Processor_Type, Processor_Snelheid.Snelheid AS Processor_Snelheid, " & _"(SELECT SUM(Memory) FROM Memory, PC, RAM WHERE RAM.PcID = PC.ID AND RAM.GrootteID = Memory.ID)" & _"AS Memory, OS.Naam AS OS, OS_SP.Nummer AS OS_SP, Gebru" & _"iker.Naam AS Gebruiker_Naam, Status.Status, PC.Tagged FROM (Status RIGHT OUTER J" & _"OIN ((((((((PC LEFT OUTER JOIN (RAM LEFT OUTER JOIN Geheugen ON RAM.GrootteID = " & _"Geheugen.ID) ON PC.ID = RAM.PcID) LEFT OUTER JOIN Case_Type ON PC.Case_TypeID = " & _"Case_Type.ID) LEFT OUTER JOIN OS_SP ON PC.OS_SpID = OS_SP.ID) LEFT OUTER JOIN Ge" & _"bruiker ON PC.GebruikersID = Gebruiker.ID) LEFT OUTER JOIN Processor_Snelheid ON" & _" PC.Processor_SnelheidID = Processor_Snelheid.ID) LEFT OUTER JOIN Processor_Type" & _" ON PC.Processor_TypeID = Processor_Type.ID) LEFT OUTER JOIN OS ON PC.OsID = OS." & _"ID) LEFT OUTER JOIN Switchbox_Details ON PC.ID = Switchbox_Details.PcID) ON Stat" & _"us.ID = PC.StatusID) GROUP BY PC.ID, PC.Nummer, PC.Netwerknaam, Case_Type.Type, " & _"Processor_Type.Type, Processor_Snelheid.Snelheid, OS.Naam, OS_" & _"SP.Nummer, Gebruiker.Naam, Status.Status, PC.Tagged"I would like to know how to calculate the total memory for each separate PC.Hope you can help me.

View 5 Replies View Related

HELP! Sp_attach_db Doesn&#39;t Work!

Sep 20, 2000

I had a SQL Server falure. I rebiuld Master and tried to attach my database
with sp_attach_db? but get an error

Location: pageref.cpp:3931
Expression: rowLog.RowCount () == 1 || pPage->IsEmpty ()
SPID: 10
Process ID: 119

Connection Broken

View 1 Replies View Related

Attaching Db Doesn&#39;t Work

Mar 1, 2001

I try to copy a DB from one server to another. On the target server an older version of the DB has been deleted and I now try to attach the new version using "sp_attach_db DBname, Filelocation", but I always get an error "Device Activation error. The physical file name 'D:mssql7dataAgency_log.ldf' may be incorrect"
"Database 'Agency' cannot be Created"

To me it seems that the database is looking for the log files (now deleted).
I've tried forcing a new log file I created using the same locations for the mdfs. I've tried using create a new database and replace the mdf file, but nothing works.

View 3 Replies View Related

Trigger - This One Doesn't Work - Why?

Mar 31, 2003

Hi,

I wanted to create a new trigger, but Enterprise Manager tells me about an "Incorrect syntax near @UpdatedByID, line 28". I double-checked everything, but it still does not work :mad: .

Any hints :confused: ?

TIA,

-Gernot


Here is the statement (line 28 is marked with ***):


CREATE TRIGGER TransferToABII ON [dbo].[CALGeneral]
FOR INSERT
AS
BEGIN TRANSACTION
BEGIN
DECLARE @Event varchar(255),
@BBaseUID int,
@StartDate smalldatetime,
@EndDate smalldatetime,
@Details varchar(255),
@AddressID int,
@ProjectID int,
@UpdatedByID int,
@ActID int,
@EventID int

SELECT @Event = Event,
@BBaseUID = BBaseUID,
@StartDate = StartDate,
@EndDate = EndDate,
@Details = Details,
@AddressID = AddressID,
@UpdatedByID = UpdatedBy,
@ProjectID = ProjectID
FROM INSERTED

BEGIN
EXEC BrainBase.dbo.BB_NEW_CREATE_NoteTask_Ret *** (@UpdatedByID,
@AddressID,
@ProjectID,
@BBaseUID,
@StartDate,
GetDate(),
@Event,
NULL,
NULL,
NULL,
NULL,
@Details text,
@ActID = @ActID OUTPUT,
@EventID = @EventID OUTPUT)
END
BEGIN
UPDATE CALGeneral SET ActID = @ActID WHERE ID = INSERTED.ID
END
END

IF @@ERROR <> 0
BEGIN
RAISERROR('Error occured',16,1)
ROLLBACK TRANSACTION
END
COMMIT TRANSACTION

View 4 Replies View Related

Identity Doesn&#39;t Work

Nov 11, 1999

I'm working with mssql 6.5

I have an primary key column with Identity property.
And at the moment server doesn't insert the proper value to this column.

Error message is following

Msg 2601, Level 14, State 3
Attempt to insert duplicate key row in object 'Spot' with unique index 'XPKSpot'
Command has been aborted.

The datatype of this column is int, and number of rows ~17000.
If I execute select @@identity it returns null.

View 4 Replies View Related

WHERE With An Alias Doesn't Work

Aug 2, 2004

I'm combining first name, last name, middle name, and an ID number together into an alias. Then I need to match that alias with a variable passed to the page (its a search results page). The problem is it claims that there is no table with the name of my alias. Anyone know what I'm doing wrong?

A mockup of the SQL looks like this:

SELECT UserID, Last_Name + ', ' + First_Name + ' ' + Middle_Name + '.' AS name
FROM Table
WHERE name LIKE 'variable%'


Everything looks right with the results, if I take out the WHERE clause it has name displayed properly and joined together with the rest of the data in the results properly.

Thanks in advance for any help that can be provided!

View 3 Replies View Related

Linkserver Doesn't Work.

Oct 12, 2007

I have a query that doesn't work when i use 4 name convention instead of a openquery. The msg is below. Anyone know what is going on?
Both queries are the same but one doesn't work.

-- works
SELECT TOP 1 * FROM OPENQUERY(AS400_PROD, 'SELECT * FROM PPTREASUSA.ORDDET')

-- doesnt work
SELECT TOP 1 * FROM AS400_PROD.S1030Y3M.PPTREASUSA.ORDDET



Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: Unspecified error]
[OLE/DB provider returned message: [IBM][iSeries Access ODBC Driver][DB2 UDB]CPF5715 - File ORDDET01 in library QTEMP not found.]
OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBSchemaRowset::GetRowset returned 0x80004005: ].





http://www.sqlserverstudy.com

View 2 Replies View Related

Sp_send_dbmail Doesn't Work

Jan 17, 2008

hi all,
i made a stored procedure that uses the sp_send_dbmail to send mails. SQL server dislays the message "mail queued" but nothing is recieved

here is the code of the stored procedure i made
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Exams',
@recipients = 'me@domain.com',
@Body_format = 'HTML' ,
@subject = 'Room Preparation' ,
@body='hi there';
so can anyone help with this issue
thanks in advance

View 6 Replies View Related

Drill Through Doesn't Work.

Feb 7, 2007

I have a drill through that passes four parameters. Three are passed from the current selections in that reports parameters and the fourth needs to be the customer name they click on in the body of the report so it's passed as Fields!fieldname.Value. When I click on the customer name, the drillthough fires but the report simply doesn't load. If I remove the parameter from the field clicked on and just pass the three parameters, it goes to the drill through correctly and that fourth parameter just sets to the default for that parameter in that report.

I can then simply check that parameter and select the value from the list that is exactly the same as the value I was attempting to pass it in the drill through and report refreshes correctly.

Whatever it is, is something in the manner that the value is passed in the drill through specifically.

Any ideas?

View 1 Replies View Related

Using SP_ATTACH_SINGLE_FILE_DB Doesn't Work.

Mar 15, 2007

Hello,
I've rescued a MDF and LDF files off a client's old server, and I wanted to attach it to our own, but I can't seem to get the command to work, basically I have these two files, which I've dropped on our server:

C:Program FilesMicrosoft SQL ServerMSSQLDataMYCLIENTNAME_Data.MDF
C:Program FilesMicrosoft SQL ServerMSSQLDataMYCLIENTNAME_Data.LDF

So when I do a
SP_ATTACH_SINGLE_FILE_DB 'somedb','C:Program FilesMicrosoft SQL ServerMSSQLDataMYCLIENTNAME_Data.MDF'

It says the LDF path my be incorrect, and that there's two other files that are missing:
MYCLIENTNAME_LOG (no extension)
extra_log (no extension)

I thought the whole point of the command is that you only need a single file?
Its very hard to go back to the client's old server and try to find these two files, and it doesn't really matter if we loose a bit of data, so long as the bulk of it is available.

Update: I think I've found the answer...its not possible to do this, it really needs all the log files.
Any workarounds?

View 1 Replies View Related

Why Doesn't This DecryptByKeyAutoCert Work?

Jun 25, 2007

This works:



-- authenticator

CREATE FUNCTION [dbo].[cc2_Helper]( @SecretData VARBINARY(256), @cId INT )

RETURNS NVARCHAR(50)

WITH EXECUTE AS 'DBO'

AS

BEGIN

RETURN convert( NVARCHAR(50), decryptbykeyautocert( cert_id( 'cert_SecretTable_SecretData_Key' ), null, @SecretData, 1, convert(varbinary, @cId) ) )

END

go

CREATE VIEW [dbo].[cc2View2]

AS

SELECT CardID as CardID, [dbo].[cc2_Helper](CardNumber, CardID) as CardNumber FROM [dbo].[cc2]

go

GRANT SELECT ON [dbo].[cc2View2] TO [user_low_priv]





This doesn't:



-- auth2/view3

CREATE FUNCTION [dbo].[cc2_Helper2]( @SecretData VARBINARY(256), @vBin VARBINARY )

RETURNS NVARCHAR(50)

WITH EXECUTE AS 'DBO'

AS

BEGIN

RETURN convert( NVARCHAR(50), decryptbykeyautocert( cert_id( 'cert_SecretTable_SecretData_Key' ), null, @SecretData, 1, @vBin ) )

END

go

CREATE VIEW [dbo].[cc2View3]

AS

SELECT CardID as CardID, [dbo].[cc2_Helper2](CardNumber, convert(varbinary, CardID)) as CardNumber FROM [dbo].[cc2]

go

GRANT SELECT ON [dbo].[cc2View3] TO [user_low_priv]



WHY? Note that the conversion to VARBINARY was moved from the call to DecryptByKeyAutoCert to the call to cc2_Helper2. That is the only change...



But if I declare @vBin as VARBINARY(256) then it does work! Guess I'm a little confused on declaring vars...anyone can elucidate? Thanks.

View 1 Replies View Related

SQLDS Doesn't Work Well With Uniqueidentifier ?

Dec 25, 2005

In the Data Source Wizard the "insert,delete,update" advanced options are greyed out.

The table's PK is not an identity, but a uniqueidentifier.

View 2 Replies View Related

STUMPED: Why Doesn't This Procedure Work?

Jan 16, 2006

I have been looking at this for over a day now. I cannot see why this procedure does not work, its so simple.
No matter what happens it always returns 0. If it locates a record, it doesnt update it, yet it still returns 0.
It should not be returning 0 if its not updating so I can't figure out why it does.
Why does this always return 0?
[pre]Create Procedure CreateNewCategory @title nvarchar(100), @description nvarchar(1000), @displayOrder intAS DECLARE @Result as int
IF EXISTS(SELECT categoryTitle FROM categories WHERE categoryTitle = @title) BEGIN  SELECT @Result = 1 ENDELSE BEGIN  INSERT INTO categories(categoryTitle, categoryDescription, displayOrder)  VALUES(@title, @description, @displayOrder)   /* If no error was encountered, 0 will be returned. */  SELECT @Result = @@Error ENDGO[/pre]
Thanks!
 

View 2 Replies View Related

LOAD TABLE With UNC Doesn&#39;t Work

Mar 28, 2000

Since I have to go across the network, I'm trying to use the UNC. However, this won't even work when I'm using the UNC to point to the server on which this is run. I'm trying to restore a single table on 6.5. What is the obvious piece that I'm missing?

This works.

LOAD TABLE address
FROM DISK = 'd:MSSQLackupDBBackup.DAT'
WITH source='address'


This doesn't.

LOAD TABLE address
FROM DISK = 'server1d$MSSQLackupDBBackup.DAT'
WITH source='address'

View 2 Replies View Related

Upgrade And Now Mail Doesn`t Work

Sep 4, 1998

Hello, I upgraded to Beta 3 and now mail isn`t working(I hate mail!) I found 2 error messages. One when trying to add an operators email id and the other when I try to "test" mail under server properties.

- Unable to start a mail session on the server with this mail profile.

- no mail profile defined.

The account that I am using is used for all our SQL Servers and was working on this server on 6.5 before the upgrade. I have checked the new SQLServerAgent service and it`s using the correct account.

Any help would be appreciated.

And to all you that are off for a long Labor Day weekend...I`m jealous!

View 1 Replies View Related

Xfragent Doesn&#39;t Work After Upgrade To 7.0

Sep 5, 2000

Hi All,

I just upgraded my servers from 6.5 to 7.0,
however, all the transfer jobs that was using xfragent.exe
does not work anymore. Any idea? Please help.

Thanks,
Richard

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved