Skip to content

How can I connect C# with Db with App.config?

I need to connect C# with SQL Server database using app.config. My code is: and in app.config I have: but I get an error and I can’t fix it: ConfigurationErrorExeption was Unhandled Configuration system failed to initialize Can anyone help me please ? Answer Try: You’re referencing Conn as the con…

Get Word Count of a Column using SQL

I have a table with a column called Description. The column is populated with text data. I want to create a query that returns the amount of words in each description. My thought was to create a function that takes in a value, and returns the amount of words found in the inputted text. For example, if the des…

How to round this in SQL

we just started our studying on SQL and I seem to have a slight problem with one exercise. I would need to round the result of I was trying to do it with subquery but I just did not hit the correct one even tough similar subqueries with only select seem to work well. Any help? Answer Use ROUND

Replace identity column from int to bigint

I am using SQL Server 2008, and I have a table that contains about 50 mill rows. That table contains a primary identity column of type int. I want to upgrade that column to be bigint. I need to know how to do that in a quick way that will not make my DB server unavailable, and will not delete

how to execute a .sql script on heroku?

I have a .sql file with a bunch of insert commands that I want to execute on my postgres database on heroku. But I don’t know how to do it:- If I had access to postgres console I’d type the following: but it seems that heroku doesn’t support this command. I’ve tried with but that doesn…

How to send a query result in CSV format?

I am working on ETL and I have this below sql code in my SQL Task in SSIS package. This is how i have coded. I am selecting a data from a table and result of that query as file. I want this attachment …

How do you do date math that ignores the year?

I am trying to select dates that have an anniversary in the next 14 days. How can I select based on dates excluding the year? I have tried something like the following. SELECT * FROM events WHERE …