sql-server

How many OUTPUT parameters can we declare for a stored procedure in SQL Server ?

How many OUTPUT parameters can we declare for a stored procedure in SQL Server ? ...

Stange column name appearing in nHibernate generated SQL

For some reason the following mapping seems to be creating me a very strange column name that I cant find anywhere. There error occures when trying to load the Events collection which is defined as a IList<Event> <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="JeanieMaster.Domain....

Is there a severe performance hit for using Foreign Keys in SQL Server?

I'm trying my best to persuade my boss into letting us use foreign keys in our databases - so far without luck. He claims it costs a significant amount of performance, and says we'll just have jobs to cleanup the invalid references now and then. Obviously this doesn't work in practice, and the database is flooded with invalid reference...

Is there a view or stored procedure that allows knowing privileges user's have over views in SQL Server?

I need to know which views does a user have which privileges on. I'm searching for something like INFORMATION_SCHEMA.TABLE_PRIVILEGES or sp_table_privileges but for views instead of tables. Is there any? ...

Connection between J2me and Sql Server 2008

I want to connect my mobile application(J2me) with SQL Server 2008. Please help me. I'm new in j2me. I need any articles or examples about this connection. ...

Disable triggers in LINQ to SQL

We have created a table with a trigger that updates a ModifiedDate field in it each time there is an UPDATE/INSERT. For a particular transaction in our app, though, we would like to temporally disable this trigger. Would it be possible to do this directly from LINQ? (Directly, not calling a stored procedure) ...

What a StoredProcedure

Hi. This is a stored procedure (at least I have to be assuming so), that constructs an Sql query as a String and then calls it with exec. For some reason the dude that called himself a programmer, concatenates some values using "~" characters and them splits them back in the application layer. This SP breaks when, some checkbox is "selec...

How to find SQL Server queries that took a lot of time?

I have application that is up more than 3 days. I can see in logs that there was a moment when application executed some SQL query and this took a lot of time, probably because of some db locks. I heard that there is a query for such situations. So I need to be able to ask all queries that took, for example, more than 30 minutes. Is i...

Problem with SQL Server smalldatetime insert query.

I have the field: APP_DATE (smalldatetime) I'm doing this query: INSERT INTO table (TYPE, CODE, APP_DATE, DATE) VALUES ('APP', '123', '02/10/2010 12.30', GETDATE()) It fails: Msg 296, Level 16, State 3, Line 1 Conversion from datatype char to smalldatetime generated a value not between the interval of valid values. Instruction has...

Selecting a approximate values by using stored procedure

Using SQL Server 2005 and VB.Net Table1 ID Name Dept 001 Raja IT 002 Ravi CSE 003 Suns IT Stored Procedure Create Procedure Selecttable1 As Select ID, Name, Dept from table1 I want to execute the stored procedure with condition like cmd = new sqlcommand("Exec SelectTable1 where id like '" & idsearch.Text & "%' ", dbcon) cmd.Exe...

How to query Webtrends ODBC from Sql Server 2000

I have a webtrends installation. i would like to query the webtrends and show the stats on my webpage. can i do it using linked servers (couldn't find the option for webtrends) or can i do it using openrowset (tried but it doesn't work) -Vivek ...

How to search a varbinary field in SQL Server?

I have an application where I allow users to upload files, mainly PDF and Word documents. These files are stored in a varbinary field in the database. For what it is worth, I need to have these files available regardless of how the user is accessing the application, via Web or Windows Forms application or any other Presentation layer. I...

Determine dates by number of days, "what date is 180 days from now

How to determine dates by number of days from now - "What date is 180 days from now?" ...

SSIS Data Flow - How to load identical data into two places?

How can I make identical output from a transformation go to two separate places e.g., an OLE DB destination and a DataReader destination? Background: I have an existing package that reads data from a text file, does some transformations, and loads the data into a SQL Server table. Now I'm trying to make the package be callable from ...

Replacing SqlDependency with manual code

We work in .Net 3.5, and we have SqlDependency in the code, which requires the .Net user to have CREATE permissions and other permissions. The DBAs here want to avoid giving the .Net user such vast permissions. Is there a way to bypass SqlDependency by manually doing what SqlDependency does? Running a background process with more per...

Is there any benefit to my rather quirky character sizing convention?

I love things that are a power of 2. I celebrated my 32nd birthday knowing it was the last time in 32 years I'd be able to claim that my age was a power of 2. I'm obsessed. It's like being some Z-list Batman villain, except without the colourful adventures and a face full of batarangs. I ensure that all my enum values are powers of 2...

How to handle single character search terms in MS-SQL FreeText searching?

I am having a problem with a FreeText search, currently running on a SQL 2000 server. In a table of approximately 1.3 million rows which contain company names, I am attempting to use a FreeText query. However since SQL Server strips out special characters and single characters when building its index, our code does the same when subm...

Is System.Data.SqlTypes portable?

Can I use the structures in System.Data.SqlTypes with the Oracle db driver? MSDN says: The System.Data.SqlTypes namespace provides classes for native data types in SQL Server. Is that it? End of line? I would really like to use these types but not if they tightly couple my code to a SQL Server. ...

python & sql server

When I do a select statement for varbinary field in microsoft enterprise manger i get the field on readabel hex format like ab2c2f2d... but when i do the same statment with pymssql i get a gibrish the select statment is : select x from table --where x the varbinary field could someone help with this issue ? ...

Linq to SQL - return record details from two tables

Hey, I'm having some trouble with a linq query. It's a simple problem, but I'm not sure what the best way to approach it would be. I have two tables (I'm only showing relevant fields) called Artist and Song: ARTIST - int ArtistID (pk) varchar Name SONG - int SongID (pk) uniqueidentifier UserID (To lookup songs the use...