sql-server

Passing a varchar full of comma delimited values to a SQL Server IN function

Duplicate of Dynamic SQL Comma Delimited Value Query Parameterized Queries with Like and In I have a SQL Server Stored procedure where I would like to pass a varchar full of comma delimited values to an in function. Example Declare @Ids varchar(50) Set @Ids = ‘1,2,3,5,4,6,7,98,234’ Select * from sometable where tableid in(@Ids) Thi...

Reporting Services Problem Rendering RTF

Hi all, I'm using VS.NET 2005 and SQL Server 2005. My development computer is running Windows XP SP2. SQL Server 2005 database and reporting services are running on Windows 2003 Server. My business requirement is to develop and deploy a report which takes rich text (RTF) stored in the database (datatype = TEXT) and converts it to an ...

T-SQL Subquery Max(Date) and Joins

I'm trying to join multiple tables, but one of the tables has multiple records for a partid with different dates. I want to get the record with the most recent date. Here are some example tables: Table: MyParts Partid Partnumber Description 1 ABC-123 Pipe 2 ABC-124 Handle 3 ABC-125 Light Table:...

SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE

Hello, When I run web application via VS 2008, the application is able to log onto Sql server and check credentials ( user name and password ) entered by the user, but when I browse to this application via IIS 7 and try to postback user name and password, the application reports an exception: System.Data.SqlClient.SqlException: Logi...

Should a development environment disable foreign keys?

So while we're using foreign keys in our current project, I've heard the argument before that enabling foreign key checking within a development environment simply puts roadblocks in front of developers - code should not rely on foreign keys being in place. I was wondering what people thought about this idea - when developing, do you ke...

staging and production database

I need to run calculations on a very large database. The application slows down significantly when I run the calculations. A possible work around would to copy this into a second database and run the calculations offline. When it's done switch it with the live database. Can this process be automated? is this what Google does with their ...

Debugging stored procedure in SQL Server 2005 from Visual Studio?

I see a lot of frustrated questions here and elsewhere with no clear answer. I am trying to get the stored procs to debug, but with no success. Client: either VS2005 or VS2008, works in neither. When I select 'Step into Stored Procedure' from the sproc context menu, I get "Cancelled by User' in the debug window and that's the end of...

How to match two email fields where one contains friendly email address

One table has "John Doe <[email protected]>" while another has "[email protected]". Is there a UDF or alternative method that'll match the email address from the first field against the second field? This isn't going to be production code, I just need it for running an ad-hoc analysis. It's a shame the DB doesn't store both friendly and non-fri...

SQL Server command line backup statement

Does any one know if there is a way to script out SQL Server backup in to a batch file, so that it could be executed from a command line? ...

Localizing data that is generated dynamically

This was a hard question for me to summarize so we may need to edit this a bit. Background: About four years ago we had to translate our asp.net application for our clients in Mexico. Extensibility and scalability was not that much of a concern at the time (oh yes, I just said those dreadful words) because we only have U.S. and Mexican...

synchronize two sql server 2005

I need to synchronize two sql server 2005 instances between intranet and extranet (through a firewall). Synchronization will be initiated from the intranet. What solutions do I have at my disposal? intranet db: table t1 -> extranet db: table t1 intranet db: table t2 <- extranet db: table t2 i.e. intranet t1 content should be pushed out...

how to create a scheduled process in sql server

In MSSQL Server 2008, how would I go about creating a scheduled process that: Takes the sum of a float column from specific users in a user column and then comparing which is has the greatest sum and storing that number along with the user whom has that value into a separate table on a weekly basis? ...

Is it necessary to serialise properties when using sqlserver session state for .net 3.5 framework and IIS 7.0

I was wondering if the following error, System.Web.HttpException: Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted was caused by not serialising properties. Any ideas? Thank...

Proper way of storing RadioButton values in DB

Hi All, I need some suggestions on following code: Scenario: Its like a Opinion poll, You have to choose Yes/No and the data will be stored on DB.But I think this code can be optimized,can some body suggest proper way of doing this. <form id="form1" runat="server"> <div> <asp:radiobuttonlist id="RadioButtonList1" runat="server...

Installing Dynamics AX 4.0 SP2 on SQL Server 2008

Is it possible to install AX 4.0 SP2 on SQL Server 2008 and Windows Server 2008 ...

How to consume com libraries for SQLSERVERSMO ?

Hi I hav created a com library by which i can discover the SQLVolumes using SMo namespace in VS2005. Now i want to use this com library in VS2003 to discover the same sqlvolumes in another machine where vs2003 installed. Can i use like this. I hav created a COM using version VS2005 and now i want to consume it in VS2003 is it possible?...

operating system information from a microsoft sql server instance

Does anyone know how to get the operating system information from a microsoft sql server instance via sql? Using SERVERPROPERTY can get some information but I need to get the operating system e.g. 'Microsoft Windows NT 5.2 (3790)' Thanks ...

Sql server function for displaying word frequency in a column

I have a table that lists a freet text input from a survey where enterents were allowed to enter their responses (regarding colours they would like to have in their wedding) I would like to write a sql function that gathers all the information from this column, and orders counts the frequency of each word, ordering the result set by thi...

Windows Authentication Trusted Connection Problem?

MSSQL Server is in the "abc" domain and have mixed mode authentication. I am connecting from the machine which is not in domain or in a domain "xyz" but with in the same network using MSSQL Jdbc driver 2.0. I have logged in as admin or account in xyz domain. It works fine using following url for connection for "sa" or SQL Mode Authentic...

False Alarm: SqlCommand, SqlParameter and single quotes

Hello! I'm trying to fix single quote bug in the code: std::string Index; connection->Open(); String^ sTableName = gcnew String(TableName.c_str()); String^ insertstring = String::Format("INSERT INTO {0} (idx, rec, date) VALUES (@idx, @rec, getdate())", sTableName); SqlCommand^ command = gcnew SqlCommand(insertstring, connection); St...