sql-server-2005

creating a address database

I am re-creating a part of my company’s database because it does not meet future needs. Currently we have mainly a flat file and some disjoined tables that were never fully realized. My way of thinking is we have a table for each category except maybe the zips table, which may serve as a connect it all together table. Please refer to im...

sql server 2005 source control

I have connected the Team Foundation Server to my SQL Server 2005 Management Studio and added my Stored Proc's to the new project to TFS. All my SP's are checked in and everything works fine. But I have a question. I have my project that shows in Solution Explorer and I have the Object Explorer that shows all the Databases and SP's on th...

Sharing Common SQL Queries Amongst a Team

I don't even want to think about how many man hours have been spent writing the same queries to join over the exact same tables at my company. When I first started at my job I identified this as an inefficiency and started writing views in a separate schema for the sole purpose of developer convenience. My boss didn't like this very muc...

What is the keyboard shortcut to view a SQL Server 2005 (Management Studio) stored procedure

I heard that there is a keyboard short cut to bring up the code of a SQL Server 2005 (Management Studio) stored procedure. This key combination would do the same function as sp_helptext. This may only be an Urban Legend. Thanks ...

Using sqlsrv_connect on Platforms other than Windows

I've inherited some code that uses the sqlsrv_connect method to instantiate a connection to a SQL Server database. My personal development machine is an OS X box that I'm running apache an PHP on. I have an instance of SQL Server running in a virtual machine. When I attempt to connect to the database, I get the following error. Fatal...

Convert Access queries to SQL Server views when using DTS

I'm using DTS to import data from an Access database to SQL Server 2005. It seems that DTS imports Access queries as tables instead of views, which won't work for me. Is there any way around that? ...

Storing the url in SQLSERVER 2005 using C# code(data sets)

I was trying to store the url on button click using the following code.There were no error but the required url is not sroeing in my column field (i used ntext data tpe for this).Please help me if there was some mistake in my code public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs ...

How to cross join two tables in SQL server

HI I have a table EMP_SCHED which contains COMMENTS Column for EMP_ID and another table SHIFT which also contains COMMENTS column for EMP_ID.Now for a given date range I need to pick COMMNETS from both tables . For example in I have 7 EMP_IDs in EMP_SCHED table and 2 EMPIDs in SHIFT .I need all the EMPIDS and COMMNETNS and place the co...

SQL Server table creation date query

How can i get the table creation date of a MS SQL table using a SQL query ? I could not see any table physically but i can query that particular table ...

subsonic 3.0 , The SqlServer default value doesn't work?

I used subsonic 3 with T4,It's very simple to use.But I get a problem now.I specify the default value in the sqlserver 2005.Then I called save() method in subsonic.I found the default value doesn't work. ...

SQL 'Like' operator and 'aa'

We've stumbled upon a very odd problem in one of our applications. The seach engine uses a stored procedure to compare a bunch of filters. However when a specific type of string is inserted, the sql server (2005) behaves very odd. I've isolated the problem to the following: select 'match!' where 'teliaa' like '%telia%' The collation ...

SQL Server Column types for lots and lots of text

I'm working on a project which replaces a piece of paper, and on that piece of paper, there are essentially two kinds of text fields. One is 10-40 characters and works well with varchar, but the other is a big box with "attach additional sheets as necessary" at the bottom of the box. So, we're talking a lot of text. What are the adv...

Guidelines for creating additional full-text catalogs

The nice wizards says If this is a large table or view, or if the chosen full-text catalog has indexed or other large tables, consider assigning this table or view its own full-text catalog "Large" is a pretty subjective term, is it 1000 records or 1,000,000 in a table? What guidelines do you follow when creating additional full-t...

What is the data type of "select 123.866" in SQL server 2005?

If I just write something like select 10.00; What type does this give me? Here's a test I ran, to test the binary representation of these types. The big surprise here is that none of the casts actually match the first row! select cast(123.866 as binary) union all select cast(cast(123.866 as real) as binary) union all select cas...

MS SQL Server 2005 sp_stored_procedures

I'm currently running the sp_stored_procedures stored procedure to retrieve a listing of SP for a given data source. I will need to query this dataset by it's PROCEDURE_NAME and PROCEDURE_OWNER columns. However, PROCEDURE_NAME seems to have a strange return value. It seems to append a semicolon and a number to the end of the name. se...

SQL Server error on update command - "A severe error occurred on the current command"

Running the following query in Management studio update table_name set is_active = 0 where id = 3 gives the following error, Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded. Msg 0, Level 20, State 0, Line 0 A severe error occurred on the current command. Th...

How can I get installed sql server instances??

Hi Guys, How can I get installed sql server instances from registry? How I can determine default instance?? Thanks Rajesh ...

Stored procedure inside a insert statement

I am trying to generate random data for my sql server database. Ive created a stored procedure that takes length of string to be generated but the problem is that it wont allow me to call it inside the insert statement. insert into table1 (varchar_data,int_data) value ((sp_GenerateRandomString 4),CAST(RAND() * 10 AS INT) % 6 + 1 ) al...

SQL Rotating numbers

I want to create a rotating logic in sql like consider there are 3 numbers 1,2,3 then first week 1,2 will be selected next 3,1 next 2,3 and so on..... if there are 4 numbers 1,2,3,4 then 1,2 next 3,4 next 1,2 so on... Like that i want to generate the numbers in sql server.Please help me. ...

Reporting services in Sqlserver

i know crystal reports very well and i work on this for last 3 years. I wanted to learn Reporting services of sqlserver so which is the best resource to learn the Reporting services quickly ? ...