Hi, I've read that a SQL Server Express database is limited to GB. If I have a database with about 120 tables which store only simple datatypes (int, money, datetimes, varchar, etc.), no blobs or large files, how can I estimate the amount of data or number of rows it can hold before it runs out?
Hi, I was trying to run an insert statement which has subquery, But it is returning the error like this.. Subqueries are not allowed in this context. Only scalar expressions are allowed. -------------- Is there a way to reparse the insert statement without have to assign the subquery to a temp value and insert it? thanks.. Here is my SQL.. insert into admincriteria values (nextID,(select id from nodetable where description like 'Example - Quality Analytics'),8071,2,'Failures by Customer',2,0,0)
I have a ordersystem with repeating orders. Each order has a orderline with a frequency and a intervaltype (day, week, month and so on) for indicating how often a task should be done.
When an task/job is done, an equivalent receipt with receiptlines is generated.
When a new job/task should be suggested, it has to calculate the shortest next intervallength for each repeating orderline. This intervallength must then be added to the date of the last receiptline.
I want to to this all in a SPROC. My result should be the one next orderline that should be carried out with a date for when this is.
RESULT OrderID TaskID TaskDesct EstDate 5000 GETGROCERIES Pick up groceries for miss Lama 19.12.2003
************************************************************************ Is this possible to do all in a SPROC and not having to do any in .NET (which this is developed in), and can you help me with some ideas? ************************************************************************
To se my starting point, se the diagram at: http://www.promotion.no/div/diagram.gif
My mind is stuck and this is so far I've reached:
ALTER PROCEDURE dbo.GetNextOrders AS
CREATE TABLE #Interval ( ivID int IDENTITY(1,1), ivTaskID char(20), ivTaskDescr nvarchar(200), ivHour int )
INSERT INTO #TemporaryTable
SELECT RepID, RepIntName FROM RepeatInterval
SELECT InvoiceDetails.iID, InvoiceDetails.ReceiptID, InvoiceDetails.OrderID, InvoiceDetails.TaskID, InvoiceDetails.TaskDescr, InvoiceDetails.DateRegistered FROM InvoiceDetails LEFT OUTER JOIN Orders ON InvoiceDetails.OrderID = Orders.OrderID WHERE (Orders.DateStart < GETDATE()) AND (Orders.DateEnd > GETDATE() OR Orders.DateEnd IS NULL)
I would like to ask some help for estimating necessary hardware for a database, I can tell you about usage profile the following:
- 2 tables, approximately 100.000 records, the tables joined in 1:1 relation, one record is approximately 500 bytes long - typical scenario: - select what returns 1 or zero record - if it returned 1 record an update performed on this record - the event logged in a third table (one insert) - this typical scenario needs to run 100-300 times in every second
Can you tell me any advice on sizing of hardware for this? We can rely on a well designed database structure (proper indexes, etc...)
I was having interesting discussion on estimation of log file with a fellow collegue who happens to be quite knowledgable as well.
He told me if we identify the most frequently hit tables for a database and then (sum their sizes * 1.5) for OLAP we get rough estimate for disk space to be allocated for log file.
I have a 2.5TB database that we need to run checkdb on. Is there a formula to figure how log it would take with no options? Doing research, it appears the we are stuck with doing the PHYSICAL_ONLY due to time constraints.
My client's website database is hosted by a third party. I need to alter one of the column definitions for the largest table in the database. Unfortunately, the transaction log fills up if I try to alter the table. I've done all the usual stuff like truncating the log, etc., but the simple fact is that the operation requires more log space than we have available. Therefore, we need to purchase additional disk space for the database. What I'm looking for is a way to roughly estimate how much log space will be required to alter this table so that we purchase enough but not too much additional space. The table has an identity primary key and 4 other single column indexes: one int, one datetime and two varchar(30) columns. Any suggestions? Thanks in advance.
As in title. Is there any tool? I'm asking beceuse, I have some big bases, and processing may take a lot of time (at least few hours), and I'll be glad if it's possibility to know estimate time before query runs. I'm using MsSql 2005 Developer edition.
I need to estimate the effort required in writing some SSIS packages. Could anyone provide some pointers to the various factors (E.g. number of tables, source, etc.) which influence the effort estimate for SSIS packages?
i need to full-text index a table so that i can easily search the text fields of that table.. the table has about 21,000 rows, and i was wondering how long it might take to full-text index it?
I've been asked to put together an estimation for the performance impact that replication would have on our database server during a particular operation. I know that this depends on a lot of different factors, including:
* Number of articles being replicated * Types of articles being replicated * Number of DML transactions that would result in delivery of replicated data
writing the query for the following, I need to collapse the continuity. If the termdate for an ID is one day less than the effdate of the next id (for the same ID) i need to collapse the records. See below example .....how should i write the query which will give me the desired output. i.e., get min(effdate) and max(termdate) if termdate is one day less than the effdate of next record.
I have a sql select statement, then I have a datareader and I'm trying to loop through that reader and insert a record into another table each time until there are no more records in the loop. I'm not sure how to do this though without using 2 datareaders. Please help. Thanks 1 ' Retrieve Data from database based on selections chosen in ListBox 2 Dim cmdCommittee As New SqlCommand("Select * from committees_tbl where committee_id in" & _ 3 "(" & strCommitteesRemoveLast & ") order by committee_name", conn_Insert) 4 5 ' setup a datareader 6 Dim drCommittee As SqlDataReader = cmdCommittee.ExecuteReader() 7 8 9 ' Loop through datareader and insert rows 10 ' into the xref_person_committees_tbl 11 While drCommittee.Read() 12 Dim strCommitteeName As String = drCommittee("committee_name") 'retrieve committee_name from datareader 13 14 ' Create a sql string 15 Dim strAddCommittee As String = String.Empty 16 strAddCommittee = "Insert into xref_person_committees_tbl (committee_name) values ('" & strCommitteeName & "')" 17 'Response.Write(strAddCommittee & "<br>") 18 19 ' Create a sql command to process the insert 20 Dim sqlAddCommittee As New SqlCommand(strAddCommittee, conn_Insert) 21 Dim drNewCommittee As SqlDataReader = sqlAddCommittee.ExecuteReader() 22 23 24 25 26 End While 27 ' ----------------------------------------------------------------------------------- 28 29 drCommittee.Close()
I want to pass the string "select @@servername" in the print statement, it throws error as:=
Msg 1046, Level 15, State 1, Line 3 Subqueries are not allowed in this context. Only scalar expressions are allowed. Msg 1046, Level 15, State 1, Line 28 Subqueries are not allowed in this context. Only scalar expressions are allowed.
declare @account_name nvarchar(400) = 'Mail Account'; IF exists (select * from msdb.dbo.sysmail_account where name = @account_name) PRint 'Database Mail Account ' + quotename (@account_name) + 'is already setup in the Server:= ' + (select @@servername);
I mean why such restriction? In such queries results will be only 1 so it does not violate the SET operation. correct??
I want to put some trace in the a UDF, so I put print in the function. IT gave error. Can anyone please explain why this happen. But this work with SPs.
Could someone please tell WHY it is not allowed to use the following construction in a stored procedure!?
AS IF @taxparent = 0 THEN SET @taxparent = NULL IF @museum = 0 THEN SET @museum = NULL IF @collection = 0 THEN SET @collection = NULL SELECT ID, SpecimenNr, ScientificName, Locality, Taxon FROM QueryView
I get the following error messsages:
Msg 156, Level 15, State 1, Procedure DynamicQuery, Line 9Incorrect syntax near the keyword 'THEN'.Msg 156, Level 15, State 1, Procedure DynamicQuery, Line 10Incorrect syntax near the keyword 'THEN'.Msg 156, Level 15, State 1, Procedure DynamicQuery, Line 11Incorrect syntax near the keyword 'THEN'
I am using the SQLEXPRESS database, and connect from to locations:
Windows Service ASP.NET web application.
whenever I start the windows service I get the error: Cannot open user default database. Login failed. so I am going to visual studio and close the connection. then I close the web browser, and the windows service succeed connect to database. but then, after windows service is connected, I open the web browser application and fails to login because the login system using the same database of windows service, and since the connection is being used by windows service, login is impossible.
Do you know how I can allow 2 connections at the same time for the same database? what are the risks to do that? and how do I handle this risks. thanks alot
Can anyone tell me what is the maximum number of rows that I can code in a T-SQL step if I want to include this in a job? I do not want to use stored procedure for certain task, so I want to put the same code in a T-SQL step. Thanks! Sheila.
Inserting info into a table, where one of the columns meets a certain criteria.
insert into employee (/*emp_id,*/ fname, lname, start_date, dept_id, title, assigned_branch_id) values (/*null,*/ 'Michael', 'Smith', '2001-06-22', (select dept_id from department where name = 'Administration'), 'President', (select branch_id from branch where name = 'Headquarters'));
But I'm getting this error:
Msg 1046, Level 15, State 1, Line 5 Subqueries are not allowed in this context. Only scalar expressions are allowed.