sql-server

Microsoft SQL server hosting that supports DTS

Could someone suggest a shared SQL Server solution that supports DTS packages? Update: I was hoping to use the PostgreSQL ODBC driver and a DTS package to keep data synchronized between MSSQL server and Postgres. After getting my hands on SQL Server 2005 and attempting to do this I realized SSIS doesn't seem to play nicely with the Pos...

How can I transfer data to other database in SQLServer 2000!

Hello, I have two Database, DB1 and DB2. How can I transfer data of DB1 specific table to DB2 in SQL Server 2000? ...

How to insert a range of keys in another column

I've just gone blank. I have a many to many relationship with three tables. Lets call them A, B and C. C stores the primary keys of the other two tables. Now, I would like to insert all primary keys from table A, and lets say primary key 1 from B into table C. I just don't get it. All I came up with was some stored procedure that runs ...

convert database table into XML schema file

Hello everyone, I am using SQL Server 2005. Is there any command or GUI tool (e.g. any menu/function from SQL Server management studio) to convert database table into XML schema file (.xsd)? thanks in advance, George ...

How do I connect to a distant sql server database in a winforms app?

The title speaks for itself. I'm building a winforms C# 2.0 app. Any tutorials or inspiring ideas? ...

SQL Server Express 2008 replication/synchronisation

We are looking at developing a small, simple, Access system for a client using SQL Server Express (2005 or 2008) as database. The only complicating factor is they have two offices and they will need to synchronise some (but not all) data between them. What are my options with the Express edition for doing this? Is there any advantag...

How can i use ' when - between ' statement in sql?

This query gives me syntax error in when-between line. how can i solve them? alter FUNCTION [dbo].[fn_GetActivityLogsArranger] ( @time AS nvarchar(max) ) RETURNS nvarchar(max) AS BEGIN declare @Return varchar(30) select @Return = case @time when between '15:00' and '15:30' then '15:00-15:30' when between '15:30' and '16:00' then '15...

MS SQL Server 2005, write varbinary to file system

Hi, Using just an sql query is it possible to write the contents of a varbinary cell to the file system? I have a column that stores pdf s as and for some quick testing I'd like to write out the pdfs to the filesystem. Thanks for any help. ...

How to add user-defined function too parameters ?

Query gives me some error: Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'from'. Msg 156, Level 15, State 1, Line 9 Incorrect syntax near the keyword 'group'. select Count(Page) as VisitingCount, dbo.fn_GetActivityLogsArranger(CONVERT(VARCHAR(5),Date, 108)as [Time] from scr_SecuristLog where Date between ...

How can I change a field in a SQL server database that's set to "Read Only Cell" ?

I have a SQL database that has a table with a field set to "Read Only" when I look at it through Microsoft SQL Server Management Studio Express. I need to change some data within that field manually but I can't see any properties that I can change that will let me override this. Will I need to write a sql script on the table to do thi...

How to migrate from my WAMP environment to using MSSQL?

I have on my local PC installed WAMP environment (using WampServer OS). Now I would need to change one script from working with MySQL to MSSQL. I have no idea at all how to proceed, where to download MSSQL, how to install it and how to connect with PHP? Thank you very much ...

Extending SSIS 2005 Packages with Custom Objects

Am I right to be concerned about extending SSIS packages with custom objects? I accept custom objects can extend the functionality of SSIS and can reduce repetition & complexity within SSIS. Are there any guidelines as to when to use custom objects? What are the risks e.g. performance, maintainability etc? Where do I draw the line? ...

Accessing SQL Server from Console application

I have a simple Console Application which connects to SQL Server database. However it throws the following error while running. Any clues? Unhandled Exception: System.Data.SqlClient.SqlException: Cannot open database "Database" requested by the login. The login failed. Login failed for user 'MYDOMAIN\MYUSERID'. at System.Data.SqlClie...

SQL Server: An error occurred during the generation of the asymmetric key.

create asymmetric key asymmetrickey from executable file = 'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll' Why can't I use the above to generate an asymmetric key from framework libraries (for installing in SQL server as references for CLR functions). It gives an error: "An error occurred during the generation ...

How do I call a User Defined Function to use with select, group by, order by?

I have Table1 and I need to get it to look like Table2: Table1 VisitingCount | Date ----------------------- 1 | 15:09 3 | 15:10 7 | 15:15 1 | 15:39 2 | 15:40 3 | 15:47 Table2 VisitingCount | Date ----------------------------- 11 | 15:00-15:30...

How to edit the SQL Agent Job from within SSMS 2005?

I am trying to edit or view the SQL Agent's job (I am the owner of this job) from SSMS 2005 and I can't find out how to do this. When I am doubleclicking a job or entering job's properties I get empty "New Job" window. Is there some way to correct this behavior? Thanks ...

displaying a table's field in a textbox

I have a table and I want to select a field in it and then display it in a text box something like: SELECT userName FROM userTable WHERE (userLogged = 'ON') how can I display the selected username in a textbox? BTW the userLogged indicates wether the user is logged in or not if the user is logged in then the userLogged will be chan...

Where can I find SQL server developer edition (2005 or 2008)

As far as I know, the developer edition of SQL Server is available to everyone. I cannot seem to locate the download anywhere though! I have a technet plus, but even there I don't see the developer edition. I need the developer edition for the enterprise-only features, or I'd use SQL Server Express. Update 1. I am NOTlooking for SQL exp...

Prevent recursive CTE visiting nodes multiple times

Consider the following simple DAG: 1->2->3->4 And a table, #bar, describing this (I'm using SQL Server 2005): parent_id child_id 1 2 2 3 3 4 //... other edges, not connected to the subgraph above Now imagine that I have some other arbitrary criteria that select the first and last edges, i.e. 1->2 a...

How do I decrease the size of my sql server log file?

So I have been neglecting to do any backups of my fogbugz database, and now the fogbugz ldf file is over 2 and half gigs. Thats been built up over the six months we've been using fogbugz. I backed up the database, then I backed up, and truncated the transaction log, yet the transaction log is still 2 and a half gigs. I did a shrink on t...