checkdb job running over 3 days now
Hi guysThe following statements have been running for 3 days and 21 hrsUSE [WSS_Logging] GO DBCC CHECKDB(N'WSS_Logging') WITH NO_INFOMSGS GOThis is the box we're running: Microsoft SQL Server 2012...
View ArticleGet values for some columns in trigger
I have INSTEAD OF TRIGGER when insert into table. The reason is that I have to get the value for some columns from other tables, before insert (or i will have to update after insert) example: If...
View ArticleSql query ? left outer join and sum ?
Hello I have below query. there are Same records if i dont use SUM. so when i use sum, i do sum same records again. How can i sum only records in LG_031_01_STFICHE AS STFIC ?SELECT...
View ArticleSQL SERVER 2012 - MEMORY
Hello Currently I have a server with Windows Server 2008R2, SQL Server 2012, 15k SAS disks RAID 10 only to the bank, the disks for the OS station in another RAID, and use RAID controller, the server is...
View ArticleBasic transaction log question - example of use
Say I was going to update 1000 records in a single table. As SQL was processing these records and before actually committing the changes, these updates would be written to the transaction log. Also...
View ArticleStatement to Create a table dynamically
Can anyone give me a statment to create a table? I want to create a statement to load a varying number of columns into a table. How can I do this? The threads are not quite getting it for me.
View ArticleSearch All Databases on Server for a String in Particular Table Fields
Objective: Search for strings in several specified columns in various tables in all databases on a server.First, I need to find the strings I will be searching for. I think this is a two part...
View ArticleT- SQl script to allocate certain tables to a new filegroup in SQL server 2012
Hi All,I am looking for T- SQl script to allocate certain tables to a newly created filegroup in SQL server 2012
View ArticleValidating records
I have Table_A in which data is imported from text file .. Table_AEx:SID State ShortName Description UniqueId Year10001 VA Nut This is NUT 10010101 200110001 PA Com...
View ArticleMS MSQL 2012 Server Event Type How to?
Hi all,How to use sql event type? Please help me! :)I have a table:CREATE TABLE LendingLog ( LendingLogId INT IDENTITY(1,1) PRIMARY KEY NOT NULL, EventDate DATETIME NOT NULL, LendingLogEvent Event...
View Articlehow to use ' in sql
i want to insert text like this in tablemy team (private issue,don't have time,personal)how to do it for don't,its not working properly
View ArticleHow to compare value of Column A with value of Column B for all rows having...
Hi all,I am using SQL Server 2008 R2 and have a temp table with 3 columns: PersonID, EffectiveDate, and ExpirationDate. For each PersonID there are multiple rows with different values for the...
View ArticleInsert from one server to Another with OpenDataSource()
Hi ALL,Below are the Scripts for 2 Tables Named Customers and Customers_ . I want to insert records from the Customers tablein the test server :10.130.400.54 , User Credentials- Username...
View ArticleDuplicate record avoid
I have one table name as ItemmasterI have fileds ItemCode, ItemName,ItemDet,price . Now the problem is I can duplicate records with name of ItemName,ItemDet , Item code is distinct. Now I need...
View ArticleJOIN only selects first record
Hi,I wish to change my query(see below) so that when the CUSTPACKINGSLIPTRANS table is joined, only the first record for each PACKINGSLIPID is selected. Is this possible? A unique identifying field in...
View ArticleHow to use Excel financial functions in T SQL
Hi,I need to replicate the MDURATION function in SQL 2008. What is the best way to do it.
View Articlelooks like @@rowcount issue ?
I have a dynamic query like :SET @strSQL = ' UPDATE ' + LTRIM(@tblName) + ' SET Amount= ISNULL(Amount,0) + ' + CAST(ISNULL(@@dAmount,0) AS CHAR(50)) + ',ChangeDate = GETDATE() WHERE PlayerID= ' +...
View ArticleProblem in executing Robocopy using xp_cmdshell
Hi,Can you please advice me on how to execute the robocopy command which supposed to get dynamic input - filenameand do the copy operation thru xp_cmdshell (i.e) thru t-sqlsample:Set _filename =...
View ArticleEnsure Records with the Same Foreign Key have no overlapping dates
I have a project where I need to store rebate information of a particular merchant in order to calculate the total savings for a particular merchant. Here is my current table design with some sample...
View Article