IS there a system table I can join to so I can query to find all tables with a column flagged as ROWGUIDCOL? thanks! Answer You could utilize sys.columns with COLUMNPROPERTY: SqlFiddleDemo Output:
Tag: sql
print SQL output in jade file
I’m trying to output an sql query in Jade file. I got it so far that I can print plain text to jade but when I try to put an output from SQL it doesn’t work can someone help me. The code in app.js (…
Retrieve Oracle last inserted IDENTITY
Since Oracle 12c we can use IDENTITY fields. Is there a way to retrieve the last inserted identity (i.e. select @@identity or select LAST_INSERTED_ID() and so on)? Answer Well. Oracle uses sequences and default values for IDENTITY functionality in 12c. Therefore you need to know about sequences for your quest…
Rip 20 million rows from Power Pivot (“Item.data”)
I received a workbook which contains two tables in power-pivot (one around one million rows, another 20 mill rows). I would like to rip this out (as anything really – but let’s say a CSV) so that I …
Which is more space efficient, multiple colums or multple rows? [closed]
Suppose if i have a table A with 100 columns of same data type and 100 rows. Table B with 2 columns and 5000 rows of same data type of above table columns. Which table takes more disk space to store …
How to show leading/trailing whitespace in a PostgreSQL column?
I can’t see leading/trailing whitespace in the following following SQL statement executed with psql: Is there a pragmatic way to see leading/trailing whitespace? Answer If you don’t mind substituting all whitespace characters whether or not they are leading/trailing, something like the following w…
Selecting and passing a record as a function argument
It may look like a duplicate of existing questions (e.g. This one) but they only deal with passing “new” arguments, not selecting rows from the database. I have a table, for example: And a function: I would like to run it on data already existing in the database. It’s no problem if I would l…
Remote connection to MS SQL – Error using pyodbc vs success using SQL Server Management Studio
I have a MS SQL database in the same network but in other computer. Using the SQL Server Management Studio (SSMS) Express, I can find the database and connect without problems. But when I use pyodbc to connect to the same server using: I get following error: OBS: I guess that the server string should be right…
how i can select records with varbinary type?
I have table in my database that has two column namely data and length. I declare data as a VARBINARY(MAX) and suppose the table has a record with length equal to 5 and data = 0x23 0x00 0x12 0x45 0x34. Table definition: The question: Is it possible to search (with a SELECT query) to find records that has 0x00…
Why does this simple query not use the index in postgres?
In my postgreSQL database I have a table named “product”. In this table I have a column named “date_touched” with type timestamp. I created a simple btree index on this column. This is the schema of my table (I omitted irrelevant column & index definitions): The table has ~300,000 …