I was running a trace capturing all errors and SQL. Had a bucket of
error 208's (invalid object name). Found the SQL that caused it - an
SP.
Ran the sp by hand, no messages come up - error 208 logged in the
trace.
Couldn't work it out. Then noticed stats missing on one column.
Created the stats manually - and suddenly the 208 error stops. Wtf?
Is this predicted/expected behaviour? Just me being a noob?
Thought I'd just share that. ta ;)
SQL2k, sp3a, w2k server.
Can anyone help me out with this statement. I am trying to insert data into table a from table b where table a and table b have three fields which are the same, and I keep getting a missing operator error. Thanks in advance.
Update test SET officeaddress = b.address, officeaddress2 = b.address2, officecity = b.city, officestate = b.state, officezip = b.zip, officephone = b.phone, me = b.me, ims = b.ims FROM test a INNER JOIN A751P b on b.firstname = a.firstname AND b.lastname = a.lastname AND b.state = a.state
After loading the BCP files that are created during the trigger/reporting events I've noticed that the data in the table is missingrecords. I've also noticed that the missing records (records in thetable but not in the BCP out files) seem to occur in contiguousblocks. Since the complete set of records exists in the table, Iassume this points to an issue in the way the TableUpdate script/Triggers interact with the system. But i tried to take out the bcpprocedure, do test on trigger, then no data missing, So, I think theproblem is still on bcp part. Could you help me with that?CREATE TABLE [EventUpdate] ([id] [int] NOT NULL ,[eventid] [int] NOT NULL ,[sequenceid] [int] NOT NULL ,[UpdatePass] [int] NULL) ON [PRIMARY]GOcreate trigger trgEventUpdate on EventLog For Insert,Update asinsert into EventUpdate (id,eventid,sequenceid) select ins.id,ins.eventid,ins.sequenceid from inserted insbcp script:bcp "select a.* from w..eventlog a, w..eventupdate b wherea.eventid=b.eventid and a.sequenceid=b.sequenceid and b.eventid<>-1and b.sequenceid<>-1 and b.updatepass=1" queryout 30sec-%TFN_NOW%.wrk -U <userwithaccess-P <password-S doserver -f EventLog.fmtThanks in advance for your reply!
I am trying to retieve a value from teh database and add one to it, then update the database with thenew value before redirecting to a page.
I am recieving this error and don't know why, i have the following coed below.
Dim objReaderQ as OleDBDataReader
Dim strSQLRead As String Dim objCmd As New OleDbCommand
strSQLRead ="Select Quantity from tblCart Where (Productid=" & intProdidHold & ") AND (Cartid='" & strCartid & "')"
objCmd = new OleDbCommand(strSQLRead, objConn) objReaderQ = objCmd.ExecuteReader()
if objReaderQ.Read() 'update quantity by 1
Dim i as integer i = objReaderQ("quantity") i = i + 1
objReaderQ.Close()
Dim strSQLQuantity as String = "INSERT INTO tblCart (Quantity) VALUES (@quantity) WHERE (productid=" & intProdidHold & ") AND (Cartid='" & strCartid & "');"
Dim objCmdQuantity As New OleDbCommand(strSQLQuantity, objConn)
objCmdQuantity.Connection = objConn
objCmdQuantity.Parameters.Add("@quantity", OleDbType.VarChar, 255) objCmdQuantity.Parameters("@quantity").Value = i
objCmdQuantity.ExecuteNonQuery() ' <--- Error Is Occuring On This Line
Response.Redirect("ViewBasket.aspx")
end if
I really can't see what is wrong as i have placed the semi colon it wanted at the end of the string.
While setting up replication to another server my other replications came with the error could not find sp_MSins_<destinationtabel> Error number 2812. Is there anyway I can rebuild this stored proceduire or what is the easiest way to start synchronizing again, I can't drop the destination database because the amount of data to replicate is too much
Hi - I can get this to work in SQL Server - but when also trying to makethe application compatible with MS Access I get an error:Select tblfaqnetgroups.group_name from tblfaqnetrolesInner Join tblfaqnetgroups ON tblfaqnetroles.group_id =tblfaqnetgroups.group_idInner Join tblaccess ON tblfaqnetroles.user_id = tblaccess.user_idAND tblaccess.user_id = 1The error in Access is:Syntax error (missing operator) in query expression'tblfaqnetroles.group_id = tblfaqnetgroups.group_idInner Join tblaccess ON tblfaqnetroles.user_id = tblaccess.user_id'Any help would be much appreciated,*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
Report X passes all it's parameters to Report Y via a "jump to report". Report Y then populates a select box based on the parameters passed to it. The user selects one of these values and clicks "View Report". This works perfectly in the development environment. But when I deploy it to the server I keep getting an error when I click the link that jumps to Report Y.
Here's the error: "The 'B' parameter is missing a value"
The problem is.. I don't want to pass the B parameter to Report Y. I want the user to select this from a list. I'm very confused as to why this would work in the development envionment but not when deployed.
Here I am creating a temp table with $ summations that I can later join with an employees table that I'm dumping into a flat file.
select
e.employee_no, sum(p.fit) as sumfit, sum(p.fica) - sum(p.medicare) as sumfica, sum(p.medicare) as sumedic, sum(p.fit_earnings) as pearnings, sum(p.fit_earnings) as tearnings
into #earntable
from employees as e left outer join pay_summary as p on e.employee_no =p.employee_no
where e.employee_no = 817 and dateadd(d, 0, datediff(d, 0, p.dated)) between '20061231'and '20070401'
group by e.employee_no
select * from #earntable
When I go to look at the contents of the #earntable with the above select, I get this:
ODBC error 214 Procedure expects parameter '@handle' of type 'int'. (42000)
The datatypes I'm trying to select into the temp table are all numeric 12 except employee_no char 10.
Hi,Is there anyone encountered this error before & how it is being resolved?[Microsoft][ODBC SQL Server Driver][SQL Server]Missing end comment mark '*/'The error pops-up when I was running a DTS Import/Export from a SQL server(source) to another SQL server (destination) residing on a differentmachine. I'm copying all tables, views, & stored procedures of a database.Thanks for any input.Regards,Maricel
Hi, in my app I connect to and read from a Sql Mobile database numerous times. Eventually and inconsistently my app will no longer be able to access the database and a SqlCeException is returned with native error 25123. This error translates to: "A SQL Mobile DLL could not be loaded. Reinstall SQL Mobile. [ DLL Name = sqlceqp30.dll ]". I've seen similar (and unsolved) problems involving RDA/replication, but I am not using any of that in my program. It simply connects to database, queries and retrieves data, then closes the connection. I am properly disposing of all SqlCE objects.
I'm not sure what the error really means. Once the program gets this error it is never able to access the database again until the program is restarted. I am still able to connect to that database from the Query Analyizer even after the program gets the error and hasnt been restarted (meaning if the program tried again after the QA's success it will still have same error).
Common suggestions for the similar RDA error are to put the initializion at the beggining of the program. In my case the database connection will succeed several times before the error occurs.
anyone have similar issue where you are not using replication but get error 25123?
When trying to deploy a package using the deploy wizard, following error is received: ===================================Could not save the package "H:SSISRSlogRSExecutionLog_UpdateinDeploymentRSExecutionLog_Update.dtsx" to SQL Server "xxxxxxxxxxxxxxxxxxxxx". (Package Installation Wizard)===================================No description found------------------------------Program Location: at Microsoft.SqlServer.Dts.Runtime.Application.SaveToSqlServer(Package package, IDTSEvents events, String serverName, String serverUserName, String serverPassword) at Microsoft.SqlServer.Dts.Deployment.DtsInstaller.SavePackageToSqlServer(WizardInputs wizardInputs, String packagePassword, Boolean bUseSeverEncryption, String serverName, String userName, String password, String packageFilePath, List`1 configFileNames) at Microsoft.SqlServer.Dts.Deployment.DtsInstaller.InstallPackagesToSqlServer(WizardInputs wizardInputs)
Hi, Please could someone assist - the above error occurs. This is my code: Protected Sub btnReport_Click(ByVal sender As Object, ByVal e As System.EventArgs) ' Response.Redirect("CrystalreportTEST_Print.aspx?C_id=" & ddlCompany.SelectedValue) Dim myConnection As New OleDbConnection(connString) Dim Str As String = "SELECT clientid,company FROM Client WHERE company =" & ddlCompany.SelectedItem.Text Dim cmd As New OleDbCommand(Str, myConnection) Dim ds As New DataSet Dim da As New OleDbDataAdapter(cmd) da.Fill(ds) Label7.Text = ds.Tables(0).Rows(0).Item("clientid") ' Response.Redirect("CrystalreportTEST_Print.aspx?C_id=" & ds.Tables(0).Rows(0).Item("clientid")) End Sub Thank you in advance
I have a package in which I have enabled "Package Configuration".
When I run the package i am sure that it reads the configuration file and executes the package correctly.
However if I remove the configuration file, the package still executes correctly with the settings which were used at the time of development.
I have event handlers for OnError and OnWarning and both these are NOT invoked.
IMO, this is incorrect behavior because if a package has been configured for "package configuration, then we should atleast have a warning generated that SSIS did not find the configuration and it would execute the package with hard coded values (from the time of development).
Is there any work around for this? how can I make SSIS warn me if the config file is missing for a package which was configured for package configuration?
on executing the below query i am getting the following error
ERROR: Errors in the back-end database access module. Nested table keys in a SHAPE query must be sorted in the same order as the parent table. The nested query may be missing an ORDER BY clause.
even though the order by clause is presenet in the nested query
SELECT t.[ProductId], Predict ([Association].[Product Basket],3) From [Association] PREDICTION JOIN SHAPE { OPENQUERY([Adventure Works Cycle MSCRM], 'SELECT DISTINCT [ProductId] FROM (SELECT ProductId FROM ProductBase) as [Product] ORDER BY [ProductId]')} APPEND ({OPENQUERY([Adventure Works Cycle MSCRM], 'SELECT [ProductId] FROM (SELECT ProductId FROM ProductBase) as [Product] ORDER BY [ProductId]')} RELATE [ProductId] To [ProductId] ) AS [Product] AS t ON [Association].[Product Id] = t.[ProductId] AND [Association].[Product Basket].[Product Id] = t.[Product].[ProductId]
Hello: I am implimenting the creation of sequence numbers .I use an insert proc on a table that generates the numbers using an identity field: procedure usp_createidentity
begin transaction
insert into [tblOrderNumber] with default values
rollback ' done so no records in this table
select @OrderNumber = scope_identity()
I call this from another proc that inserts values into my order table:
procedure usp_Insert @OrderNumber int as
SET XACT_ABORT ON;
BEGIN TRY
BEGIN TRANSACTION
EXEC usp_GetNewOrderNumber @OrderNumber = @OrderNumber output INSERT INTO [dbo].[tblOrder] ([OrderNumber]) values (@orderNumber) ' inserts value from other stored proc
COMMIT TRANSACTION
END TRY
BEGIN CATCH
if (XACT_STATE() = -1)
ROLLBACK TRANSACTION
else
if (XACT_STATE() = 1)
COMMIT TRANSACTION END CATCH
Here is the problem. When I run usp_Insert I get the following: Error 266 Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0.
This refers to the usp_GetNewOrderNumber that is called inside the other proc as shown above.
The problem does not happen if I put each statement in usp_Insert in its own try/catch. transaction statements.
Maybe it has something to do with the rollback call in the usp_getneworder.
What do I need to do to get rid of this. problem and still run these within one try/catch trans statement set.
Two of my databases are still listed under the "Database" folder in SQL Express, yet all objects are now gone. Tried detach/attach and says it works OK - yet no tables, etc.
The odd thing is that I CAN access the tables from Visual C++ Express, and all looks well (data, etc).
When I look at Properties for one of the DBs, and then click on "View Connection Properties" under the "Options" section, the error message pops up:
"Cannot show requested dialog.---------------------------- ADDITIONAL INFORMATION:
Could not load file or assembly 'file:///C:Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDESqlManagerUi.dll' or one of its dependencies. The system cannot find the file specified. (mscorlib) ".
Also still throwing an error upon startup, "Unhandled exception has occurred in a component in your application. If you click continue the application will ignore this error...Cannot create a stable subkey under a volatile parent"
Clues?
Thanks
S
PS It would help to enable right click Copy and Paste in this forum -
I'm trying to import XML Data from a .xml file and then running openXML command to insert relevent data into SQL server 2005. First I'm importing XML records with help of Script Task(In SSIS) in batch of 1000 records in temporary String n passing this to Stored procedure ,which parses XML String with help of "sp_xml_preparedocument" .This SP it gives following error..
"An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name."
I'm clueless about error,can some someone guide to workaround?
Does anyone know of a tried and tested method for collating stats from SQL Server databases. I have a no. of databases hosted on a single server, servicing a no. of applications. I need to find out the following: CPU usage of each application on the server Memory usage of each application etc
Has anyone noticed a performance improvement during trading hours when they replaced sp_updatestats with UPDATE STATISTICS FULLSCAN in their nightly maintenance? Or is it negligible?
Basically i am from Oracle background. I need some help. In oracle we gather the statistics of a table as SQL> analyze table <tname> compute statistics for all indexes;
or SQL> EXEC DBMS_STATS.gather_schema_stats('SCOTT')
I want to gather statistics for a particular database say."pubs" for example.
Hi there...How do I get to extract info like, current Database logged in user orgeneral stats like, ram usage... etc etc etc into a form if I use MicrosoftAccess 2002 for my forms application?Thanks in advanceRudi
COuld someone tell me if its possible to get hold of stats about allDatabases on a SQL Server.The sort of things I would like areName of DBLocation of DBSize of DBLocation of LogfileSize of DBOwnerUsers Authorised to access the DBIs there something that can do thisThanksDerrick
Hello all- Is it possible to reset the values of DMV stats/counters without restarting the SQL service? I'm looking for something more than dbcc freeproccache...more along the lines of index_usage and some of the OS DMVs.
Hi all, I have an dtsx (SSIS) for "clone" manually Sql server database to another.
How I copy all stats from one database to another ? I have problem with "auto stats".
When I try DROP statitics for auto stats I get this error:
No se puede DROP el índice 'dbo.ACTIVIDAD_PROVEEDOR.PK_ACTIVIDAD_PROVEEDOR'. No es una colección de estadísticas.
Cannot DROP index 'dbo.ACTIVIDAD_PROVEEDOR.PK_ACTIVIDAD_PROVEEDOR'. Not statitics collection.
What can I do ??
-- Get Stats list SELECT '[' + SCHEMA_NAME(tbl.schema_id) + '].[' + tbl.name + ']' AS [Table_Name_With_Schema], '[' + st.name + ']' AS [Name], '' + SCHEMA_NAME(tbl.schema_id) + '.' + tbl.name + '' + '.' + st.name + '' AS [Estadistica] FROM sys.tables AS tbl INNER JOIN sys.stats st ON st.object_id=tbl.object_id ORDER BY [Table_Name_With_Schema] ASC,[Name] ASC
Thanks in advance, any help will be appreciated, regards, greetings
Hi all, I have an dtsx (SSIS) for "clone" manually Sql server database to another.
How I copy all stats from one database to another ? I have problem with "auto stats".
When I try DROP statitics for auto stats I get this error:
No se puede DROP el índice 'dbo.ACTIVIDAD_PROVEEDOR.PK_ACTIVIDAD_PROVEEDOR'. No es una colección de estadísticas.
Cannot DROP index 'dbo.ACTIVIDAD_PROVEEDOR.PK_ACTIVIDAD_PROVEEDOR'. Not statitics collection.
What can I do ??
-- Get Stats list SELECT '[' + SCHEMA_NAME(tbl.schema_id) + '].[' + tbl.name + ']' AS [Table_Name_With_Schema], '[' + st.name + ']' AS [Name], '' + SCHEMA_NAME(tbl.schema_id) + '.' + tbl.name + '' + '.' + st.name + '' AS [Estadistica] FROM sys.tables AS tbl INNER JOIN sys.stats st ON st.object_id=tbl.object_id ORDER BY [Table_Name_With_Schema] ASC,[Name] ASC
Thanks in advance, any help will be appreciated, regards, greetings