SQL Server Performance and clustered index values

I have a table myTable with a unique clustered index myId with fill factor 100% Its an integer, starting at zero (but its not an identity column for the table) I need to add a new type of row to the table. It might be nice if I could distinguish these rows by using negative […]

Calling a function from within a select statement – SQL

I have the following statement: SELECT CASE WHEN (1 = 1) THEN 10 ELSE dbo.at_Test_Function(5) END AS Result I just want to confirm that in this case the function wont be executed? My reason for asking is that the function is particularly slow and if the critiria is true I want to avoid calling the […]

Example of a very insecure ASP.NET application

I am looking for a very insecure ASP.NET application. Ideally i’m looking for an application that was written by a noob who has made a lot of security mistakes. If the app has a MS-SQL back-end that would be a bonus. I know of two cool projects for PHP and J2EE which fill my needs. […]

Is GO Supported in MySQL?

I’m sorry for the question but I am terribly a newbie in using MySQL Database. I just want to know if GO in MS SQL is supported in MySQL. Thanks,

SQL CLR – Does lock statement make any difference?

I have written the following piece of code ( sql clr stored procedure ) that writes messages to a local file. The problem occurs when multiple connections call the stored proc at the same time. So I used a lock statement. But this doesn’t seem to make any difference? What am I doing wrong here? […]

Where to put WHERE clause?

Why can’t I put WHERE clause after ORDER BY? SELECT column1 FROM myTable ORDER BY column2 WHERE column2 = 5 Is there any standard reference? Where can i get a SQL standard draft?

INSERT query with SELECT query?

I have the following INSERT statement: INSERT INTO [StoreTestDB].[dbo].[KitItem] ([KitItemGUID] ,[KitGroupID] ,[Name] ,[Description] ,[PriceDelta] ,[WeightDelta] ,[IsDefault] ,[DisplayOrder] ,[ExtensionData] ,[TextOptionMaxLength] ,[TextOptionWidth] ,[TextOptionHeight] ,[InventoryVariantID] ,[InventoryVariantColor] ,[InventoryVariantSize] ,[CreatedOn]) VALUES … … … I need to run another query to find out the KitGroupID based on the name which will be a font. Here is how i roughly want […]

passing ” from c# to sql server

I am trying to pass a script that contains the character ” from c# to sql server using thisCommand.ExecuteNonQuery(); The problem is that the String is represented as \” instead of “: inside the string thisCommand.CommandText = SQLscript; (string SQLScript) How can I convert all the ” characters to \” so that in sql I […]

Find text of a column in other column with T-SQL

I have a doubt to find text from one column in a table; in other column from other table. Imagine that you have this columns: And you want to find the COMPLETE text of [A].X in [B].Y And to discover where do you have the match. The colour yellow show this choice: I have been […]

display the length of the first word of a dataset

Hi I’m having problems trying to switch the output of the FirstWordLength to print the amount of characters in each first word this output to SELECT InvoiceLineItemDescription, LEFT(InvoiceLineItemDescription, CASE WHEN charindex(‘ ‘, InvoiceLineItemDescription) = 0 THEN LEN(InvoiceLineItemDescription) ELSE charindex(‘ ‘, InvoiceLineItemDescription) – 1 END) AS FirstWordLength FROM InvoiceLineItems ORDER BY FirstWordLength desc; It should look […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.