sql-server

Connection string problems on shared hosting with sql server 2005 express

Hi , I have a problem connecting to my db on a shared hosting. My host provider says they deployed SQL 2005 express on their database and I prepared my connection string as follows to take advantage of sql express. <add name="PMIS_DBConnectionString" connectionString="Server=localhost;AttachDBFilename=|DataDirectory|PMIS_DB.mdf;Databas...

tsql script to add delete cascade to existing tables

Hi is there a script that a can use to enable cascading when deleting a record from an exsiting table Thankd ...

Passing huge amounts of data as an hexadecimal (0x123AB...) parameter of a clr stored procedure in sql server

I post this question has followup of This question, since the thread is not recieving more answers. I'm trying to understand if it is possible to pass as a parameter of a CLR stored procedure a large amount of data as "0x5352532F...". This is to avoid to send the data directly to the CLR stored procedure, instead of sending ti to a tem...

SQL Server: Is it possible to get procedure or table creation and last alter date?

SQL Server: is it possible to get procedure or table creation and last alter date? If it is then how do to it? SQL Server 2005 ...

How do I make a function in SQL Server that accepts a column of data?

I made the following function in SQL Server 2008 earlier this week that takes two parameters and uses them to select a column of "detail" records and returns them as a single varchar list of comma separated values. Now that I get to thinking about it, I would like to take this table and application-specific function and make it more gen...

Sql server indexed view

OK, I'm confused about sql server indexed views(using 2008) I've got an indexed view called AssignmentDetail when I look at the execution plan for select * from AssignmentDetail it shows the execution plan of all the underlying indexes of all the other tables that the indexed view is supposed to abstract away. I would think that t...

How can I assign a name to the SUM column ?

how can I assign a column name to the SUM column ? i.e. select OwnerUserId, SUM(PostScore) INTO Experts from ... I get this error: An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are no...

Dynamically determining table name given field name in SQL server

Strange situation: I am trying to remove some hard coding from my code. There is a situation where I have a field, lets say "CityID", and using this information, I want to find out which table contains a primary key called CityID. Logically, you'd say that it's probably a table called "City" but it's not... that table is called "Cities"...

Data Type Conversion from SQL Server to Oracle

I am currently moving a product from SQL Server to Oracle. I am semi-familiar with SQL Server and know nothing about Oracle, so I apologize if the mere presence of this question offends anyone. Inferring from this page, http://download.oracle.com/docs/cd/E12151_01/doc.150/e12156/ss_oracle_compared.htm, it would seem that the data type c...

Is it possible to get the parsed text of a SqlCommand with SqlParameters?

What I am trying to do is create some arbitrary sql command with parameters, set the values and types of the parameters, and then return the parsed sql command - with parameters included. I will not be directly running this command against a sql database, so no connection should be necessary. So if I ran the example program below, I wo...

NServiceBus with SQL Server Message Transport

Hi, Is there any way to use SQL Server as physical message transport instead of using built in MSMQ message transport with NServiceBus ? Thanks ...

Converting data type varchar to numeric

Msg 8114, Level 16, State 5, Procedure spGetDetails, Line 88 Error converting data type varchar to numeric. I have already converted this @mfr_id to int type then also getting the above error. I'm getting error while executing stored procedure. The line which I'm getting error is: if(@mfr_id = 5) ...

Install SQL express; msm file

Where can I download sql server 2008 msm file from ?? I need to insall it with my software ?? Thanx :) Jacek ...

SQL 2008 CASE statement aggravation...

Why does this fail: DECLARE @DATE VARCHAR(50) = 'dasf' SELECT CASE WHEN ISDATE(@DATE) = 1 THEN CONVERT(date,@DATE) ELSE @DATE END Msg 241, Level 16, State 1, Line 2 Conversion failed when converting date and/or time from character string. Why is it trying to convert dasf to date when it clearly causes ISDATE(@DATE) = 1 to eva...

SQL Server 2008 > how to get service startup parameter values by query?

Is it possible to query for the SQL Server 2008 service startup parameter values using T-SQL? I'm specifically looking for the -g parameter that indicates how much memory that SQL Server will leave available for memory allocations within the SQL Server process, but outside the SQL Server memory pool [msdn reference]. ...

Microsoft T-SQL Counting Consecutive Records

Problem: From the most current day per person, count the number of consecutive days that each person has received 0 points for being good. Sample data to work from : Date Name Points 2010-05-07 Jane 0 2010-05-06 Jane 1 2010-05-07 John 0 2010-05-06 John 0 2010-05-05 John 0 2010-05-04 John 0 2010-05-03 John 1 2010-05...

Tools for website/web application load testing?

Before going into production, our client demands actual numbers of how many users our web application can handle. We have all kinds of features implemented including asset management (file uploads/downloads), documents import/export, various statistics, web-services etc. I guess we need tool which could emulate users form submission be...

TSQL - TOP X in FROM Subquery?

Can someone please enlighten me to a way to filter a subquery that is located in a FROM clause? I would like it to look something like this: SELECT * FROM TABLE_A LEFT JOIN (TOP 8 TABLE_B) ON TABLE_B.id = TABLE_A.id ...

SQL Server: export data via SQL query?

I have FK and PK all over my db and table data needs to be specified in a certain order or else I get FK/PK insertion errors. I'm tired of executing the wizard again and again to transfer data one table at a time. In the SQL Server export data wizard there is an option to "Write a query to specify the data to transfer". I'd like to writ...

Microsoft Master Data Services - When to utilize?

I'm wondering if anyone is currently utilizing Microsoft's Master Data Services? How you are utilizing it? Whether you find it useful? When you believe it would be useful? Thanks! ...