sql-server

Does Microsoft Sync Framework 2.0 support Sql Server 2005 as a client?

It appears out of the box the v1 of Microsoft Sync Framework would only support synching with a CE db, using the SqlCeClientSyncProvider. I can't find anywhere in the documentation about v2 if we can now sync between two SQL Server databases. Anyone know of hand if this is now possible (without writing my own client provider)? ...

SQL: Insert all records from one table to another table without specific the columns

I want to insert all the record from the back up table foo_bk into foo table without specific the columns. if i try this query INSERT INTO foo SELECT * FROM foo_bk i'll get error "Insert Error: Column name or number of supplied values does not match table definition." Is it possible to do bulk insert from one table to another witho...

Maintain a user's session state in an ASP.NET MVC app hosted on a web farm

What is the best way to maintain a user's session state in an ASP.NET MVC app hosted on a web farm? Out application currently uses the standard ASP.NET session on IIS 6.0 but we want to move the app to a web farm environment. I have read that we can use SQL Server session state for our application but I just want to know if anybody was...

Top 10 SQL Server performance bottlenecks

What is the most common performance bottleneck that is not caused by the database structure? ...

How do I register IBM.Data.DB2.iSeries as a linked server provider in SQLServer?

I have connected to a DB2 database on our AS400 through SQL Server 2005 (linked server) using the IBMDA400 (OLEDB) provider. However, I recently discovered that I can connect my .Net apps using the IBM.Data.DB2.iSeries.dll provider so I would like to connect to the AS400 using my IBM.Data.DB2.iSeries provider instead. However, the IBM.Da...

SQL Update Multiple Fields FROM via a SELECT Statement

This works, but i would like to remove the redundancy. Is there a way to merge the update with a single select statement so i don't have to use vars? DECLARE @OrgAddress1 varchar, @OrgAddress2 varchar, @OrgCity varchar, @OrgState varchar, @OrgZip varchar, @DestAddress1 varchar, @DestAddress2 varchar, @DestCity varchar, ...

Searching Databases

Hi. I am using SQL server 2000 and want to write a simple queary to return the name of all databases not containing equipmentpropertyid number above 905 in the defs_equipmentpropertytable. We have a hundred or more active databases all containing the same tables. Unfortunately, the defs_equipmentpropertytable is up-to-date in most of ...

Sql Server 2008 MERGE - best way to get counts

I'm wondering what y'alls would recommend as the best way to go about getting the action counts from a MERGE statement in Sql Server. So, i.e. I run a MERGE which does some inserts, some updates and some deletes, ... I would like to be able to find out HOW MANY inserts, HOW MANY updates and How Many deletes. What'd be the best way to...

Visio data model diagram to db.

I have created my db data model diagram using Visio. Is there a way to generate the DB schema from the Visio? Appreciate your response! ...

SET OPTIONS....where are they stored

Guys, Quick Questions... Where are the values for SET OPTIONS stored in the database for a SP, Func, Trigger, etc? If they are different from the global settings? SET ARITHABORT ON SET CONCAT_NULL_YIELDS_NULL ON SET QUOTED_IDENTIFIER ON SET ANSI_NULLS ON SET ANSI_PADDING ON SET ANSI_WARNINGS ON SET NUMERIC_ROUNDABORT OFF I know t...

SQL Server 2000 - Default Value for varchar fields

I have a sql server nvarchar field with a "Default Value or Binding" of empty string. It also happens to be a not null field. Does this mean that there is no default or that it is a default of a string with no characters in it. If I don't insert a value, will it insert with an empty string or fail with a "not null" error? ...

TempDB Log File Growth Using Global Temp Tables

Hi Everyone, This is really a two prong question. One, I'm experiencing a phenomenon where SQL server consumes a lot of tempDB log file space when using a global temp table while using a local temp table will consume data file space? Is this normal? I can't find anywhere on the web where it talks about consuming log file space in such...

The error "Login failed for user 'NT AUTHORITY\IUSR'" in ASP.NET and SQL Server 2008

My ASP.NET v3.5 web application is throwing the following exception when it attempts to open a connection to a SQL Server 2008 database: System.Data.SqlClient.SqlException: Cannot open database "MyDbName" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\IUSR'. The thing is, I've added NT AUTHOR...

Calling an Oracle function from SQL Server Linked Server

I have setup a linked server pointing to an Oracle DB. I want to call a function ABC in a package XYZ passing parameter K. What will be the syntax to do this? ...

How can I get all user created databases in SQL server 2005?

Hi Guys, I want list of user created databases in sql server 2005. How can list all user created databases by T-SQL? Thanks Rajesh ...

my VS2008 cannot connect to Sql Server 2008, why?

MS Visual 2008 studio says "only servers up to 2005 are supported" when connecting SQL Server 2008? how to get around this? ...

how to create a linked server using ODBC correctly?

can someone please let me know the steps on creating a linked server using ODBC connection? thanks.... ...

Using XML.Query for filtering multiple values

Hi I have XML column in my table which can contain XML like these 2 records : record 1, suppose that ID of record is 1 and XML content is <content> <node1 >10</node1> <node2 >20</node2> <node3 >30</node3> <node4 >40</node4> <node5 >50</node5> </content> record 2 , suppose that ID of record is 2 and XML content is <content> ...

how to use unpivot for sql server 2005

for this , i have many UNION ALL and how to use unpivot same result for this query SElECT COUNT(*) FROM ( SELECT ADMMASTER.ADMWARD, IPDSUMMARY.DIAGNOSES FROM ADMMASTER INNER JOIN IPDSUMMARY ON ADMMASTER.AN = IPDSUMMARY.AN UNION ALL SELECT ADMMASTER.ADMWARD, IPDSUMMARY.UNDERLYINGCAUSE FROM ADMMASTER INNER JOIN IPDSUMMARY ON ADMMASTER.AN ...

DDL script generation in Query Analyzer

Hi .. Is there any way that i can generate the DDL scripts fro all the objects (tables,procdures etc) in SQLquery analyzer at a time? Please help. ...