Tag Info

Hot answers tagged

3

Don't reference it as [dbo].[vendor].[location].Lat in the SELECT list. use simply vendor.location.Lat or location.Lat or define a table alias and use that. CREATE TABLE dbo.Vendor([location] geography) GO /*Works fine*/ CREATE VIEW V1 AS SELECT v.location.Lat AS latitude FROM dbo.vendor v GO /*Fails*/ CREATE VIEW V2 AS SELECT ...


3

You may need to use SQL Server Configuration Manager to enable TCP/IP connections. The default is disabled, as below. You must enable TCP/IP to allow remote connections to the SQL Server machine.


3

Remmber you need the following assemblies: Microsoft.SqlServer.ConnectionInfo Microsoft.SqlServer.Management.Sdk.Sfc Microsoft.SqlServer.Smo Microsoft.SqlServer.SmoExtended More info http://technet.microsoft.com/de-de/library/microsoft.sqlserver.management.smo.aspx using System; using System.IO; namespace ConsoleApplication2 { using ...


3

@Mark is absolutely right. AND has higher precedence, so what your query is really saying is: WHERE record_number >= 500 AND (column_a LIKE '%something%') OR column_c LIKE '%something else%' OR column_e LIKE ... What you want it to say is: WHERE record_number >= 500 AND column_a LIKE '%something%' OR column_c LIKE '%something else%' OR ... ...


2

Your OR clause is breaking your filter. SELECT [record_number], [column_a], [column_b], [column_c], [column_d], [column_e], [column_f], [column_g], [column_h], [column_i], [column_j] FROM [schema].[table_name] WHERE record_number >= 500 AND ([column_a] LIKE '%' + @column_a + '%') OR ([column_c] LIKE '%' + @column_c + '%') OR ([column_e] LIKE '%' + ...


2

Use an OR to check if either the parameter matches the value, or both the parameter and the value are NULL, like this: WHERE ( [TBL_OUTBOUND_REVIEW].[ERROR_FREE] = @Status OR ([TBL_OUTBOUND_REVIEW].[ERROR_FREE] IS NULL AND @Status IS NULL) ) You could also use a CASE statement as your IF if you really wanted to, but I think it's easier to ...


2

Unfortunately there is no way to use SQL (that I know of) to ask DB2 for all its databases. Perhaps this is a difference between how DB2 is set up/managed versus other databases. A DB2 instance is essentially a database server. It does not do SQL per se as it is not a database. It is the "brains" or "guts" that runs the DB2 logic (and yes, it thus runs SQL, ...


2

Native, no. Heck, I barely classify the out of the box FTP component as a real component. It meets some technical specification for FTP only for the most rudimentary operations. I've usually gone the route of calling ftp.exe from the Execute Process Task with a parameter file or just used the .NET libraries for doing so. I had never thought about ...


1

When you use Encoding.Default the result is dependent on local settings: An encoding for the operating system's current ANSI code page. The specification is pretty direct about the dangers of using the default encoding and very specifically calls out the recommendation not to use it: Different computers can use different encodings as the default, ...


1

Are you sure you have the right password? If you have forgotten your password, try resetting to trust first, and then running the following sql statement to set the password: alter user postgres with password 'the_password'; Then you should be able to connect using md5 auth and the_password as the password


1

In my view, you're on the right track and validating it in C# before sending it to the database is the better way, so you're able to show the changes before a submit. A regular expression should indeed be able to solve your validating issue, but depending on how you allow the number to be entered plays a part in how complex it should be. Say do you allow ...


1

As shown in Max Vernon's screenshot in his answer, you must allow TCP/IP connectivity for remote connections. Also, if you are not allowing traffic to the default instance (TCP 1433) that would also prevent connectivity. If you are trying to connect to a non-default (named) instance, you must have the port for that instance open as well. If your connection ...


1

I suggest you use an MS SQL Server foreign data wrapper on PostgreSQL, so you need no C# and have the full power of PostgreSQL’s SELECT… INTO. Failing that, there is also DBI Links which gives you a subset of functionality and lower performance but still should be enough. Now, if you just need to use C#… perhaps there is a PL/C# that you can leverage. ...


1

At a high-level, I'd recommend a table storing all the distribution centres. You will need a second table to store the 1:n relation between an order and the multiple distribution centres. If your order table has the date of the order and the date it shipped, it should be easy to write a query and filter based on date, and join to the orders_distCentres to ...


1

It's difficult to understand your question. Do you mean that you want to copy the data in a table into new rows, but update DATE values? For example, is the following what you're trying to do? ORIGINAL TABLE_1: TABLE_ID | VALUE_1 | VALUE_2 | DATEFIELD 1 | 'Somedata' | 'Someotherdata' | 2012-05-01 ... And you want to produce: UPDATED ...



Only top voted, non community-wiki answers of a minimum length are eligible