sql-server-2005

Convert a MySql database to MS SQL Server 2005 with data?

I'm trying to create a completely new database from an existing MySQL database, bringing over both data and schema, but so far the only way I've been able to do this is to first import the MySQL database into MS Access, and then into SQL Server 2005? Crazy right? Surely, there is a way that doesn't involve a tedious, custom time-consumin...

Transfering the content of a variable to file in SQL Server 2k5

Hi, How do we transfer the content of a string variable to a file on a SP? I need to do these: Create an empty text file from an SP Push the content of a variable (whose len is 25487) to the newly created file The variable size is Varchar(Max), and this is the code I am trying to make work (but it ain't [Sad] ) --- Declare @cmd sys...

How can I get all user created databases in SQL server 2005?

Hi Guys, I want list of user created databases in sql server 2005. How can list all user created databases by T-SQL? Thanks Rajesh ...

Are primary keys available in nonclustered indices?

In an attempt to make the best index choices for my database, I've noticed some particular behaviour which I'd like to address. Observe the following table and corresponding index (SQL Server 2005): CREATE TABLE demo ( id INT PRIMARY KEY IDENTITY, name NVARCHAR(50) NOT NULL, password BINARY(20) NOT NULL ); CREATE NONCLUSTERED INDEX...

What is the MSSQL equivalent of INET_ATON

As the question says what is the MSSQL equivalent of INET_ATON from mySql. The reason i need this is because i imported a IP data base from http://ipinfodb.com/ip%5Fdatabase.php into MSSQL 2005 and would like to query the table now. But based on their examples i am not sure how to do that. INET_ATON(expr) Given the dotted-quad ...

varchar or nvarchar

I am storing first name and last name with up to 30 characters each. Which is better varchar or nvarchar. I have read that nvarchar takes up twice as much space compared to varchar and that nvarchar is used for internationalization. So what do you suggest should I use: nvarchar or varchar ? Also please let me know about the performa...

Upload a file using FTP with SSIS

I need to upload a file using an FTP task in SQL Server 2005 SSIS. While uploading I am unable to get the folders created on the FTP server. Is there any other solution in SSIS for uploading a file to the FTP server? ...

Concatenate ntext in SQL Server 2005

Hi, I need to concatenate 2 ntext columns into one. I can't convert them to nchar, cause both contains strings longer than 4000 chars. Is there a way to do this in SQL Server 2005? ...

SSIS Derived Column

I am not sure if the "Derived Column" transformation is my solution, but here is my issue. I am importing a CSV file and one of the column has data sorrunded by "'" e.g '2009-01-01' instead of 2009-01-01. Can I use the "Derive Column Transformation" to remove the single quotes? What would the expression be? Solution ~ Used the following...

Can I configure the output of microsoft sql server management studio? query + output window take up too much space

I am new to Sql Server. One of the things that I am seeing is that I am writing a query in the top window and viewing results in the bottom window. The problem is that the result of the query takes up a lot of space vertically.. some queries take up a lot of space vertically. I want to see both the query and the query result side by...

ssis connection manager not storing sql password

I used to have a dts that had sql server authentication connection. Basically the userid password is stored in the package itself. Now when I go to SSIS the password is not getting stored to the package. I saw this when I google the problem. http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/c720e694-2f58-483a-9c...

Rebuilding large SQL indexes isn't changing the fragmentation percentage

I have a large database running on SQL Server 2005. I query the DMV sys.dm_db_index_physical_stats to get index fragmentation information. I was shocked to see avg_fragment_size_in_percent reporting a large amount of indexes with very bad fragmentation levels (99% for a lot of them). These are on tables with non-trivial page counts (...

Cannot Find Stored Procedure Error

I recently did an import of database from a sql server 2000 database to a sql server 2005 database. I've gone through and setup what I thought were the same login credentials and owner permissions that I had previously setup in my old database. All of the code base I'm working has stored procedures listed simply by stored procedure name...

SubSonic 2.2 Left join error

I know this may have been answered but SubSonic 2.2 causes an error in the SQL provider when trying to do a Left join (Left inner join to subsonic) instead of creating SQl like SELECT * FROM table1 LEFT JOIN table 2 ON table1.id = table2.id it creates: SELECT * FROM table1 LEFT INNER JOIN table 2 ON table1.id = table2.id and this ...

Full-search text query

I want to add simple full-search-text to my webapp, that can accept multiple words to search. Example search entry: "Online SQL books" Should I transform it to: WHERE (CONTAINS(myColumn, '"Online*" and "sql*" and "books*"' )) or : WHERE (CONTAINS(myColumn, '"Online* sql* books*"' )) or maybe: WHERE (CONTAINS(myColumn, '"Onlin...

SQL query to select at most one valid row by date w.r.t. foreign key

I have a table (SQL Server 2005) with the following columns: State: - StateId INT PRIMARY KEY - VehicleId INT - ValidFromDate DATETIME For each VehicleId there can be several rows in this table. I want to select the currently valid states (with a date parameter). There can be at most one valid state for each vehicle (the one with the ...

Retrieve Reports, Folder and Report Server Name ina Tree Structure using ReportServer2005 API?

Hi, I am writing a Custom C# code that uses Reporting Services Web Service to retreive folders, and reports underneath each folder. On top of that, I want to make each of those reports linkable, so that when you click on it, the link will take you to another Web App that displays the Report. I have following Code so far, and I dun know h...

SQL, OPENXML and DateTime conversations...

Hi, I've inherited a mass of stored procedures that take as their only parameter a block of XML, the author then cracks it (using OPENXML) and then updates the a row. I've come across a problem while updating a table that has datetime columns, the following is a snippet of data that currently fails: declare @stuff nvarchar (max); set...

SQL Server Job exit with error when running in scheduled job but runs fine when running job manually

I have a job on SQL Server 2005 running a ssis package. The package as the protection level 'EncryptSensitiveWithPassword' the job has only one step of type Operating sytem(CmdExec), since the ssis uses an excel output file and the server is 64bits I do pass the password in the command run as a server proxy The job runs fine when I...

A severe error occurred on the current command. The results, if any, should be discarded.

I'm getting "A severe error occurred on the current command. The results, if any, should be discarded." I'm using SQL 2005 SP 3 (9.00.4035) I have a stored proc which saves a record. As far as I can tell this error gets thrown when that procedure gets called too many times in quick succession, or maybe simultaneously by different th...