I know that the transaction log/ldf file fills up and grows and that I can see how full it is by running:
DBCC SQLPERF(logspace)
Is there a corresponding command to check on the status of the data/mdf file?
Why I'm interested:
I'm troubleshooting a simple .NET app that uses SqlBulkCopy to import data. Normally this works fine but ...
The short story is I have a SQL Server DB with varchar fields instead of datetime (don't ask, it's a long story and can't be fixed). Somehow we've recently been getting weird / random characters inserted in these fields instead of what should be there (either NULL, '' or YYYY-MM-DD). Something like this: '?+x' with high-bit ascii charact...
How would I update data in a table in a separate database based on the records in the current database?
For instance I want to update the field "status" in the database called "database_old" with the value contained in the database "database_new" . My current data exists in the database "database_new". I want to only update records in ...
I'm trying to set the value in one table to the sum of the values in another table. Something along these lines:
UPDATE table1
SET field1 = SUM(table2.field2)
FROM table1
INNER JOIN table2 ON table1.field3 = table2.field3
GROUP BY table1.field3
Of course, as this stands, it won't work - SET doesn't support SUM and it doesn't support ...
trying to remove the nested loop in the execution plan of a query i have (mssql 2005). have the following table:
TxnID bigint
CustID bigint
col1 varchar(4)
col2 varchar(4)
col3 varchar(4)
TxnCurrency char(3)
TxnAmt money
TxnDate datetime
-- query 1
SELECT CustID, TxnCurrency, SUM(TxnAmt) AS TxnAmt
FROM table
WHERE TxnDate >= @dat...
Hello.
My question is a little subjective and might be a little unclear since I don't know where in the UDF crashes, or whether the error is caused in the function itself or from other resources using a column in this table.
Let me just tell you the story.
I had a function (that used as a computed-column for QuoteItemsGroupFeature.Sal...
Here's my SQL statement:
SELECT DISTINCT a.*
FROM OWU_Nomination as a,
Merchants as b WHERE a.CallFlag = 'False'
AND a.nominatedDate < DateAdd(hour, -24, getdate())
AND a.email != (SELECT c.Email from Members as c where c.MemberID = b.MemberID)
The problem here is that the sub select after a.email != returns multi...
Hello!
I have a table called Item.
I have a view called ItemView, that returns all the column of Item + one more aggregated column, that I want to be read only.
I need to use it in Entity Framework, and I don't know how I should use it, since when insert the view in the designer, all the fields become entity-keys, besides no relations...
I want to write a query kind of like this:
CREATE PROCEDURE DupFinder
@FirstName varchar(20),
@LastName varchar(20)
AS
SELECT CustId
FROM Cust c
WHERE [dbo].[fn_MatchConfidence](@FirstName + ' ' + @LastName,
[dbo].fn_createCustHash (CustId)) > .8
Running the fn_MatchCondifence User-Defined Func...
is it nesessary to add a default value to int,bit,datetime... fields? what's the benefit of having a default value?
...
I have downloaded MS SQL Server Report Builder 3.0 CTP recently. I am bit confused and have following questions:
Can I use Report Builder 3.0 with MS SQL server 2008 Express with Reporting services (NOT MS SQL Server 2008 R2 CTP)?
Is there any time limit is attached with usage of Report Builder 3.0 CTP, as it is CTP version? Generally ...
hi there,
I have ajax ReorderList in my wep page,and I get the data from SQL Server.
I would like to add table cells dynamically according to number of records and show the result side by side until for example I have five data in a row and then move to the next row,
any idea?
Thanks in advance
...
I'm familiar with the concept of using partitions in Oracle as a technique to pubish incremental additions to tables (in a DW context).
(like this example)
For example. a daily snapshot for a data mart fact table is loaded behind the scenes in a partition within a table. for example with date as the partition key (1 partitioned table...
Hello people,
I want to convert a varchar value that iI set up to a date time value. I want to load rows of a database into another database, but conversion is not going well.
This is my query:
select Krant
, cast(jaar as varchar(4))+'-'
+RIGHT('0'+cast(maand as varchar(2)),2)+'-'
+RIGHT('0'+cast(dag as varc...
Hi
Can somebody explain me the difference between Temp table and table variable in SQL server 2005?
...
SELECT
SLTR_COMP_CODE,
sltr_ldgr_code,
sltr_slmast_acno Acno,
SUBSTRING(sltr_slmast_acno, 1, 1) category,
ISNULL(SUM(CONVERT(FLOAT, sltr_tran_amt - ISNULL(sltr_matched_amt, 0))), 0) Net_Bal,
SUM(CONVERT(FLOAT, CASE DBO.glas_agewise_analysis(CONVERT(DATETIME, '2009-04-04', 103) - FLOOR...
I have a database table which records all field changes in all database tables which are mapped to Entity Framework Entities (via SQL Server triggers).
I am building a service which outputs these field changes to the client.
However, the client needs the EF-Entity object and property names and not the database table and field names.
F...
When I'm looking round a SQL Server database I often want to interactively retrieve a simple list of column names for a database table (no data type information etc., just the names) using sqlcmd.
I can do this:
EXEC sp_columns @table_name = 'tablename'
which gives me much more than I want and wraps in a command prompt to the extent ...
I have a table that has an ntext column defined as [value1] [ntext] NOT NULL. I want to add another ntext column to this table that is basically a copy of this column's values (they don't need to stay in sync). To do this, I am using the following SQL:
ALTER TABLE [table] ADD [value2] [ntext] NULL
UPDATE [table] SET [value2] = [value1]
...
Hi,
Consider that I am having a table named A. In it I am having only one column named marks.
It has some duplicated values. How can I delete the duplicate values without temporary table.
And the table should contain one of the duplicated values.
...