sql-server-2005

what happens to the resultset if the lookup table in the lookup task is empty?

Will there be any further resultset to process if the lookup table in the lookup task is empty? sagar ...

LINQ to SQL entity column name attribute ignored with guid primary key

I was working with a simple entity class with LINQ to SQL (SQL Server 2005 SP3 x64). [Table( Name="TBL_REGISTRATION" )] public sealed class Registration : IDataErrorInfo { [Column( Name = "TBL_REGISTRATION_PK", IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert )] public Guid RegistrationID { get; private s...

Configuring SQL server 2005 enterprise edition

What are the basic settings required for running SQL server 2005 enterprise edition in a local computer. When i take program from start menu it shows only sql server configuration manager, surface area manager, error reporting and a command prompt. There is no SQL server launching shortcut. How i get it? ...

Remote SP Call via Linked Servers. Asynchronous or not?

Hello Experts I have set up 2 servers which are linked. From my LOCAL SERVER, I am executing a SP that will be run on the REMOTE SERVER. The next part of the script requires me to INSERT DATA from the changes made via the SP on the REMOTE SERVER to the LOCAL SERVER. Therefore my question is, is this process asynchronous or synchronou...

IF EXISTS IN STORED PROCEDURE

hi guys, I am using following storedprocedure set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO Alter PROCEDURE [dbo].[GetUserDetailsByUserID] ( @UserId varchar(100) ) AS BEGIN IF EXISTS(Select * from Registration where UserId=@UserID) BEGIN Select [Name], [UserId], [PermanentAddress], ...

Default parameter values/optional parameters for .NET stored procedures in SQL Server 2005

SQL Server a stored procedure written in C# on the .NET 2.0 framework that has a SqlInt32 parameter. I am trying to make the parameter optional. Here is a minimal test case that just prints the integer passed to it: [Microsoft.SqlServer.Server.SqlProcedure] public static void TestProc( SqlInt32 TestInt ) { SqlPipe pipe; ...

Compressing Data Within a Query

Hello All, Suppose you have two linked servers called Local and Remote respectively. Is there a syntax that compresses (and uncompresses) the data required to be sent from the Local to Remote (or vice versa). For example, if I am updating my Local database with data from my Remote database, I would do the following: INSERT INTO [Loca...

Passing an array of parameters to Stored Procedure

I need to pass an array of "id's" to SP, delete all rows from the table EXCEPT the rows that match id's in the array. How can I do it in a most simple way? ...

SQL 2005 Database not accessible

I've moved a database from sql 2000 to a new 2005 server. Everything was fine until I logged into Sql Server Management studio with one particular user. It looks like i logged in successfully but when I try to expand the database I get 'The database is not accessible'. I can log in with windows authentication and with other sql users ...

"Array parameter" TSQL

Hi. I have a table with call data records one for each call with call data and one of the fields is the CallerId which we use when quering the DB. We use the following TSQL to simulate an array parameter, is this the way to go or are we way off? ALTER PROCEDURE [dbo].[spStudio_Get_Smdr] @beginTime INT, @endTime INT, @subsc...

Sql 2005 Table to Table merge with some data transformation

So a site I work on is migrating to a new data feed. The current data feed is fed over from an FTP site and presented to me in a two denomlized files. This is then pushed into two tables into a MS SQL 2005 server which the site then uses to run all the searches and such for (real estate site). The problem is, the new data feed is normil...

BCP utility corrupts data

I am running a bulk copy of two columns of a table from one server to another. The table on the source side has about 8 columns, but I only need 2. The table on the destination side has 2 columns (the two that I need, both are of type int) Both databases are SQL Server 2005. Here's my two bcp commands: c:\> bcp "select c1, c2 from s...

TSQL Features in SQL 2008 Vs SQL 2005

What are the advanced Features With SQL2008 over SQL2005 Particularly with TSQL ...

SQL Server: Calculation with numeric literals

I did some testing with floating point calculations to minimize the precision loss. I stumbled across a phenomen I want to show here and hopefully get an explanation. When I write print 1.0 / (1.0 / 60.0) the result is 60.0024000960 When I write the same formula and do explicit casting to float print cast(1.0 as float) / (cast(1...

Using Columns Containing non-Identifier Characters in SQL

hi, can i write a select statement i n SQL Server like: select * from emp where Emp Name='joy' or select * from emp where EmpId/Sno=7 whether spaces,special charaters like a comma are allowed in that specified select statement when the column name is having them. Thanks in advance.. ...

Sharepoint/WSS Reporting Services Integration woes

after a number of failed attempts i seem to have successfully installed the Reporting services add-in to my WSS farm. However, I seem to be missing most of the enhanced functionality eg no report library template, no report center site template. the only additional functionality available is the report viewer web part. background: 2 ser...

Data Transfer and Distribution Methods

This is my first attempt at building a sort of wiki (general one) so please support! :) I am compiling a list of methods that deal with transfering and distributing data. Please do add your thoughts to my list. I'll update the document and re-post for everyone's benefit. If I have missed a method out, please let me know and I will edit i...

How to delete when the parameter varies by group without looping? (T-SQL)

Imagine I have these columns in a table: id int NOT NULL IDENTITY PRIMARY KEY, instant datetime NOT NULL, foreignId bigint NOT NULL For each group (grouped by foreignId) I want to delete all the rows which are 1 hour older than the max(instant). Thus, for each group the parameter is different. Is it possible without looping? ...

How to write to a varchar(max) column using ODBC

Summary: I'm trying to write a text string to a column of type varchar(max) using ODBC and SQL Server 2005. It fails if the length of the string is greater than 8000. Help! I have some C++ code that uses ODBC (SQL Native Client) to write a text string to a table. If I change the column from, say, varchar(100) to varchar(max) and try to ...

How to preserve old data that might have to be reinserted into the database?

We have a partitioned view with 12 member tables. The partitioning column is a date, we have one table for each month. Data are continually being inserted into the table of the current month. Older tables are constant. At the beginning of each next month a new table is going to be created and added to the view. At the same time we are g...