sql-server

SQL Server 2005 seperate stored procedure CSV value into multiple columns?

I'm a SQL Server 2005 newb and I have to do something that should be easy but I'm having difficulties. For the time being my stored procedure is storing csv in one column in my db. I need to break apart the csv into multiple columns. The number of values in a the CSV parameter is static, there is always gonna be 8 values and they are al...

adding extended properties table

hi, i am trying to create a data model (sql server 2008) for the data transfer adapter factory i am building. some examples of an adapter would be FTPS, email, and web service (WS). right now this is what i have as far as DB design (see attached image): Adapter table - each row is a different type of adapter AdapterProperty table -...

What is the best database design for thousand rows

I'm about to start a Database Design that will simply manage users under companies. Each company will have a admin area that can manage users Each company will have around 25.000 users Client believes to have around 50 companies to start My main question is Should I create tables based on Companies? like users_company_0001 users_co...

SQL Server Find out default value of a column with a query

How can I find out the default value of a column in a table using a SQL query? Using the sp: sp_columns @tablename I get some info on the columns of a particular table but the default value of the columns is missing, How can I get it? ...

Report Server in Visual Studio without Reporting Services

Hi, I have visual Studio 2008 and sql server 2008 and Integration Services installed too. I uninstalled the reporting Services. I don't have reporting services in my machine anymore. But still I can see the Report Server project in the Visual Studio. I can still design,build and preview the reports. I am wondering, how come I can create...

Uploading Difficulties to Discountasp.net, new at C#

I've been trying to upload a new page to a site hosted on a DiscountASPnet server, but have been having trouble. I have been working on this site in the development server for a while now. it was already built and hosted when I got my hands on it, and I haven't worked in ASP.net before. First I uploaded the page itself, the code behind, ...

SSRS 2008 R2, VS 2008, User Defined Table Types

Hi all, I have a stored proc that I use to create some customized lists. I'm trying to create it as an SSRS report, but it's running into a sticking point where it chokes trying to deal with the User Defined Table Type parameters. Am I just screwed? As an aside, it does work when you call it with a sql exec statement. Thanks, ...

Why should GRANT be written after GO in a SQL Stored Procedure?

We had a Stored Procedure written and it had a GRANT written at the last line of the SP.. Our DBA recommended that there should be a GO before the GRANT statement, else it will be executed every time. What does this mean? I am not sure how GO will prevent GRANT executing "every time". ...

Joining against views in SQLServer with strange query optimizer behavior

I have a complex view that I use to pull a list of primary keys that indicate rows in a table that have been modified between two temporal points. This view has to query 13 related tables and look at a changelog table to determine if a entity is "dirty" or not. Even with all of this going on, doing a simple query: select * from vwDirt...

SQL Server 2005 - Inserting records using OpenXML vs delimited string

I have a bunch of employee names which need to be inserted in a table. Should I represent my data like this and use OpenXML to insert into the database:- <Employees> <Employee> Emp1 </Employee> <Employee> Emp2 </Employee> <Employee> Emp2 </Employee> </Employees> OR I should represent the Employee like Emp1,Emp2,Emp3, split the strin...

What is the purpose of "::" in T-SQL

In (non-English) book on TSQL (MS SQL Server 2005) I read about: select * from ::fn_helpcollations() Though, execution of it without "::" select * from fn_helpcollations() in my MS SQL Server 2008 R2 gives exactly the same result. What does "::" mean in T-SQL? ...

SQL server, is there any central table to get meta data of all tables?

I have to query in SQL server about which table is having maximum data and which one is having minimum data. Please tell me how can i do this.. i am runninf SQL server 2005. ...

inserting data from a asp.net page to sqlserver database

hi, there are two tables in database. one is 'books' with 4 columns pkid,title,price,writer(int) and other is 'persons' with columns pkid, name,value(int). one asp.net page is there with text boxes named title,price,writer and a submit button. i want that on filling that writer txtbox with some name which is available in 'pe...

RDL report preview hang calling stored procedure

Hi all, I am facing some problem with an RDL report. I have design 1 report, passed parameters also & bind with data source. After design when I click on preview button it runs in an infinite loop and does not show any output. If I run the same stored procedure in sql server with same parameters it gives me output in 1 sec. By same pro...

ASP.NET page content in database vs file performance?

I am creating a site whose content is dynamic and has images in it. What/How much performance hit will my DB (MSSQL) take if I save content/Images in DB? I am just trying to understand what kind of problems I may run into. I appreciate any responses. Thanks! ...

Problem in getting Sum

I have this data: name qty date flag --------------------------------------------- abc 255 11/10/1986 12:00:00 AM IN abc 300 11/10/2010 12:00:00 AM IN abc 12 11/10/2012 12:00:00 AM OUT abc 13 11/9/2010 12:00:00 AM OUT NULL NULL NULL NULL I ...

What is the difference between Primary Key and unique key constraint?

What is the difference between Primary key And unique Key constraint? What's the use of it?? ...

Simple Stored Procedure Question

I am creating a simple stored procedure in VS 2010/SQL Server 2008 as follows: CREATE PROCEDURE ReturnPrice @carID int @price decimal(18,2) output AS SELECT @price = Price FROM Cars WHERE CarID = @carID and I am receiving the following error message when attempting to save: Incorrect syntax near '@price' Must declare the scalar ...

Is it possible to bind Excel to Master Data Services through the API ?

Hello all, Not familiar with MS World, I've been ask to bind an Excel sheet with data within a MDS. Thing is, I have no clue is those two can be bind together. What's the MDS API's language ? Does Excel Language, VB if Im right, can use this API ? Thanks a lot for your answers ! ...

Monitoring batch requests per second on SQL Server through WMI

I need to programmatically (.NET 3.5, C#) monitor a SQL Server 2008 machine through WMI. I want to measure the number of batch requests per second that the server is receiving; this is what the Windows 7 Performance Monitor tool will show you under the SQL Server:SQL Statistics category, Batch Requests/sec counter. If I monitor the serve...