sql-server

How to write a Proper SQL Connection String?

Using VB 6 and Sql Server 2000. In my code I am using open dialog control for selecting the database file, once I selected the database(Dual_ACS.mdf) file, it will appear in the textbox (path and filename) Textbox name = databasetext My code. Cn.ConnectionString = "Provider=SQLOLEDB.1; Persist Security Info=False;User ID=" & UName & ...

How to open the sql data base in crystal report?

How to open the sql data base in crystal report? Using VB 6, SQL server 2000, Crystal Report 8.5 My code. CR.DataFiles(0) = App.Path & "\Database\DUAL_ACS.mdf" CR.ReportFileName = App.Path & "\rpt_attendancereport.rpt" CR.Action = 1 But it showing “Cannot Open Sql Server” What wrong in my code. Need VB 6 code Help? ...

is there any way to create savepoint without using transaction?

I have some queries such as update, delete.. etc. Before i run them i want to create savepoint (without using transaction). But "how?" I don't know because savepoint is part of transaction. Is there another way to achieve this job? ...

SQL Server 2008 Reporting Services Authentication

<Authentication> <AuthenticationTypes> <RSWindowsNTLM/> </AuthenticationTypes> <EnableAuthPersistence>true</EnableAuthPersistence> </Authentication> Whenever I have the above settings in my rsreportserver.config file I can view reports in my web application but I can't access the Report Manager. But whenever I have the...

SQL Server error '80040e14' Ambiguous column name

Hi there, I have an admin page to search for products to edit, but the page keeps returning the error; Microsoft OLE DB Provider for SQL Server error '80040e14' Ambiguous column name 'prod_id'. /__admin/searchproducts.asp, line 89 I'm unsure why this error is cropping up, because the page and site is a direct copy of another website ...

When did UDFs get introduced to SQL Server?

Can anyone out there remember in which version of SQL server UDFs were introduced? EDIT: Thanks guys, looks like it was SQL 2000, I had thought it earlier. Thinking about it now I do remember those days of doing nasty workarounds and just waiting for the next version... http://msdn.microsoft.com/en-us/library/aa214363(SQL.80).aspx ...

Modeling an assembly line in SQL Server

I want to model an assembly line in SQL Server. This object would progress through a linear set of steps. Each step would have a linear set of statuses: Waiting, In Process and Completed. Which is the best approach for capturing data about a change in step and/or state? Insert one record for the object and update a step field and a st...

whats the fastest way to insert streaming data into a table, DB is MS SQL server 2008

Hi! I've to write a c++ application that receives a huge data stream( many thousands of messages per second) and insert it into a MS sql server2008 db (into one or more tables) as fast as possible. I'm new to windows, and amongst so many ways described in msdn, I'm not able to judge the best way to do this, for example: 1. should I use ...

Transactional replication with no primary key (unique index)

I've just come across something disturbing, I was trying to implement transactional replication from a database whose design is not under our control . This replication was in order to perform reporting without taxing the system too much. Upon trying the replication only some of the tables went across. On investigation tables were not ...

LINQ to SQL - The database generated a key that is already in use...

Hi all, I have a simple problem that reads an Excel file (using interop) and fills an MSSQL database file with some data extracted from it. That's fine so far. I have a Shops table with the following fields: ID: int, auto-generated, auto-sync: on insert Name: string Settlement: string County: string Address: string I read the excel ...

Changing column name in SQL Server 2000

Is there a way to change a column name in sql without having to recreate the table? I've tried alter table dbo.Conforming rename column [xxx] to [xxx] and it doesn't work. any other ideas? ...

C# How to get SQL Server installation path programatically?

How do I get the installation path for a given instance of SQL Server (default and name instances) ...

SQL Server Collation, Management Studio Results differ from asp.net Results

i am usering an Table with a user name column and collation SQL_Latin1_General_CP1_CI_AS now the query: select 1 where exists(select 1 FROM USER_TABLE WITH(NOLOCK) WHERE user_name='sueßemaus') in asp.net results: 1 in SQL Management Studio results: [nothing] there is a record with name "süßemaus" compared to collation the correct Res...

sql server send output messages by email

I have been running up a stored procedure that runs several separate update and insert statements. It also prints some status messages that I can see in sql management studio. I am going to automate this procedure to run overnight but need the output as a final check to be sent to me. I know how to use the email stored procedure and hav...

how can i change a field in my SQL databse from numeric(18) to varchar(10)

i have a zipcode field in a databsae that i just took over. previously it was set as a numeric field with 18 precision but i am trying to convert it over to varchar(10). i need to make this change because the linq field are coming in as decimal and are causing issues and i want to change the linq field to simply be strings. i tried th...

Convert Postgis table to SQL Server 2008...

Is there a simple way to do that? ...

SQL Analysis Services - query cannot be processed

I am running Analysis Services, added a dimension to the mix and now I cannot browse the cube. Browsing cube with Sql mgmt says there is an unknown error, running an MDX query in SQL Mgmt returns a value on one measure and null on other measures. How do I go the next level to work out what it is hitting in SQL? Can I run a SQL Profile...

Restore Database "with replace" - is "with move" neccesary?

Database backup was created with files in location A Database files then moved to location B using ALTER DATABASE MODIFY FILE Now restoring the backup using WITH REPLACE created when files were in location A. Should the WITH MOVE option be specified with the new location? Or does WITH REPLACE imply using the current locations regardless...

Apply upgrades (application related) to database.

Guys, Since I've not done this before I am not sure if the way I am planning to do this is okay or is there a better way. Like using Windows Installer or Install Shield or Windows Installer XML (WiX) toolset. Any help would be great, as I have no clue. We have a product and we ship new version every few months. So far we've only been r...

generate sequence in sql select

I need to write a query that will generate a sort of sequenced ID for each record... so for example: ID Customer Name ------------------------- C1000 customer #1 C1010 customer #2 C1020 customer #3 C1030 customer #4 now, these "C1000" ids don't exist... only the customer names. I need to generate them when I do the sele...