sql-server

Rendering a Report in SQL Server Reporting Services using SOAP API

Is it possible to render a report in SQL Server Reporting Services using SOAP API without specifying the format such that you get the report toolbar? ...

SQL basic query question

I'll be the first one to admit my SQL skills are lacking. Now... Let's say we've got a database table called Posts with three columns: Id, RootId, and DateTime. What I'd like to do is get the last (by DateTime) 20 distinct RootId values. Here's the caveat though: RootId may be NULL, in which case we should consider that record as dis...

SQL Scripting Tool That Beats MS Query Analyzer?

I'm using MS Query Analyzer (as part of SQL Server 2000) to write T-SQL scripts to pull data out of a DB. This involves querying some tables, iterating through the results (using a cursor), some basic processing of the results and putting the processed data into another table. This is working pretty well as I can view the tables and stor...

Storing images in a Sql Server 2008 database using Filegroups/Filestreams

Has anyone had an experience storing user uploaded images in a MSSQL 2008 Database using Filegroups and Filestreams? I read a few articles that seemed to say they are a good idea because you get all the advantages of storing images on disk and in the db. For example I have implemented this for my current project but it seems like I'm d...

Synchronising databases SQL Server via C#

How do I synchronise a database on one server to the other? I need to do it via C#, not scripts. I was planning to use ADO.NET to retrieve the schema and dataset from one database, but how do I sync it in code? Thanks ...

INT vs Unique-Identifier for ID field in database

I am creating a new database for a web site using SQL Server 2005 (possibly SQL Server 2008 in the near future). As an application developer, I've seen many databases that use an integer (or bigint, etc.) for an ID field of a table that will be used for relationships. But lately I've also seen databases that use the unique identifier (...

Sql Connection in SSIS Package through Webservices

Hi I have SSISpackage which is developed in VS2008/SQL2008(Target Database),My source data is SQL2005. This package is execute with in the .Net framework of webservice. while executing am getting error with SOURCE Connection (with provider=SQLNCLI10 in connection string) getting error,the description as follows. Description: SSIS Erro...

len() Vs datalength() in sqlserver 2005

Hi All, Recently I faced a issue when using len() in a query to find out the length of a query, len() was not counting the trailing spaces in the value. But datalength() is counting the trailing spaces also. Does this means that if I'm doing some operation which deals with the actual length of the value then I have to use dalalength() ...

What is the best way of determining whether our own Stored procedure has been executed successfully or not.

Hi I know some ways that we can use in order to determine that whether our own Stored procedure has been executed successfully or not. (using output parameter, putting a select such as select 1 at the end of the stored procedure if it has been executed without any error, ...) so which one is better and why? ...

MS-SQL problem - Only one expression can be specified in the select list

I write the following query: select id, (select NameEn from [Campaign] where id=CampaignId) as CampaignName, createdDate, (select Name, IdNo, Email, MobileNo from [Members] where id=MemberId) from Transactions and error occurs: "Only one expression can be specified in the select list when the subquery is not in...

import from text file to SQL Server Database, is ADO.NET too slow?

My program is now still running to import data from a log file into a remote SQL Server Database. The log file is about 80MB in size and contains about 470000 lines, with about 25000 lines of data. My program can import only 300 rows/second, which is really bad. :( public static int ImportData(string strPath) { //NameValueCollection...

Rearrage column order in sql server

How to rearrange column order in sql server ? right now my column is showing like below when i physically right click and take properties: in sql server 2005 colA1 colA2 colA3 colA4 colB1 colB2 colB3 colA5 colA6 Since i know these columns (colA5,colA6) are created new ! How to make it like this ? colA1 colA2 colA3 colA4 colA5 colA...

Query for a search form

I'm developing a search form. It has about 10 fields and a search button that retrieve records from a table and put them in a gridview. The user can fill some fields, all the fields or none, and then click Search. Only the fields with info has to be used to perform the search. I use a query in a tableadapter of a dataset to make the sea...

Null values in data table

if i m using query as SELECT * FROM TABLE_NAME WHERE COLUMN1 = "ABC"; or SELECT COLUMN1 FROM TABLE_NAME WHERE COLUMN1 = "ABC"; and COLUMN1 field of table does not contain data ABC what it will return? ...

There is already an object named 'tbltable1' in the database

I am trying to insert data from one table to another with same structure, select * into tbltable1 from tbltable1_Link i am getting the following error message : There is already an object named 'tbltable1' in the database. ...

design query in editor (left outer join)

Hi how do i build left outer join or right outer join using sql server design query in editor feature (i'm using sql server2005) Thank you, Nagu ...

Column name or number of supplied values does not match table definition.

In SQL server, I am trying to insert values from one table to another by using the below query : delete from tblTable1 insert into tblTable1 select * from tblTable1_Link I am getting the following error : Column name or number of supplied values does not match table definition. I am sure that both table having same structure,colum...

How do create table with dynamic no. of columns for data entry

Hi I'm currently working on a project where I need to save data depending upon the active no. of items. Its like.. Stores can have n no of items which can be dynamically added or reduced from admin back-end. Each item can either be activated or deactivated. NO problem. But I need to manage/save these dynamic n no. of items in a table...

Table lock after integrity maintanence completion

I am using SQL Server 2000. I have a database with n number of tables in it. I have configured a maintenance plan. If I enable integrity check and run the plan, I am not able to enter any data through VC++/ODBC. Is there anything I have to check? ...

Column name or number of supplied values does not match table definition wthout droping table

In SQL server, I am trying to insert values from one table to another by using the below query : insert into tblTable1 ( [Week], 20001, 20002, 20003, 20004, 20006, 20005, W/c ) select * from tblTable1_link ( [Week], 20001, 20002, 20003, 20004, 20006, 20005, W/c ) I am getting the following error : Serv...