Skip to content Skip to sidebar Skip to footer
Showing posts with the label Sql Server 2008 R2

Trigger Error: The Current Transaction Cannot Be Committed And Cannot Support Operations That Write To The Log File

So I am getting the following error message from SQL Server when sp_SomeProc tries to execute an in… Read more Trigger Error: The Current Transaction Cannot Be Committed And Cannot Support Operations That Write To The Log File

What Is Best Approach For Opening/closing Sqlconnection In C#

I would like to know what could be best approach to open a SqlConnection with Sql Server 2008R2 Exp… Read more What Is Best Approach For Opening/closing Sqlconnection In C#

Create Scheduler Task To Invoke Sqlcmd

I have a Requirement where i have to run a SQL Script in SQL server on a weekly basis .Result of th… Read more Create Scheduler Task To Invoke Sqlcmd

Lock A Table In Sql Server 2008 After Select

I have a main currency table. Which has two fields, one currency Type and currency value. User can … Read more Lock A Table In Sql Server 2008 After Select

Comparison Query Taking Ages

My query is quite simple: select a.ID, a.adres, a.place, a.postalcode from COMPANIES a, COMPAN… Read more Comparison Query Taking Ages

Open Xml Document And Return For Every Row, Based On Row's Path To Xml File

I'm pretty new to using XML with TSQL, and recently ran into an issue that I can't think ar… Read more Open Xml Document And Return For Every Row, Based On Row's Path To Xml File

Adding Data To Column

i have written this query to show total working time and overtime of an employee on particular date… Read more Adding Data To Column

Cannot Cast Dbnull.value To Type 'system.datetime'. Please Use A Nullable Type

This is my code var finalResults = (from r in results.AsEnumerable() where r.Fi… Read more Cannot Cast Dbnull.value To Type 'system.datetime'. Please Use A Nullable Type

How To Control Ssis Package Flow Based On Record Count Returned By A Query?

I'm trying to first check if there are any new records to process before I execute my package. … Read more How To Control Ssis Package Flow Based On Record Count Returned By A Query?

Updating Inserted Record Within Merge Statement In Sql Server 2008 R2

I have following code in my SQL Server 2008 R2 stored procedure. In that stored procedure, I am cop… Read more Updating Inserted Record Within Merge Statement In Sql Server 2008 R2

Sql Query To Select Million Records Quickly

I want to select million records from a table and I am using select query for this. Currently it is… Read more Sql Query To Select Million Records Quickly

Pdo Rowcount() Works On Mysql But Not In Sql Server 2008 R2

I have a problem when I get number of rows in SQL Server 2008 because my code works fine using MySQ… Read more Pdo Rowcount() Works On Mysql But Not In Sql Server 2008 R2

How To Replace Fetched Values With Another Column While Querying With Sql Server 2008 R2

Alright let me explain my question with example We have 1 table This table contains Id Name Number … Read more How To Replace Fetched Values With Another Column While Querying With Sql Server 2008 R2

How To Use Calculated Field In Another Field Of The Same Query

I have a select query with a few dozen fields. 'FieldA' is a Case statement about 10 rows … Read more How To Use Calculated Field In Another Field Of The Same Query

Capture Primary Key Constraint Violation In Sql Server 2008

is there a way to automatically capture (either in SQL server log or Window Event Log) constraint v… Read more Capture Primary Key Constraint Violation In Sql Server 2008

First Aggregate Function Which I Can Use With Having Clause

I have a weird requirement which I need to use inside my Stored Procedure in SQL Server 2008 R2. I… Read more First Aggregate Function Which I Can Use With Having Clause

How To Rename Database In Multi-user Mode

I am working on SQL SERVER 2008 & 2008 R2. How can I rename a database in multi-user mode? I am… Read more How To Rename Database In Multi-user Mode

How To Find Difference Between Two Columns Data?

I have a temp table with two columns of integer data i want to find the difference between two colu… Read more How To Find Difference Between Two Columns Data?

How To Create Temp Table While Joining Multiple Tables That Have To Be Pivot

I have similar 3-4 scripts for different tables to dynamically PIVOT as previously posted Dynamic … Read more How To Create Temp Table While Joining Multiple Tables That Have To Be Pivot

Alter Tables That Are Replicated In Sql Server 2008 R2

We have two databases and some tables in them are replicated. We want to add to table new rows and … Read more Alter Tables That Are Replicated In Sql Server 2008 R2